Version: 8.3.0
SALOME::GenericObj_i Class Reference

Implementation of the base servant for SALOME objects with reference counter. More...

#include <SALOME_GenericObj_i.hh>

Inheritance diagram for SALOME::GenericObj_i:

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
 

Detailed Description

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).

Constructor & Destructor Documentation

SALOME::GenericObj_i::GenericObj_i ( PortableServer::POA_ptr  thePOA = PortableServer::POA::_nil())

Constructor.

Creates an object with the reference counter initially set to 1.

The default POA for the servant can be passed as a parameter thePOA. By default, root POA is used.

Parameters
thePOAoptional default POA for the servant

References MESSAGE, MYDEBUG, and myPOA.

Member Function Documentation

PortableServer::POA_ptr SALOME::GenericObj_i::_default_POA ( )
virtual

Get default POA for the servant object.

This function is implicitly called from "_this()" function. Default POA can be set via the constructor.

Returns
reference to the default POA for the servant

References myPOA.

void SALOME::GenericObj_i::Destroy ( )
virtual

Decrement reference counter.

Deprecated:
Use UnRegister() instead.

References MESSAGE, and UnRegister().

void SALOME::GenericObj_i::Register ( )
virtual

Increment reference counter.

References IS_OBJ_IN_QUESTION, MESSAGE, MYDEBUG, and myRefCounter.

void SALOME::GenericObj_i::UnRegister ( )
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().

Field Documentation

PortableServer::POA_var SALOME::GenericObj_i::myPOA
protected
int SALOME::GenericObj_i::myRefCounter
protected

Referenced by Register(), and UnRegister().