Added an YCLASSIMP macro to help just implementing GenObject::getObject().
git-svn-id: http://yate.null.ro/svn/yate/trunk@1409 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
03aaf8ca1a
commit
1ba837f0e2
11
yateclass.h
11
yateclass.h
|
@ -576,6 +576,13 @@ class Mutex;
|
|||
*/
|
||||
void YCLASS(class type,class base);
|
||||
|
||||
/**
|
||||
* Macro to implement @ref GenObject::getObject in a derived class
|
||||
* @param type Class that is declared
|
||||
* @param base Base class that is inherited
|
||||
*/
|
||||
void YCLASSIMP(class type,class base);
|
||||
|
||||
/**
|
||||
* Macro to retrive a typed pointer to an interface from an object
|
||||
* @param type Class we want to return
|
||||
|
@ -589,6 +596,10 @@ class* YOBJECT(class type,GenObject* pntr);
|
|||
public: virtual void* getObject(const String& name) const \
|
||||
{ return (name == #type) ? const_cast<type*>(this) : base::getObject(name); }
|
||||
|
||||
#define YCLASSIMP(type,base) \
|
||||
void* type::getObject(const String& name) const \
|
||||
{ return (name == #type) ? const_cast<type*>(this) : base::getObject(name); }
|
||||
|
||||
#define YOBJECT(type,pntr) (static_cast<type*>((pntr) ? (pntr)->getObject(#type) : 0))
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue