bbtk::BlackBoxOutputConnector Class Reference

#include <bbtkBlackBoxOutputConnector.h>

Collaboration diagram for bbtk::BlackBoxOutputConnector:

Collaboration graph
[legend]

List of all members.

Classes

class  Pimpl
 The Pimpl. More...

Public Types

typedef
BlackBox::OutputChangeCallbackType 
OutputChangeCallbackType
typedef std::vector< Connection * > ConnectionVector
 The type of vector of output connections.

Public Member Functions

 BlackBoxOutputConnector (BlackBoxPointer b)
 Ctor.
 ~BlackBoxOutputConnector ()
 Dtor.
void SetConnection (Connection *c)
 Sets a connection.
void UnsetConnection (Connection *c)
 Unsets the connection.
const ConnectionVectorGetConnectionVector () const
 Returns the vector of connection plugged into this output (const).
IOStatus GetStatus () const
 Returns the status of the input.
void SetStatus (IOStatus s)
 Sets the status of the input.
void SignalChange (BlackBox::Pointer box, const std::string &output)
 Signals the change observers that the output has changed.
void AddChangeObserver (OutputChangeCallbackType f)
void RemoveChangeObserver (OutputChangeCallbackType f)

Private Member Functions

void PimplConstruct ()
void PimplCopyConstruct (const BlackBoxOutputConnector &)
void PimplDestruct ()
 BlackBoxOutputConnector (const BlackBoxOutputConnector &)
 Purposedly not implemented.

Private Attributes

Pimplp


Detailed Description

Definition at line 55 of file bbtkBlackBoxOutputConnector.h.


Member Typedef Documentation

The type of vector of output connections.

Definition at line 72 of file bbtkBlackBoxOutputConnector.h.

Definition at line 60 of file bbtkBlackBoxOutputConnector.h.


Constructor & Destructor Documentation

bbtk::BlackBoxOutputConnector::BlackBoxOutputConnector ( BlackBoxPointer  b  ) 

Ctor.

bbtk::BlackBoxOutputConnector::~BlackBoxOutputConnector (  ) 

Dtor.

Definition at line 83 of file bbtkBlackBoxOutputConnector.cxx.

References bbtkDebugMessage, bbtk::BlackBoxOutputConnector::Pimpl::mConnection, p, and PimplDestruct().

00084   {
00085     bbtkDebugMessage("kernel",9,
00086                      "[DEAD BOX] ==> ~BlackBoxOutputConnector()"
00087                      <<std::endl);
00088     /*
00089     ConnectionVector::iterator i;
00090     for (i=mConnection.begin();
00091          i!=mConnection.end();
00092          ++i)
00093       (*i) = Connection::WeakPointer();
00094     */
00095     p->mConnection.clear();
00096     PimplDestruct();
00097   
00098     bbtkDebugMessage("kernel",9,
00099                      "[DEAD BOX] <== ~BlackBoxOutputConnector()"
00100                      <<std::endl);
00101   }

Here is the call graph for this function:

bbtk::BlackBoxOutputConnector::BlackBoxOutputConnector ( const BlackBoxOutputConnector  )  [private]

Purposedly not implemented.


Member Function Documentation

void bbtk::BlackBoxOutputConnector::AddChangeObserver ( OutputChangeCallbackType  f  ) 

Adds the function f to the list of functions to call when the output changes.

Definition at line 209 of file bbtkBlackBoxOutputConnector.cxx.

References bbtk::BlackBoxOutputConnector::Pimpl::mChangeSignal, and p.

Referenced by bbtk::BlackBox::bbAddOutputObserver().

00210   { 
00211     //    std::cout << "BlackBoxOutputConnector::AddChangeObserver" << std::endl;
00212     p->mChangeSignal.connect(f); 
00213   }

Here is the caller graph for this function:

const BlackBoxOutputConnector::ConnectionVector & bbtk::BlackBoxOutputConnector::GetConnectionVector (  )  const

Returns the vector of connection plugged into this output (const).

Definition at line 158 of file bbtkBlackBoxOutputConnector.cxx.

References bbtk::BlackBoxOutputConnector::Pimpl::mConnection, and p.

00159   { 
00160     return p->mConnection; 
00161   }

IOStatus bbtk::BlackBoxOutputConnector::GetStatus (  )  const

Returns the status of the input.

Definition at line 166 of file bbtkBlackBoxOutputConnector.cxx.

References bbtk::BlackBoxOutputConnector::Pimpl::mStatus, and p.

00167   { 
00168     return p->mStatus; 
00169   }

void bbtk::BlackBoxOutputConnector::PimplConstruct (  )  [private]

Definition at line 66 of file bbtkBlackBoxOutputConnector.cxx.

void bbtk::BlackBoxOutputConnector::PimplCopyConstruct ( const BlackBoxOutputConnector o  )  [private]

Definition at line 66 of file bbtkBlackBoxOutputConnector.cxx.

void bbtk::BlackBoxOutputConnector::PimplDestruct (  )  [private]

Definition at line 66 of file bbtkBlackBoxOutputConnector.cxx.

References bbtkDebugMessage.

