DUECA/DUSIME
|
Proxy identity for helper classes associated with an object derived from dueca::NamedObject. More...
#include <AssociateObject.hxx>
Public Member Functions | |
AssociateObject (const Host &host) | |
Constructor. | |
~AssociateObject () | |
Destructor. | |
ObjectType | getObjectType () const final |
Object type for DUECA's sanity. | |
Static Public Attributes | |
static const char *const | classname |
Class name constant, should be equal to the host object's classname, used for reporting errors and warnings. | |
Proxy identity for helper classes associated with an object derived from dueca::NamedObject.
In DUECA, objects that can use DUECA services (accessing channels, creating and using activities) need to have a name and a GlobalId, commonly by deriving from NamedObject. In addition, the convenience macros for checking channels and the like normally use the dueca::getclassname<>() templated function to access the "classname" member defined in modules.
This template class enables helper classes/objects that don't have their own GlobalId to assume the GlobalId and name of their "owner", and sets the proper class name.
Use this to delegate capabilities in a manner like (note, incomplete code!):
In your c++ file, ensure that the helpers have the proper "classname":
The MyHelper struct will now be able to open channels, create activities, etc. Its name and id are equal to that of the host class.
|
inline |
Constructor.
host | Host class for name and ID. |