BazisLib::ObjectManager::ServiceObject Class Reference

Represents a service (an object that may have clients). More...

#include <objmgr.h>

Inherits BazisLib::ObjectManager::ManagedObjectBase.

Inherited by BazisLib::ObjectManager::IntermediateServiceObject< _ServiceType >.

Collaboration diagram for BazisLib::ObjectManager::ServiceObject:

Collaboration graph
[legend]

List of all members.

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


Detailed Description

Represents a service (an object that may have clients).

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

Parameters:
CommandCode Specifies the command code to send
IgnoreNotSupported Specifies whether a NotSupported code should be treated as Success.
Returns:
This method return Success if all the method returned Success (if IgnoreNotSupported parameter is set, the NotSupported status code is also treated as Success). If one of the clients returned an error code, the method terminates and returns that code.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Parameters:
pObject Specifies the client. This parameter cannot be NULL.
Remarks:
You should never call this method directly. Use the DECLARE_REFERENCE() mechanism instead.

Here is the call graph for this function:

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.

Parameters:
pObject Specifies the client. This parameter cannot be NULL.
Remarks:
You should never call this method directly. Use the DECLARE_REFERENCE() mechanism instead.

Here is the call graph for this function:


Friends And Related Function Documentation

friend class IntermediateServiceObject [friend]

friend class ParentServiceReference [friend]


Member Data Documentation


The documentation for this class was generated from the following file:
SourceForge.net Logo