FACT++  1.0
SkypeClient::SkypeClient ( ostream &  lout)
inline

Definition at line 629 of file skypeclient.cc.

References FALSE, HandleCall(), HandleConnect(), HandleDisconnect(), HandleMsg(), and HandleRaw().

629  : StateMachineDim(lout, "SKYPE"),
630  fLastConnect(Time()-boost::posix_time::minutes(5)), fLoop(0),
632  {
633  AddStateName(kStateDisconnected, "Disonnected", "");
634  AddStateName(kStateConnected, "Connected", "");
635 
636  AddEvent("MSG", "C", kStateConnected)
637  (bind(&SkypeClient::HandleMsg, this, placeholders::_1))
638  ("|msg[string]:message to be distributed");
639 
640  AddEvent("RAW", "C")
641  (bind(&SkypeClient::HandleRaw, this, placeholders::_1))
642  ("|msg[string]:send a raw message to the Skype API");
643 
644  AddEvent("CALL", "", kStateConnected)
645  (bind(&SkypeClient::HandleCall, this))
646  ("");
647 
648  AddEvent("CONNECT", kStateDisconnected)
649  (bind(&SkypeClient::HandleConnect, this))
650  ("");
651 
652  AddEvent("DISCONNECT", kStateConnected)
653  (bind(&SkypeClient::HandleDisconnect, this))
654  ("");
655 
656  fLoop = g_main_loop_new(NULL, FALSE);
657  }
EventImp & AddEvent(const std::string &name, const std::string &states, const std::string &fmt)
int HandleCall()
Definition: skypeclient.cc:87
int HandleRaw(const EventImp &evt)
Definition: skypeclient.cc:77
Adds some functionality to boost::posix_time::ptime for our needs.
Definition: Time.h:30
StateMachineDim(std::ostream &out=std::cout, const std::string &name="DEFAULT")
#define FALSE
Definition: dim.h:136
uint64_t fLastReadMessage
Definition: skypeclient.cc:35
int HandleDisconnect()
Definition: skypeclient.cc:547
int HandleConnect()
Definition: skypeclient.cc:552
int HandleMsg(const EventImp &evt)
Definition: skypeclient.cc:61
GMainLoop * fLoop
Definition: skypeclient.cc:27
bool AddStateName(const int state, const std::string &name, const std::string &doc="")
Time fLastConnect
Definition: skypeclient.cc:24

+ Here is the call graph for this function: