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

Definition at line 230 of file StateMachineDimControl.cc.

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

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

231 {
232  const lock_guard<mutex> guard(fMutex);
233 
234  int rc = 0;
235  for (auto it=fServerList.begin(); it!=fServerList.end(); it++)
236  {
237  if (!serv.empty() && *it!=serv)
238  continue;
239 
240  out << kRed << "----- " << *it << " -----" << endl;
241 
242  int cnt = 0;
243  for (auto is=fStateDescriptionList.begin(); is!=fStateDescriptionList.end(); is++)
244  {
245  const string &server = is->first.first;
246 
247  if (server!=*it)
248  continue;
249 
250  const int32_t &state = is->first.second;
251  const string &name = is->second.first;
252  const string &comment = is->second.second;
253 
254  out << kBold << setw(5) << state << kReset << ": ";
255  out << kYellow << name;
256  if (!comment.empty())
257  out << kBlue << " (" << comment << ")";
258  out << endl;
259 
260  cnt++;
261  }
262 
263  if (cnt==0)
264  out << " <no states>" << endl;
265  else
266  rc++;
267 
268  out << endl;
269  }
270 
271  return rc;
272 }
Set color Yellow.
Definition: WindowLog.h:19
Set color Red.
Definition: WindowLog.h:17
std::map< std::pair< std::string, int32_t >, std::pair< std::string, std::string > > fStateDescriptionList
Definition: dis.c:69
Set color Blue.
Definition: WindowLog.h:20
Reset all attributes.
Definition: WindowLog.h:29
std::set< std::string > fServerList
Set attribute Bold.
Definition: WindowLog.h:36

+ Here is the caller graph for this function: