xmlBase::DocMan::ClientList Class Reference

Nested class to keep track of clients for one element type. More...

#include <DocMan.h>

List of all members.

Public Member Functions

 ClientList (const std::string &eltName)
 ~ClientList ()
bool add (DocClient *client, bool front=false)
 Add a client to list.
bool remove (DocClient *client)
const std::stringgetName ()
 which list are we?
void invoke (DomElement *elt)
 call back each client in turn

Private Types

typedef std::vector< DocClient
* >::const_iterator 
ClientsIt

Private Attributes

std::string m_eltName
std::vector< DocClient * > m_clients


Detailed Description

Nested class to keep track of clients for one element type.

Definition at line 52 of file DocMan.h.


Member Typedef Documentation

typedef std::vector<DocClient*>::const_iterator xmlBase::DocMan::ClientList::ClientsIt [private]

Definition at line 75 of file DocMan.h.


Constructor & Destructor Documentation

xmlBase::DocMan::ClientList::ClientList ( const std::string eltName  )  [inline]

Definition at line 54 of file DocMan.h.

00054 : m_eltName(eltName) {}

xmlBase::DocMan::ClientList::~ClientList (  ) 

Definition at line 115 of file DocMan.cxx.

References m_clients.

00115                                 {
00116     m_clients.clear();
00117   }


Member Function Documentation

bool xmlBase::DocMan::ClientList::add ( DocClient client,
bool  front = false 
)

Add a client to list.

return indicates success or failure (e.g. duplicate). By default new client is added to back of list, but if front is set to true client will go to the front.

Definition at line 85 of file DocMan.cxx.

References xmlBase::DocClient::getName(), m_clients, and deljobs::string.

Referenced by xmlBase::DocMan::regClient().

00085                                                           {
00086     ClientsIt it = m_clients.begin();
00087     const std::string& clientName = client->getName();
00088     while (it != m_clients.end() ) {
00089       // can't register for the same element type more than once
00090       if (clientName.compare((*it)->getName()) == 0 ) return 0;
00091       ++it;
00092     }
00093     if (front) m_clients.insert(m_clients.begin(), client);
00094     else m_clients.push_back(client);
00095 
00096     return true;
00097   }

const std::string& xmlBase::DocMan::ClientList::getName (  )  [inline]

which list are we?

Definition at line 68 of file DocMan.h.

References m_eltName.

00068 {return m_eltName;}

void xmlBase::DocMan::ClientList::invoke ( DomElement elt  ) 

call back each client in turn

Referenced by xmlBase::DocMan::parse().

bool xmlBase::DocMan::ClientList::remove ( DocClient client  ) 

Remove a client; return indicates success or failure (e.g., client not found)

Definition at line 101 of file DocMan.cxx.

References xmlBase::DocClient::getName().

00101                                                  {
00102     client->getName(); // just to avoid compile-time warning
00103     return true;
00104   }


Member Data Documentation

std::vector<DocClient*> xmlBase::DocMan::ClientList::m_clients [private]

Definition at line 74 of file DocMan.h.

Referenced by add(), and ~ClientList().

std::string xmlBase::DocMan::ClientList::m_eltName [private]

Definition at line 73 of file DocMan.h.

Referenced by getName().


Generated on Tue Nov 29 23:36:38 2016 for BOSS_7.0.2 by  doxygen 1.4.7