1 #ifndef FACT_ServiceList 2 #define FACT_ServiceList 17 typedef std::map<const std::string, std::pair<DimInfo*, DimInfo*>>
ServerMap;
18 typedef std::map<const std::string, std::vector<std::string>>
ServiceMap;
19 typedef std::map<const std::string, std::string>
StringMap;
20 typedef std::map<const std::string, std::vector<Description>>
DescriptionMap;
56 std::vector<std::string>
GetServiceList(
const std::string &server)
const;
58 bool HasServer(
const std::string &name)
const;
59 bool HasService(
const std::string &server,
const std::string &service)
const;
60 bool HasService(
const std::string &service)
const;
62 ServiceMap::const_iterator
begin()
const {
return fServiceList.begin(); }
63 ServiceMap::const_iterator
end()
const {
return fServiceList.end(); }
65 std::vector<std::string>::const_iterator
begin(
const std::string &server)
const;
66 std::vector<std::string>::const_iterator
end(
const std::string &server)
const;
68 std::string
GetFormat(
const std::string &server,
const std::string &name)
const;
69 std::string
GetFormat(
const std::string &service)
const;
71 std::string
GetComment(
const std::string &server,
const std::string &name)
const;
72 std::string
GetComment(
const std::string &service)
const;
74 std::vector<Description>
GetDescriptions(
const std::string &server,
const std::string &name)
const;
75 std::vector<Description>
GetDescriptions(
const std::string &service)
const;
79 int PrintDescription(std::ostream &out,
const std::string &
serv=
"",
const std::string &svc=
"")
const;
87 bool SendDimCommand(std::ostream &lout,
const std::string &server,
const std::string &
str)
const;
ServerMap fServerList
A filter for the type of the services to be collected, e.g. CMD.
ServiceMap::const_iterator begin() const
ServiceList(const char *type, std::ostream &out=std::cout)
std::map< const std::string, std::pair< DimInfo *, DimInfo * > > ServerMap
bool SendDimCommand(std::ostream &lout, const std::string &server, const std::string &str) const
StringMap fFormatList
A map storing server names and vector with all their available commands.
std::string GetComment(const std::string &server, const std::string &name) const
ServiceMap fServiceList
A map storing server names and a DimInfo for their SERVICE_LIST.
void PrintServiceList() const
DimInfo fDimServers
stream for redirection of the output
void ProcessServiceList(DimInfo &info)
std::vector< std::string > GetServiceList() const
bool SendDimCommand(const std::string &server, const std::string &str) const
bool HasService(const std::string &server, const std::string &service) const
ServiceMap::const_iterator end() const
DimInfo * CreateFMT(const std::string &str) const
DimInfo * CreateSL(const std::string &str) const
std::vector< std::string > GetServerList() const
bool HasServer(const std::string &name) const
int PrintDescription(std::ostream &out, const std::string &serv="", const std::string &svc="") const
std::string GetFormat(const std::string &server, const std::string &name) const
const std::string fType
A DimInfo to retrieve the SERVER_LIST from teh DNS server.
std::vector< Description > GetDescriptions(const std::string &server, const std::string &name) const
DescriptionMap fDescriptionList
A map storing all descriptions for commands and services.
DimInfo * CreateDimInfo(const std::string &str, const std::string &svc) const
A callback to signal updates.
void PrintServerList() const
int PrintDescription(const std::string &serv="", const std::string &svc="") const
Maintains a list of all servers and services available in the Dim nbetwork.
~ServiceList()
Delete the allocated memory from fServerList.
static void handler(int conn_id, char *packet, int size, int status)
void SetHandler(DimInfoHandler *handler=0)
std::map< const std::string, std::string > StringMap
DimInfoHandler * fHandler
A map storing all descriptions for arguments of command and services.
StringMap fDescriptionMap
A map storing all commands and their format strings.
std::map< const std::string, std::vector< std::string > > ServiceMap
std::map< const std::string, std::vector< Description > > DescriptionMap
void DumpServiceList() const