Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

tweek::SubjectImpl Class Reference

CORBA servant for the tweek::Subject interface (the implementation of the interface). More...

#include <SubjectImpl.h>

Inheritance diagram for tweek::SubjectImpl:

Inheritance graph
[legend]
List of all members.

Public Methods

 SubjectImpl ()
virtual ~SubjectImpl ()
virtual void attach (Observer_ptr o)
virtual void detach (Observer_ptr o)
virtual void notify ()

Protected Methods

 SubjectImpl (const SubjectImpl &s)
SubjectImpl & operator= (const SubjectImpl &subj)

Detailed Description

CORBA servant for the tweek::Subject interface (the implementation of the interface).

Methods here should be invoked only via a reference to an Subject object (Subject_ptr, Subject_var).

Definition at line 57 of file SubjectImpl.h.


Constructor & Destructor Documentation

tweek::SubjectImpl::SubjectImpl   [inline]
 

Definition at line 61 of file SubjectImpl.h.

00062    {
00063    }

virtual tweek::SubjectImpl::~SubjectImpl   [inline, virtual]
 

Definition at line 65 of file SubjectImpl.h.

00066    {
00067    }

tweek::SubjectImpl::SubjectImpl const SubjectImpl &    s [protected]
 

Definition at line 113 of file SubjectImpl.cpp.

00114    :
00115 #ifdef OMNIORB_VER
00116      omniServant(s)
00117    , tweek::_impl_Subject(s)
00118    ,
00119 #endif
00120      PortableServer::ServantBase(s)
00121    , POA_tweek::Subject(s)
00122    , PortableServer::RefCountServantBase(s)
00123 {
00124    /* Do nothing. */ ;
00125 }


Member Function Documentation

void tweek::SubjectImpl::attach Observer_ptr    o [virtual]
 

Definition at line 51 of file SubjectImpl.cpp.

References tweekDBG_CORBA.

00052 {
00053    vpr::Guard<vpr::Mutex> guard(m_observers_mutex);
00054    vprDEBUG(tweekDBG_CORBA, vprDBG_STATE_LVL) << "Attaching observer\n"
00055                                               << vprDEBUG_FLUSH;
00056    m_observers.push_back(Observer::_duplicate(o));
00057 }

void tweek::SubjectImpl::detach Observer_ptr    o [virtual]
 

Definition at line 75 of file SubjectImpl.cpp.

References tweekDBG_CORBA.

00076 {
00077    vpr::Guard<vpr::Mutex> guard(m_observers_mutex);
00078    observer_vec_t::iterator i;
00079 
00080    i = std::remove_if(m_observers.begin(), m_observers.end(),
00081                       RemovePred<Observer_ptr>(o));
00082 
00083    if ( i != m_observers.end() )
00084    {
00085       vprDEBUG(tweekDBG_CORBA, vprDBG_STATE_LVL) << "Removing observer\n"
00086                                                  << vprDEBUG_FLUSH;
00087    }
00088 
00089    m_observers.erase(i, m_observers.end());
00090 }

void tweek::SubjectImpl::notify   [virtual]
 

Definition at line 92 of file SubjectImpl.cpp.

References tweekDBG_CORBA.

Referenced by tweek::BeanDeliverySubjectImpl::addBean, tweek::BeanDeliverySubjectImpl::removeActiveBean, and tweek::BeanDeliverySubjectImpl::setActiveBean.

00093 {
00094    vpr::Guard<vpr::Mutex> guard(m_observers_mutex);
00095    observer_vec_t::iterator i;
00096 
00097    vprDEBUG(tweekDBG_CORBA, vprDBG_STATE_LVL) << "Notifying observers\n"
00098                                               << vprDEBUG_FLUSH;
00099 
00100    for ( i = m_observers.begin(); i != m_observers.end(); i++ )
00101    {
00102       (*i)->update();
00103    }
00104 
00105    vprDEBUG(tweekDBG_CORBA, vprDBG_STATE_LVL) << "Done notifying observers\n"
00106                                               << vprDEBUG_FLUSH;
00107 }

SubjectImpl& tweek::SubjectImpl::operator= const SubjectImpl &    subj [inline, protected]
 

Definition at line 78 of file SubjectImpl.h.

00079    {
00080       return *this;
00081    }


The documentation for this class was generated from the following files:
Generated on Sun May 2 14:41:09 2004 for Tweek by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002