FACT++  1.0
int StateMachineDimControl::PrintDescription ( std::ostream &  out,
bool  iscmd,
const std::string &  serv = "",
const std::string &  service = "" 
)

Definition at line 274 of file StateMachineDimControl.cc.

References if(), kBlue, kGreen, kRed, kReset, and kYellow.

Referenced by RemoteControl< Shell >::PrintDescription().

275 {
276  const lock_guard<mutex> guard(fMutex);
277 
278  int rc = 0;
279  for (auto it=fServerList.begin(); it!=fServerList.end(); it++)
280  {
281  if (!serv.empty() && *it!=serv)
282  continue;
283 
284  out << kRed << "----- " << *it << " -----" << endl << endl;
285 
286  for (auto is=fServiceList.begin(); is!=fServiceList.end(); is++)
287  {
288  if (is->server!=*it)
289  continue;
290 
291  if (!service.empty() && is->service!=service)
292  continue;
293 
294  if (is->iscmd!=iscmd)
295  continue;
296 
297  rc++;
298 
299  out << " " << is->service;
300  if (!is->format.empty())
301  out << '[' << is->format << ']';
302 
303  const auto id = fServiceDescriptionList.find(*it+"/"+is->service);
304  if (id!=fServiceDescriptionList.end())
305  {
306  const vector<Description> &v = id->second;
307 
308  for (auto j=v.begin()+1; j!=v.end(); j++)
309  out << " <" << j->name << ">";
310  out << endl;
311 
312  if (!v[0].comment.empty())
313  out << " " << v[0].comment << endl;
314 
315  for (auto j=v.begin()+1; j!=v.end(); j++)
316  {
317  out << " " << kGreen << j->name;
318  if (!j->comment.empty())
319  out << kReset << ": " << kBlue << j->comment;
320  if (!j->unit.empty())
321  out << kYellow << " [" << j->unit << "]";
322  out << endl;
323  }
324  }
325  out << endl;
326  }
327  out << endl;
328  }
329 
330  return rc;
331 }
Set color Green.
Definition: WindowLog.h:18
Set color Yellow.
Definition: WindowLog.h:19
Set color Red.
Definition: WindowLog.h:17
Definition: dis.c:69
std::map< std::string, std::vector< Description > > fServiceDescriptionList
Set color Blue.
Definition: WindowLog.h:20
std::set< Service > fServiceList
if(extraDns) new Dns
Reset all attributes.
Definition: WindowLog.h:29
std::set< std::string > fServerList

+ Here is the call graph for this function:

+ Here is the caller graph for this function: