FACT++  1.0
DimServiceInfoList Class Reference

Maintains a list of all services available in the Dim network. More...

#include <DimServiceInfoList.h>

+ Inheritance diagram for DimServiceInfoList:
+ Collaboration diagram for DimServiceInfoList:

Classes

struct  ServerInfo
 

Public Types

typedef std::map< const std::string, std::vector< DimInfo * > > ServiceInfoList
 
typedef std::pair< std::string, bool > ServiceType
 
typedef std::map< const std::string, ServiceTypeTypeList
 
typedef std::map< const std::string, std::pair< std::string, std::vector< Description > > > DescriptionList
 
typedef std::map< const std::string, ServerInfoServiceList
 
- Public Types inherited from DimServerList
typedef std::vector< std::string > ServerList
 

Public Member Functions

void AddServer (const std::string &s)
 
void RemoveServer (std::string)
 
void RemoveAllServers ()
 
 DimServiceInfoList (DimServiceInfoListImp *list)
 
 ~DimServiceInfoList ()
 
std::vector< std::string > GetServiceList (bool iscmd=false) const
 
std::vector< std::string > GetServiceList (const std::string &server, bool iscmd=false) const
 
std::vector< DescriptionGetDescription (const std::string &server, const std::string &service) const
 
std::vector< StateGetStates (const std::string &server) const
 
State GetState (const std::string &server, int state) const
 
int IsCommand (const std::string &server, const std::string &service) const
 
int PrintDescription (std::ostream &out, bool iscmd, const std::string &serv="", const std::string &service="") const
 
int PrintStates (std::ostream &out, const std::string &serv="") const
 
bool SendDimCommand (std::ostream &lout, const std::string &server, const std::string &str) const
 
void SendDimCommand (const std::string &server, std::string str, std::ostream &lout) const
 
void SendDimCommand (const std::string &server, const std::string &str) const
 
- Public Member Functions inherited from DimServerList
 DimServerList (DimServerListImp *list)
 
const ServerListGetServerList () const
 
bool HasServer (const std::string &server) const
 
- Public Member Functions inherited from DimInfoHandler
DimInfogetInfo ()
 
virtual ~DimInfoHandler ()
 

Protected Member Functions

void infoHandler ()
 

Private Member Functions

DimInfoCreateDimInfo (const std::string &str, const std::string &svc) const
 A mal containing all the available informations. More...
 
DimInfoCreateSL (const std::string &str) const
 
DimInfoCreateFMT (const std::string &str) const
 
DimInfoCreateDS (const std::string &str) const
 

Private Attributes

DimServiceInfoListImpfList
 
ServiceInfoList fServiceInfoList
 
ServiceList fServiceList
 A map storing the service description to retrieve all informations. More...
 

Additional Inherited Members

- Public Attributes inherited from DimInfoHandler
DimInfoitsService
 

Detailed Description

Maintains a list of all services available in the Dim network.

The idea of this class is to maintain a list of services available in the Dim network as well as state descriptions if available.

Therefore, it subscribes to the SERVICE_LIST, SERVICE_DESC and STATE_LIST services of all servers.

To maintain the list it derives from DimServerList which maintains a list of all servers.

To maintain the subscriptions it overwrites:

  • void DimServerList::AddServer(const std::string &s)
  • void DimServerList::RemoveServer(const std::string &s)
  • void DimServerList::RemoveAllServers()

If a derived class also overwrites these functions it must be ensured that the member functions of DimServiceInfoList are still called properly.

Whenever a service is added or removed, or all services of one server is removed the following virtual functions are called:

  • virtual void AddService(const std::string &server, const std::string &service, const std::string &fmt, bool iscmd)
  • virtual void RemoveService(const std::string &server, const std::string &service, bool iscmd)
  • virtual void RemoveAllServices(const std::string &server)

Note, that these functions are not called from the RemoveServer() and RemoveAllServer() functions. It might be a difference whether all services were removed but the server is still online or the server went offline.

If a description or a state was added, this is signaled though:

  • virtual void AddDescription(const std::string &server, const std::string &service, const std::vector<Description> &vec)
  • virtual void AddStates(const std::string &server, const std::vector<State> &vec)

Note, that Descriptions and States are never removed except a service or server goes offline. It is expected that if a service comes online also the list of descritions is sent again.

Definition at line 15 of file DimServiceInfoList.h.


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