BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
xmlBase::DocMan::ClientList Class Reference

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

#include <DocMan.h>

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::string & getName ()
 which list are we?
 
void invoke (DomElement *elt)
 call back each client in turn
 

Detailed Description

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

Definition at line 52 of file DocMan.h.

Constructor & Destructor Documentation

◆ ClientList()

xmlBase::DocMan::ClientList::ClientList ( const std::string &  eltName)
inline

Definition at line 54 of file DocMan.h.

54: m_eltName(eltName) {}

◆ ~ClientList()

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

Definition at line 115 of file DocMan.cxx.

115 {
116 m_clients.clear();
117 }

Member Function Documentation

◆ add()

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.

85 {
86 ClientsIt it = m_clients.begin();
87 const std::string& clientName = client->getName();
88 while (it != m_clients.end() ) {
89 // can't register for the same element type more than once
90 if (clientName.compare((*it)->getName()) == 0 ) return 0;
91 ++it;
92 }
93 if (front) m_clients.insert(m_clients.begin(), client);
94 else m_clients.push_back(client);
95
96 return true;
97 }

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

◆ getName()

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

which list are we?

Definition at line 68 of file DocMan.h.

68{return m_eltName;}

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

◆ invoke()

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

call back each client in turn

Definition at line 106 of file DocMan.cxx.

106 {
107 ClientsIt it = m_clients.begin();
108 while (it != m_clients.end() ) {
109 (*it)->handleChild(elt);
110 ++it;
111 }
112 }

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

◆ remove()

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.

101 {
102 client->getName(); // just to avoid compile-time warning
103 return true;
104 }

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