FACT++  1.0
void DimNetwork::AddServer ( const std::string &  s)
protectedvirtual

A list with all MESSAGE services to which we subscribed.

Adds the StateClient for the given server. Don't forget to call this function if it is overwritten in a derived class.

Parameters
sserver which should be added
Exceptions
aruntime_error is the server is already in the list

Reimplemented from DimServiceInfoListImp.

Definition at line 68 of file DimNetwork.cc.

References DimServiceInfoListImp::AddServer(), and StateClient::StateClient().

Referenced by FactGui::AddServer().

69 {
71  if (s=="DIM_DNS")
72  return;
73 
74  // Check if this server is already in the list.
75  // This should never happen if Dim works reliable
76  const ClientList::iterator v = fClientList.find(s);
77  if (v!=fClientList.end())
78  {
79  stringstream err;
80  err << "Server '" << s << "' in list not as it ought to be.";
81  throw runtime_error(err.str());
82  }
83 
84  // Add the new server to the server list
85  fClientList[s] = new StateClient(s, *this);
86 }
ClientList fClientList
Definition: DimNetwork.h:69
A simple Dim client diriving from MessageDimRX subscribing to the STATE service.
Definition: DimNetwork.h:18
virtual void AddServer(const std::string &s)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: