Classes | |
class | MutexLocker |
struct | DynObjType |
class | doUserTypeDecl |
Defines | |
#define | DO_DECL_TYPE_INFO(CLASS, ID) |
#define | DO_DECL_TYPE_INFO_AUTOID(CLASS) |
Enumerations | |
enum | doCastAlgo { doCastLocal = 1, doCastCross = 2, doCastFull = 3 } |
Functions | |
int | doLookupTypeId (const char *header, const char *type) |
DynObjType * | doGetType (const void *pobj) |
DynObjType * | doGetType (const DynI *pdi) |
internal void * | doGetObj (void *pobj, const char *type, DynObjType *self_type, doCastAlgo algo=doCastFull, DynObjType **found_type=NULL) |
void * | doGetObj (void *pobj, int type_id, DynObjType *self_type, doCastAlgo algo=doCastFull, DynObjType **found_type=NULL) |
void * | doGetObj (DynI *pdi, const char *type, doCastAlgo algo=doCastFull, DynObjType **found_type=NULL) |
void * | doGetObj (DynI *pdi, int type_id, doCastAlgo algo=doCastFull, DynObjType **found_type=NULL) |
DynObjType * | doFindType (const char *type, const char *header=NULL) |
DynObjType * | doFindType (int type_id) |
int | doIsMainObject (DynI *pdi) |
int | doIsMainObject (const void *pobj, DynObjType *pdt=NULL) |
bool | doConstruct (const void *obj, DynObjType *self_type, DynObjType *pdt_compound=NULL) |
bool | doConstruct (const void *obj, const char *type, const char *header=NULL) |
bool | doConstruct (const void *obj, int type_id, const char *header=NULL) |
bool | doConstructDelayed (const void *obj, DynObjType *self_type) |
void | doReleaseDestroy (DynObj *pdo) |
bool | doIsStatic (const void *pvo, DynObjType *type=NULL) |
bool | doIsStatic (const DynI *pdi) |
DoRunTimeI & | doGetRunTime () |
bool | doAddImplemented (const char *type, int type_id) |
const char * | doGetImplemented () |
#define DO_DECL_TYPE_INFO | ( | CLASS, | |||
ID | ) |
Value:
template<> \ struct doTypeInfo<CLASS> { \ public: \ static int Id( ){ return ID; } \ static const char* Name( ){ return #CLASS; } \ };
#define DO_DECL_TYPE_INFO_AUTOID | ( | CLASS | ) |
Value:
template<> \ struct doTypeInfo<CLASS> { \ public: \ static int Id( ){ \ static int st_id; \ if( !st_id ) st_id=doLookupTypeId(__FILE__,#CLASS); \ return st_id; \ } \ static const char* Name( ){ return #CLASS; } \ };
enum doCastAlgo |
Different cast algorithms. An object with several base classes can be searched in different ways. This makes a difference if the current object is a sub-object of a larger compound object. The default algorithm is DoCastCross, which allows for going moving to a compound type once.
bool doAddImplemented | ( | const char * | type, | |
int | type_id | |||
) |
Add implemented type for exporting (a type for which the user can give its name to the library and receive a new instance)
type | The name of the type | |
type_id | The ID of the type |
bool doConstruct | ( | const void * | obj, | |
int | type_id, | |||
const char * | header = NULL | |||
) |
As above but based on type ID
bool doConstruct | ( | const void * | obj, | |
const char * | type, | |||
const char * | header = NULL | |||
) |
Set up a type from an instance and register it. As above but can be used when only the tpe name or type ID is known. Only applies to outermost type (i.e. not inner base classes).
obj | The object to register | |
type | The type name for the object | |
type_id | The type ID for the object |
bool doConstruct | ( | const void * | obj, | |
DynObjType * | self_type, | |||
DynObjType * | pdt_compound = NULL | |||
) |
Set up a type from an instance and register it. This should be done
NOTE: The template classes 'doConstructGlobal' and 'doConstructLocal' can are designed to handle this automatically for local and global objects.
obj | The object to register | |
self_type | Type of the object or NULL if not known | |
is_outer | set to true when registering an object from outside (when it is not a side base class) |
bool doConstructDelayed | ( | const void * | obj, | |
DynObjType * | self_type | |||
) |
As above but can be done before the global ctor for a type has been run. (to work around global object instantiation order).
obj | The object to register (NOTE: It must be a global / static object!!!) | |
type | The type name for the object |
DynObjType* doFindType | ( | int | type_id | ) |
Find DynObjType by type ID.
type | Type name string |
DynObjType* doFindType | ( | const char * | type, | |
const char * | header = NULL | |||
) |
Find DynObjType by type string.
type | Type name string |
const char* doGetImplemented | ( | ) |
Returns a single string containing all types that can be instantiated by this module
void * doGetObj | ( | DynI * | pdi, | |
int | type_id, | |||
doCastAlgo | algo, | |||
DynObjType ** | found_type | |||
) |
Version of doGetType (with type ID) for DynI
void * doGetObj | ( | DynI * | pdi, | |
const char * | type, | |||
doCastAlgo | algo, | |||
DynObjType ** | found_type | |||
) |
Version of doGetType (with type string) for DynI
void * doGetObj | ( | void * | pobj, | |
int | type_id, | |||
DynObjType * | self_type, | |||
doCastAlgo | algo, | |||
DynObjType ** | found_type | |||
) |
Get sub-object or interface.
pobj | Query object | |
type_id | Integer type ID | |
self_type | Type of pobj or NULL if not known | |
algo | Algoithm to use in cast | |
found_type | Pointer-to-pointer: store found type here if non-NULL |
void * doGetObj | ( | void * | pobj, | |
const char * | type, | |||
DynObjType * | self_type, | |||
doCastAlgo | algo, | |||
DynObjType ** | found_type | |||
) |
Get sub-object or interface.
pobj | Query object | |
type | string | |
self_type | Type of pobj or NULL if not known | |
algo | Algoithm to use in cast | |
found_type | Pointer-to-pointer: store found type here if non-NULL |
DynObjType * doGetType | ( | const DynI * | pdi | ) |
Retrieve the type of the object.
pdi | Object |
DynObjType * doGetType | ( | const void * | pobj | ) |
Retrieve the type of the object.
pobj | Object |
int doIsMainObject | ( | const void * | pobj, | |
DynObjType * | pdt = NULL | |||
) |
Version for a void pointer, with possibly known type
int doIsMainObject | ( | DynI * | pdi | ) |
Check if the object is from the main module (1) or if it is a plugin object (-1), or don't know(0).
bool doIsStatic | ( | const void * | pvo, | |
DynObjType * | type = NULL | |||
) |
Check if an object is a static/global instance. A static instance will have equal or longer lifetime compared to the calling module.
pdo | Object to release or destroy | |
type | if of object if known |
void doReleaseDestroy | ( | DynObj * | pdo | ) |
Call doRelease or doDestroy on the object. Used to end ownership of a DynObj which can derive either directly from DynObj or from DynSharedI.
pdo | Object to release or destroy |