2005/5/10

     
 

Interface Types

artefaktur

| Basic Types | Enum Types | Object Types | Array Types | Interface Types | Exception Types | Member Types | Method Types | Namespace Types | Foreign Types |



Inteface types describes only an interface.
These interfaces has to be implemented by an Object


Content of this chapter:

   Basic Interface



 Basic Interface


Here a sample of an interface and a class implemting this interface:



// this defines RTransformable, TransformableArray and RTransformableArray
ACDK_DECL_INTERFACE(Transformable);

enum Axis
{
  Horizontal,
  Vertical
};
ACDK_DEF_ENUM(Axis);

// the interface
class Transformable
      ACDK_INTERFACEBASE // needed for dispatching
{
  ACDK_WITH_METAINFO(Transformable) // optional, for class information see  Metainfo
public:
  virtual void rotate(int degree) = 0;
  virtual void mirror(Axis axis) = 0;
};

ACDK_DECL_CLASS(Shape);

class Shape
: extends acdk::lang::Object
, implements Transformable
{
  ACDK_WITH_METAINFO(Shape) // optional, for class information see  Metainfo
public:
  virtual void rotate(int degree)
  {
    // implement the functionality    
  }
  virtual void mirror(Axis axis)
  {
    // implement the functionality    
  }
};


Please refer also to:  Enum Types.