Back to index

salome-kernel  6.5.0
Public Member Functions | Private Types | Private Attributes
Notifier Class Reference
Collaboration diagram for Notifier:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Notifier (CORBA::ORB_ptr orb)
virtual bool addSO_Notification (const SALOMEDSImpl_SObject &theSObject)
 Function : addSO_Notification Purpose : This function tells all the observers that a SO has been added.
virtual bool removeSO_Notification (const SALOMEDSImpl_SObject &theSObject)
 Function : removeSO_Notification Purpose : This function tells all the observers that a SO has been removed.
virtual bool modifySO_Notification (const SALOMEDSImpl_SObject &theSObject, int reason)
 Function : modifySO_Notification Purpose : This function tells all the observers that a SO has been modified.
virtual void attach (SALOMEDS::Observer_ptr theObs, bool modify)
 Function : attach Purpose : register an Observer.

Private Types

typedef std::list< std::pair
< SALOMEDS::Observer_var, bool > > 
ObsList
typedef ObsList::iterator ObsListIter

Private Attributes

ObsList myObservers
CORBA::ORB_var _orb

Detailed Description

Definition at line 59 of file SALOMEDS_Study_i.cxx.


Member Typedef Documentation

typedef std::list< std::pair< SALOMEDS::Observer_var, bool > > Notifier::ObsList [private]

Definition at line 133 of file SALOMEDS_Study_i.cxx.

typedef ObsList::iterator Notifier::ObsListIter [private]

Definition at line 134 of file SALOMEDS_Study_i.cxx.


Constructor & Destructor Documentation

Notifier::Notifier ( CORBA::ORB_ptr  orb) [inline]

Definition at line 62 of file SALOMEDS_Study_i.cxx.

{
  _orb = CORBA::ORB::_duplicate(orb);
}

Member Function Documentation

virtual bool Notifier::addSO_Notification ( const SALOMEDSImpl_SObject &  theSObject) [inline, virtual]

Function : addSO_Notification Purpose : This function tells all the observers that a SO has been added.

Definition at line 73 of file SALOMEDS_Study_i.cxx.

    {
      std::string anID=theSObject.GetID();
      const char* cID=anID.c_str();
      for (ObsListIter it (myObservers.begin()); it != myObservers.end(); ++it)
        {
          it->first->notifyObserverID(cID,1);
        }
      return true; // NGE return always true but can be modified if needed
    }
virtual void Notifier::attach ( SALOMEDS::Observer_ptr  theObs,
bool  modify 
) [inline, virtual]

Function : attach Purpose : register an Observer.

Definition at line 127 of file SALOMEDS_Study_i.cxx.

    {
      myObservers.push_back(std::pair< SALOMEDS::Observer_var, bool > (SALOMEDS::Observer::_duplicate(theObs),modify));
    }
virtual bool Notifier::modifySO_Notification ( const SALOMEDSImpl_SObject &  theSObject,
int  reason 
) [inline, virtual]

Function : modifySO_Notification Purpose : This function tells all the observers that a SO has been modified.

Definition at line 107 of file SALOMEDS_Study_i.cxx.

    {
      for (ObsListIter it (myObservers.begin()); it != myObservers.end(); ++it)
        {
          if(it->second)
            {
              std::string anID=theSObject.GetID();
              const char* cID=anID.c_str();
              it->first->notifyObserverID(cID,reason);
            }
        }
      return true; // NGE return always true but can be modified if needed
    }
virtual bool Notifier::removeSO_Notification ( const SALOMEDSImpl_SObject &  theSObject) [inline, virtual]

Function : removeSO_Notification Purpose : This function tells all the observers that a SO has been removed.

Definition at line 90 of file SALOMEDS_Study_i.cxx.

    {
      std::string anID=theSObject.GetID();
      const char* cID=anID.c_str();
      for (ObsListIter it (myObservers.begin()); it != myObservers.end(); ++it)
        {
          it->first->notifyObserverID(cID,2);
        }
      return true; // NGE return always true but can be modified if needed
    }

Member Data Documentation

CORBA::ORB_var Notifier::_orb [private]

Definition at line 136 of file SALOMEDS_Study_i.cxx.

Definition at line 135 of file SALOMEDS_Study_i.cxx.


The documentation for this class was generated from the following file: