ariba::application::pingpong::PingPong Class Reference

#include <sample/pingpong/PingPong.h>

Inherits ariba::NodeListener, ariba::CommunicationListener, ariba::utility::StartupInterface, and ariba::utility::Timer.

Collaboration diagram for ariba::application::pingpong::PingPong:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PingPong ()
virtual ~PingPong ()

Protected Member Functions

virtual bool onLinkRequest (const NodeID &remote)
virtual void onMessage (const DataMessage &msg, const NodeID &remote, const LinkID &lnk=LinkID::UNSPECIFIED)
virtual void onLinkUp (const LinkID &lnk, const NodeID &remote)
virtual void onLinkDown (const LinkID &lnk, const NodeID &remote)
virtual void onLinkChanged (const LinkID &lnk, const NodeID &remote)
virtual void onLinkFail (const LinkID &lnk, const NodeID &remote)
virtual void onJoinCompleted (const SpoVNetID &vid)
virtual void onJoinFailed (const SpoVNetID &vid)
virtual void onLeaveCompleted (const SpoVNetID &vid)
virtual void onLeaveFailed (const SpoVNetID &vid)
virtual void startup ()
virtual void shutdown ()
virtual void eventFunction ()

Private Member Functions

 use_logging_h (PingPong)

Private Attributes

AribaModuleariba
Nodenode
string name
int counter
vector< string > names
unsigned long pingId

Static Private Attributes

static ServiceID PINGPONG_SERVICEID = ServiceID( 111 )

Detailed Description

/* The PingPong main class /* This class implements an example service for demonstration purposes /* The pingpong class sends and receives messages between two SpoVNet /* instances

Definition at line 27 of file PingPong.h.


Constructor & Destructor Documentation

ariba::application::pingpong::PingPong::PingPong (  ) 

Definition at line 19 of file PingPong.cpp.

References ariba::utility::Timer::setInterval().

ariba::application::pingpong::PingPong::~PingPong (  )  [virtual]

Definition at line 24 of file PingPong.cpp.


Member Function Documentation

void ariba::application::pingpong::PingPong::eventFunction (  )  [protected, virtual]
void ariba::application::pingpong::PingPong::onJoinCompleted ( const SpoVNetID vid  )  [protected, virtual]

This event method is called, when a node has completed its join procedure.

Parameters:
vid The spovnet id
nid The node id

Reimplemented from ariba::NodeListener.

Definition at line 168 of file PingPong.cpp.

References logging_info, ariba::utility::Timer::start(), and ariba::utility::Identifier::toString().

void ariba::application::pingpong::PingPong::onJoinFailed ( const SpoVNetID vid  )  [protected, virtual]

This event method is called, when a node failed to join a spovnet.

Parameters:
vid The spovnet id
nid The node id

Reimplemented from ariba::NodeListener.

Definition at line 175 of file PingPong.cpp.

References logging_error, and ariba::utility::Identifier::toString().

void ariba::application::pingpong::PingPong::onLeaveCompleted ( const SpoVNetID vid  )  [protected, virtual]

This event method is called, when a node succeeded to leave a spovnet.

Parameters:
vid The spovnet id
nid The node id

Reimplemented from ariba::NodeListener.

Definition at line 179 of file PingPong.cpp.

References logging_info, and ariba::utility::Identifier::toString().

void ariba::application::pingpong::PingPong::onLeaveFailed ( const SpoVNetID vid  )  [protected, virtual]

This event method is called, when a node failed to leave a spovnet.

Parameters:
vid The spovnet id
nid The node id

Reimplemented from ariba::NodeListener.

Definition at line 183 of file PingPong.cpp.

References logging_error, and ariba::utility::Identifier::toString().

void ariba::application::pingpong::PingPong::onLinkChanged ( const LinkID lnk,
const NodeID remote 
) [protected, virtual]

Event called when a link has changed, e.g. through mobility

Parameters:
lnk The id of the link
remote The remote node where the link ends

Reimplemented from ariba::CommunicationListener.

Definition at line 208 of file PingPong.cpp.

References logging_info, and ariba::utility::Identifier::toString().

void ariba::application::pingpong::PingPong::onLinkDown ( const LinkID lnk,
const NodeID remote 
) [protected, virtual]

Event called when a link goes down

Parameters:
lnk The id of the link
remote The remote node where the link ends

Reimplemented from ariba::CommunicationListener.

Definition at line 203 of file PingPong.cpp.

References logging_info, and ariba::utility::Identifier::toString().

void ariba::application::pingpong::PingPong::onLinkFail ( const LinkID lnk,
const NodeID remote 
) [protected, virtual]

Event called when a link has failed

Parameters:
lnk The id of the link
remote The remote node where the link ends

Reimplemented from ariba::CommunicationListener.

Definition at line 218 of file PingPong.cpp.

References logging_info, and ariba::utility::Identifier::toString().

bool ariba::application::pingpong::PingPong::onLinkRequest ( const NodeID remote  )  [protected, virtual]

Request from remote node to open up a link

Parameters:
remote The remote node that requests the new link

Reimplemented from ariba::CommunicationListener.

Definition at line 213 of file PingPong.cpp.

References logging_info, and ariba::utility::Identifier::toString().

void ariba::application::pingpong::PingPong::onLinkUp ( const LinkID lnk,
const NodeID remote 
) [protected, virtual]

Event called when a link goes up

Parameters:
lnk The id of the link
remote The remote node where the link ends

Reimplemented from ariba::CommunicationListener.

Definition at line 198 of file PingPong.cpp.

References logging_info, and ariba::utility::Identifier::toString().

void ariba::application::pingpong::PingPong::onMessage ( const DataMessage msg,
const NodeID remote,
const LinkID lnk = LinkID::UNSPECIFIED 
) [protected, virtual]

Called when a message is incoming

Parameters:
msg The data message that is received
remote The remote node that sent the message
lnk The link id of the link where the message is received

Reimplemented from ariba::CommunicationListener.

Definition at line 187 of file PingPong.cpp.

References Message::convert(), ariba::DataMessage::getMessage(), ariba::application::pingpong::PingPongMessage::getName(), ariba::application::pingpong::PingPongMessage::info(), logging_info, names, and ariba::utility::Identifier::toString().

void ariba::application::pingpong::PingPong::shutdown (  )  [protected, virtual]
void ariba::application::pingpong::PingPong::startup (  )  [protected, virtual]
ariba::application::pingpong::PingPong::use_logging_h ( PingPong   )  [private]

Reimplemented from ariba::utility::Timer.


Member Data Documentation

Definition at line 63 of file PingPong.h.

Referenced by shutdown(), and startup().

Definition at line 66 of file PingPong.h.

Referenced by eventFunction().

Definition at line 65 of file PingPong.h.

Referenced by eventFunction(), and startup().

Definition at line 67 of file PingPong.h.

Referenced by eventFunction(), and onMessage().

Definition at line 64 of file PingPong.h.

Referenced by eventFunction(), shutdown(), and startup().

Definition at line 73 of file PingPong.h.

Referenced by eventFunction().

Definition at line 70 of file PingPong.h.

Referenced by eventFunction(), shutdown(), and startup().


The documentation for this class was generated from the following files:

Generated on Fri Dec 10 11:09:24 2010 for Ariba by  doxygen 1.6.1