ConnectionMadeTrans.h
Go to the documentation of this file.00001
00002 #ifndef INCLUDED_ConnectionMadeTrans_h_
00003 #define INCLUDED_ConnectionMadeTrans_h_
00004
00005 #include "Behaviors/Transition.h"
00006 #include "Events/EventRouter.h"
00007 #include "Wireless/Wireless.h"
00008
00009
00010 class ConnectionMadeTrans : public Transition {
00011 public:
00012
00013
00014 ConnectionMadeTrans(StateNode* destination, Socket* sock) : Transition("ConnectionMadeTrans",destination), socket(sock) {}
00015
00016
00017 ConnectionMadeTrans(const std::string& name, StateNode* destination, Socket* sock) :
00018 Transition("ConnectionMadeTrans",name,destination), socket(sock) {}
00019
00020
00021 virtual void preStart() {
00022 Transition::preStart();
00023 erouter->addTimer(this,0,32,true);
00024 }
00025
00026
00027 virtual void doEvent() {
00028 if(socket!=NULL && wireless->isConnected(socket->sock)) {
00029 fire();
00030 }
00031 }
00032
00033 protected:
00034
00035 ConnectionMadeTrans(const std::string &classname, const std::string &instancename, StateNode* destination, Socket* sock) :
00036 Transition(classname,instancename,destination), socket(sock) {}
00037 ConnectionMadeTrans(const ConnectionMadeTrans&);
00038 ConnectionMadeTrans& operator=(const ConnectionMadeTrans&);
00039
00040
00041
00042 Socket* socket;
00043 };
00044
00045
00046
00047
00048
00049
00050 #endif