Referenced by ~BlackBoxOutputConnector().

Here is the caller graph for this function:

void bbtk::BlackBoxOutputConnector::RemoveChangeObserver ( OutputChangeCallbackType  f  ) 

Removes the function f from the list of functions to call when the output changes (TO WRITE)

Removes the function f from the list of functions to call when the output changes (TO WRITE)

Definition at line 219 of file bbtkBlackBoxOutputConnector.cxx.

References bbtkError.

00220   { 
00221     bbtkError("BlackBoxOutputConnector::RemoveChangeObserver not implemented");
00222     
00223     //mChangeSignal.disconnect(f);
00224   }

void bbtk::BlackBoxOutputConnector::SetConnection ( Connection c  ) 

Sets a connection.

Definition at line 106 of file bbtkBlackBoxOutputConnector.cxx.

References bbtkDebugMessage, bbtk::BlackBoxOutputConnector::Pimpl::mBox, bbtk::BlackBoxOutputConnector::Pimpl::mConnection, and p.

00107   {
00108     bbtkDebugMessage("kernel",9,
00109                      "["<<p->mBox.lock()->bbGetName()
00110                      <<"] BlackBoxOutputConnector::SetConnection("
00111                      <<c<<")"<<std::endl);
00112     p->mConnection.push_back(c);
00113     //    AddChangeObserver(boost::bind(&Connection::SignalChange,c));
00114   }

void bbtk::BlackBoxOutputConnector::SetStatus ( IOStatus  s  ) 

Sets the status of the input.

Definition at line 174 of file bbtkBlackBoxOutputConnector.cxx.

References bbtk::BlackBoxOutputConnector::Pimpl::mStatus, and p.

00175   {
00176     p->mStatus = s; 
00177   }

void bbtk::BlackBoxOutputConnector::SignalChange ( BlackBox::Pointer  box,
const std::string &  output 
)

Signals the change observers that the output has changed.

Definition at line 181 of file bbtkBlackBoxOutputConnector.cxx.

References bbtkDebugMessage, bbtk::GetIOStatusString(), bbtk::BlackBoxOutputConnector::Pimpl::mChangeSignal, bbtk::OUTOFDATE, and p.

00183   {
00184     IOStatus s = OUTOFDATE; //mStatus;
00185     //if (s==UPTODATE) s=MODIFIED;
00186     
00187     bbtkDebugMessage("change",2,
00188                      "["<<box->bbGetName()
00189                      <<"] ==> BlackBoxOutputConnector::SignalChange('"
00190                      <<output<<"','"<<GetIOStatusString(s)<<"') ["
00191                      <<this<<"]"
00192                      <<std::endl);
00193     
00194     //    std::cout<<"BlackBoxOutputConnector::SignalChange("
00195     //       <<box->bbGetName()<<",'"
00196     //       <<output<<"')"<<std::endl;
00197     p->mChangeSignal(box,output,s);
00198     
00199     bbtkDebugMessage("change",2,
00200                      "["<<box->bbGetName()
00201                      <<"] <== BlackBoxOutputConnector::SignalChange('"
00202                      <<output<<"','"<<GetIOStatusString(s)<<"') ["
00203                      <<this<<"]"
00204                      <<std::endl);
00205   }

Here is the call graph for this function:

void bbtk::BlackBoxOutputConnector::UnsetConnection ( Connection c  ) 

Unsets the connection.

Definition at line 119 of file bbtkBlackBoxOutputConnector.cxx.

References bbtkDebugMessage, bbtkInternalError, bbtk::i, bbtk::BlackBoxOutputConnector::Pimpl::mBox, bbtk::BlackBoxOutputConnector::Pimpl::mConnection, and p.

00120   {
00121     bbtkDebugMessage("kernel",9,"["<<p->mBox.lock()->bbGetName()
00122                      <<"] BlackBoxOutputConnector::UnsetConnection("
00123                      <<c<<")"<<std::endl);
00124 
00125     if (!c) 
00126       {
00127         bbtkInternalError(p->mBox.lock()->bbGetFullName()
00128                           <<": BlackBoxOutputConnector::UnsetConnection("
00129                           <<c<<") : invalid connection");
00130 
00131       }
00132     //    c->Check();
00133     //Connection::WeakPointer w(c);
00134     ConnectionVector::iterator i;
00135     //  = find(mConnection.begin(),mConnection.end(),c);
00136     for (i=p->mConnection.begin();
00137          i!=p->mConnection.end();
00138          ++i)
00139       {
00140         if (*i==c) break;
00141       }
00142     if (i==p->mConnection.end())
00143       {
00144         bbtkInternalError(p->mBox.lock()->bbGetFullName()
00145                           <<": BlackBoxOutputConnector::UnsetConnection("
00146                           <<c
00147                           <<") : connection is absent from connections list");
00148       }
00149     p->mConnection.erase(i);
00150     //    RemoveChangeObserver(boost::bind(&Connection::SignalChange,c));
00151 
00152 
00153   }


Member Data Documentation


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

Generated on Thu May 31 14:14:05 2012 for BBTK by  doxygen 1.5.7.1