Implementation of the base servant for SALOME objects with reference counter. More...
#include <SALOME_GenericObj_i.hh>
Public Member Functions | |
GenericObj_i (PortableServer::POA_ptr thePOA=PortableServer::POA::_nil()) | |
Constructor. More... | |
virtual PortableServer::POA_ptr | _default_POA () |
Get default POA for the servant object. More... | |
virtual void | Register () |
Increment reference counter. More... | |
virtual void | UnRegister () |
Decrement reference counter. More... | |
virtual void | Destroy () |
Decrement reference counter. More... | |
Protected Attributes | |
PortableServer::POA_var | myPOA |
int | myRefCounter |
Implementation of the base servant for SALOME objects with reference counter.
This class can be used to implement data entities with life-cycle management based on the reference counting.
The object is initially created with the reference counter equal to 1. The function Register() can be used to incrfement the reference counter. Function UnRegister() should be used to decrement reference counter. As soon as reference counter goes to zero, the object is automatically deactivated in POA (and, eventually its destructor is automatically called).
SALOME::GenericObj_i::GenericObj_i | ( | PortableServer::POA_ptr | thePOA = PortableServer::POA::_nil() | ) |
|
virtual |
Get default POA for the servant object.
This function is implicitly called from "_this()" function. Default POA can be set via the constructor.
References myPOA.
|
virtual |
Decrement reference counter.
References MESSAGE, and UnRegister().
|
virtual |
Increment reference counter.
References IS_OBJ_IN_QUESTION, MESSAGE, MYDEBUG, and myRefCounter.
|
virtual |
Decrement reference counter.
As soon as reference counter goes to zero, the object is automatically deactivated.
References IS_OBJ_IN_QUESTION, MESSAGE, MYDEBUG, myPOA, and myRefCounter.
Referenced by Destroy().
|
protected |
Referenced by _default_POA(), GenericObj_i(), and UnRegister().
|
protected |
Referenced by Register(), and UnRegister().