FACT++  1.0
void StateClient::infoHandler ( )
protectedvirtual

The dim service subscription.

Extract the information about the state and its message. Store the state and redirect the message to fMsg.

Implements DimInfoHandler.

Definition at line 14 of file DimNetwork.cc.

References fInfoState, MessageDimRX::fMsg, fState, fStateTime, DimInfoHandler::getInfo(), DimInfo::getName(), DimInfo::getQuality(), DimInfo::getSize(), DimInfo::getString(), DimInfo::getTimestamp(), DimInfo::getTimestampMillisecs(), MessageDimRX::infoHandler(), and MessageImp::StateChanged().

15 {
16  DimInfo *curr = getInfo(); // get current DimInfo address
17  if (!curr)
18  return;
19 
20  if (curr==&fInfoState)
21  {
22  const bool disconnected = fInfoState.getSize()==0;
23 
24  // Make sure getTimestamp is called _before_ getTimestampMillisecs
25  const int tsec = fInfoState.getTimestamp();
26  const int tms = fInfoState.getTimestampMillisecs();
27 
28  fState = disconnected ? -2 : fInfoState.getQuality();
29  fStateTime = Time(tsec, tms*1000);
30 
31  const string name = fInfoState.getName();
32 
33  fMsg.StateChanged(fStateTime, name.substr(0, name.length()-6),
34  disconnected ? "" : fInfoState.getString(), fState);
35 
36  return;
37  }
38 
40 }
char * getString()
Definition: dic.hxx:108
int getQuality()
Definition: diccpp.cxx:102
void StateChanged(const Time &time, const std::string &server, const std::string &msg, int state)
Definition: MessageImp.cc:64
Adds some functionality to boost::posix_time::ptime for our needs.
Definition: Time.h:30
DimStampedInfo fInfoState
-2 not initialized, -1 not connected, 0>= state of client
Definition: DimNetwork.h:24
Definition: dic.hxx:31
int getTimestampMillisecs()
Definition: diccpp.cxx:114
int getSize()
Definition: dic.hxx:100
Time fStateTime
Definition: DimNetwork.h:21
int getTimestamp()
Definition: diccpp.cxx:107
DimInfo * getInfo()
Definition: dic.hxx:26
MessageImp & fMsg
Definition: MessageDim.h:41
int fState
Combine into one MTime (together with value)
Definition: DimNetwork.h:22
void infoHandler()
Definition: MessageDim.cc:132
char * getName()
Definition: dic.hxx:101

+ Here is the call graph for this function: