#include <objmgr.h>
Inherits BazisLib::ObjectManager::ManagedObjectBase.
Inherited by BazisLib::ObjectManager::IntermediateServiceObject< _ServiceType >.
Public Member Functions | |
~ServiceObject () | |
Deletes the ServiceObject instance. | |
ActionStatus | CallClients (unsigned CommandCode, bool IgnoreNotSupported, void *pParam1=NULL, void *pParam2=NULL, void *pParam3=NULL) |
Sends a command to all clients of a service. | |
virtual ActionStatus | ExecuteSystemCommand (SystemCommand CommandCode, bool Recursive, void *pParam1=NULL, void *pParam2=NULL, void *pParam3=NULL) override |
System command handler. | |
Private Member Functions | |
void | RegisterClient (ManagedObjectBase *pObject) |
Registers a client for a service. | |
void | RemoveClient (ManagedObjectBase *pObject) |
Deregisters a client for a service. | |
Private Attributes | |
std::set< ManagedObjectBase * > | m_Children |
AtomicOperationLock | m_Lock |
Friends | |
class | ParentServiceReference |
class | IntermediateServiceObject |
This class represents a service object - a special managed object that can have client objects connected to it. This is done via RegisterClient()/RemoveClient() calls. For details on managed objects and services, see this article.
BazisLib::ObjectManager::ServiceObject::~ServiceObject | ( | ) | [inline] |
Deletes the ServiceObject instance.
This destructor deletes a ServiceObject instance. Note that managed objects should only be freed by calling the ManagedObject::Release() method. Direct call of the delete operator is not allowed. This ensures that the object has no clients when it is deleted. The debug build of the framework checks this.
ActionStatus BazisLib::ObjectManager::ServiceObject::CallClients | ( | unsigned | CommandCode, | |
bool | IgnoreNotSupported, | |||
void * | pParam1 = NULL , |
|||
void * | pParam2 = NULL , |
|||
void * | pParam3 = NULL | |||
) | [inline] |
Sends a command to all clients of a service.
This method is used to send some command to all of the clients of a particular service. It invokes the ManagedObjectBase::ExecuteCommand() method. Note that the set of the commands that can be sent by a service depends on that service type. That way, you can define any commands you wish for your services. If you want a service to forward such command to its clients (note that the clients should be aware of such command, i.e. it should reside in the list of the commands sent by your service), simply override the ManagedObjectBase::ExecuteCommand() method and call CallClients() from there.
CommandCode | Specifies the command code to send | |
IgnoreNotSupported | Specifies whether a NotSupported code should be treated as Success. |
virtual ActionStatus BazisLib::ObjectManager::ServiceObject::ExecuteSystemCommand | ( | SystemCommand | CommandCode, | |
bool | Recursive, | |||
void * | pParam1 = NULL , |
|||
void * | pParam2 = NULL , |
|||
void * | pParam3 = NULL | |||
) | [inline, override, virtual] |
System command handler.
See ManagedObjectBase::ExecuteSystemCommand() for details.
Reimplemented from BazisLib::ObjectManager::ManagedObjectBase.
void BazisLib::ObjectManager::ServiceObject::RegisterClient | ( | ManagedObjectBase * | pObject | ) | [inline, private] |
Registers a client for a service.
This method registers a client for a service, that, in turn, increases the reference counter.
pObject | Specifies the client. This parameter cannot be NULL. |
void BazisLib::ObjectManager::ServiceObject::RemoveClient | ( | ManagedObjectBase * | pObject | ) | [inline, private] |
Deregisters a client for a service.
This method deregisters a client for a service, that, in turn, decreases the reference counter.
pObject | Specifies the client. This parameter cannot be NULL. |
friend class IntermediateServiceObject [friend] |
friend class ParentServiceReference [friend] |
std::set<ManagedObjectBase *> BazisLib::ObjectManager::ServiceObject::m_Children [private] |