FACT++  1.0
int DimServiceInfoList::PrintStates ( std::ostream &  out,
const std::string &  serv = "" 
) const

Print the full list of stated for the given server.

Parameters
outostream to which the output is send.
servif a server is given, only the information for this server is printed
Returns
the number of states found

Definition at line 594 of file DimServiceInfoList.cc.

References i, kBlue, kBold, kRed, kReset, and kYellow.

Referenced by DimServiceInfoListImp::PrintStates(), and ~DimServiceInfoList().

595 {
596  int rc = 0;
597  for (ServiceList::const_iterator i=fServiceList.begin(); i!=fServiceList.end(); i++)
598  {
599  const string &server = i->first;
600 
601  if (!serv.empty() && server!=serv)
602  continue;
603 
604  out << kRed << "----- " << server << " -----" << endl;
605 
606  const vector<State> &v = i->second.third;
607 
608  if (v.empty())
609  out << " <no states>" << endl;
610  else
611  rc++;
612 
613  for (vector<State>::const_iterator s=v.begin(); s!=v.end(); s++)
614  {
615  out << kBold << setw(5) << s->index << kReset << ": ";
616  out << kYellow << s->name;
617  out << kBlue << " (" << s->comment << ")" << endl;
618  }
619  out << endl;
620  }
621 
622  return rc;
623 }
ServiceList fServiceList
A map storing the service description to retrieve all informations.
int i
Definition: db_dim_client.c:21
Set color Yellow.
Definition: WindowLog.h:19
Set color Red.
Definition: WindowLog.h:17
Definition: dis.c:69
Set color Blue.
Definition: WindowLog.h:20
Reset all attributes.
Definition: WindowLog.h:29
Set attribute Bold.
Definition: WindowLog.h:36

+ Here is the caller graph for this function: