Browse Source

Object interface added.

master
Kolan Sh 9 years ago
parent
commit
8bc5c25008
2 changed files with 19 additions and 0 deletions
  1. +4
    -0
      Figure.h
  2. +15
    -0
      Object.h

+ 4
- 0
Figure.h View File

@ -24,18 +24,22 @@ static inline const char* Figure_type (const Figure *this)
{
return this->vtable->type ();
}
static inline Figure* Figure_clone (const Figure *this)
{
return this->vtable->clone (this);
}
static inline void Figure_destroy (Figure *this)
{
this->vtable->destroy (this);
}
static inline void Figure_draw (const Figure *this)
{
this->vtable->draw (this);
}
static inline double Figure_area (const Figure *this)
{
return this->vtable->area (this);


+ 15
- 0
Object.h View File

@ -14,4 +14,19 @@ typedef struct Object
} Object;
static inline const char* Object_type (const Object *this)
{
return this->vtable->type ();
}
static inline Object* Object_clone (const Object *this)
{
return this->vtable->clone (this);
}
static inline void Object_destroy (Object *this)
{
this->vtable->destroy (this);
}
#endif // __OBJECT_H__

Loading…
Cancel
Save