Changeset 5151 for sample/pingpong/PingPong.h
- Timestamp:
- Jul 21, 2009, 1:54:55 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sample/pingpong/PingPong.h
r3071 r5151 6 6 #include "ariba/utility/system/StartupInterface.h" 7 7 #include "ariba/utility/system/Timer.h" 8 9 #include <vector> 8 10 9 11 using namespace ariba; … … 15 17 namespace pingpong { 16 18 19 using namespace std; 20 17 21 /** 18 /* The PingPong main class 19 /* This class implements an example service for demonstration purposes 20 /* The pingpong class sends and receives messages between two SpoVNet 21 /* instances 22 **/ 23 class PingPong : 24 public NodeListener, 22 /* The PingPong main class 23 /* This class implements an example service for demonstration purposes 24 /* The pingpong class sends and receives messages between two SpoVNet 25 /* instances 26 **/ 27 class PingPong: public NodeListener, 25 28 public CommunicationListener, 26 29 public StartupInterface, … … 35 38 protected: 36 39 // communication listener interface 37 virtual bool onLinkRequest(const NodeID& remote, const DataMessage& msg = DataMessage::UNSPECIFIED); 38 virtual void onMessage(const DataMessage& msg, const NodeID& remote, const LinkID& lnk= LinkID::UNSPECIFIED); 40 virtual bool onLinkRequest(const NodeID& remote, const DataMessage& msg = 41 DataMessage::UNSPECIFIED); 42 virtual void onMessage(const DataMessage& msg, const NodeID& remote, 43 const LinkID& lnk = LinkID::UNSPECIFIED); 39 44 virtual void onLinkUp(const LinkID& lnk, const NodeID& remote); 40 45 virtual void onLinkDown(const LinkID& lnk, const NodeID& remote); … … 43 48 44 49 // node listener interface 45 virtual void onJoinCompleted( const SpoVNetID& vid);46 virtual void onJoinFailed( const SpoVNetID& vid);47 virtual void onLeaveCompleted( const SpoVNetID& vid);48 virtual void onLeaveFailed( const SpoVNetID& vid);50 virtual void onJoinCompleted(const SpoVNetID& vid); 51 virtual void onJoinFailed(const SpoVNetID& vid); 52 virtual void onLeaveCompleted(const SpoVNetID& vid); 53 virtual void onLeaveFailed(const SpoVNetID& vid); 49 54 50 55 // startup wrapper interface … … 53 58 54 59 // timer events 55 60 virtual void eventFunction(); 56 61 57 62 private: 58 63 // the ariba module and a node 59 64 AribaModule* ariba; 60 Node* node; 65 Node* node; 66 string name; 67 int counter; 68 vector<string> names; 61 69 62 70 // flag, whether this node initiates or just joins the spovnet 63 71 bool isInitiator; 64 72 65 66 73 // the ping pong service id 74 static ServiceID PINGPONG_SERVICEID; 67 75 68 69 76 // the current ping id 77 unsigned long pingId; 70 78 71 79 };
Note:
See TracChangeset
for help on using the changeset viewer.