#include <DocMan.h>
Public Member Functions | |
bool | add (DocClient *client, bool front=false) |
Add a client to list. | |
bool | add (DocClient *client, bool front=false) |
Add a client to list. | |
ClientList (const std::string &eltName) | |
ClientList (const std::string &eltName) | |
const std::string & | getName () |
which list are we? | |
const std::string & | getName () |
which list are we? | |
void | invoke (DomElement *elt) |
call back each client in turn | |
void | invoke (DomElement *elt) |
call back each client in turn | |
bool | remove (DocClient *client) |
bool | remove (DocClient *client) |
~ClientList () | |
~ClientList () | |
Private Types | |
typedef std::vector< DocClient * >::const_iterator | ClientsIt |
typedef std::vector< DocClient * >::const_iterator | ClientsIt |
Private Attributes | |
std::vector< DocClient * > | m_clients |
std::vector< DocClient * > | m_clients |
std::string | m_eltName |
|
|
|
|
|
00054 : m_eltName(eltName) {}
|
|
00115 { 00116 m_clients.clear(); 00117 }
|
|
00054 : m_eltName(eltName) {}
|
|
|
|
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. |
|
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. 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 }
|
|
which list are we?
00068 {return m_eltName;}
|
|
which list are we?
00068 {return m_eltName;}
|
|
call back each client in turn
|
|
call back each client in turn
|
|
Remove a client; return indicates success or failure (e.g., client not found) |
|
Remove a client; return indicates success or failure (e.g., client not found) 00101 { 00102 client->getName(); // just to avoid compile-time warning 00103 return true; 00104 }
|
|
|
|
|
|
|