SPRAAK
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Namespaces | Macros | Typedefs | Functions
spr_oo.c File Reference

Provide the object oriented layer for the SPRAAK environment. More...

Namespaces

 xref_spr_class
 Working with SPRAAK classes and objects
 
 xref_spr_class_example1
 "Example using C++ style multiple inheritance"
 
 xref_spr_class_example2
 "Example using single inheritance and Java/objective-C style interfaces"
 

Macros

#define SPR_CAST(spr__base, spr__class, spr__object)
 Cast the type of a class object. More...
 
#define SPR_CLASSID_FORM_CLASS(spr__class)
 
#define SPR_DO(spr__class, spr__method,...)
 Call a method from a class. More...
 
#define SPR_DO_FPTR(spr__class, spr__method, spr__object)
 Get function pointer for a given method. More...
 
#define SPR_DO_OPTR(spr__class, spr__method, spr__object)
 Get the adjusted object pointer for a given method. More...
 
#define SprMethodPtr(spr__class, spr__method)
 Generate a method function pointer type. More...
 
#define SPR_OBJECT_INIT(spr__class, spr__object)
 Initialize RTTI of a dynamically allocated object. More...
 
#define SPR_LVAR_OBJECT_INIT(spr__class, spr__object)
 Initialize RTTI of a statically allocated object. More...
 

Typedefs

typedef struct spr_t_object SprObject
 

Functions

const char * SPR_CLASSID_FROM_OBJ (const void *object)
 

Detailed Description

Provide the object oriented layer for the SPRAAK environment.

Provide the necessary macro's and auxilary functions to allow the use of classes while still programming in C (at least, when working in the SPRAAK framework). For more details on working with classes, see Working with SPRAAK classes and objects

Author
Kris Demuynck
Date
10/08/2007
Bug:

Type-checking on the first argument (the object) when calling methods in a class is sometimes dissabled.

The compiler warnings given on invalid method calls may be obscure.

The object machinery in SPRAAK relies heavy on the parser to do most of the magic, and hence cannot be readily used in other projects.