EpcTools
An event based multi-threaded C++ development framework.
Public Types | Public Member Functions | List of all members
PFCP::LocalNode Class Reference

Represents the local PFCP node. More...

#include <epfcp.h>

Inheritance diagram for PFCP::LocalNode:
PFCP::Node

Public Types

enum  State { State::Initialized, State::Started, State::Stopping, State::Stopped }
 

Public Member Functions

 LocalNode ()
 Default constructor. More...
 
virtual ~LocalNode ()
 Class destructor. More...
 
State state ()
 Gets the state of the local node. More...
 
Seid allocSeid ()
 Creates a new SEID. More...
 
Void freeSeid (Seid seid)
 Deallocates a SEID. More...
 
ULong allocSeqNbr ()
 Allocates a message sequence number for a request message. More...
 
Void freeSeqNbr (ULong sn)
 Deallocates a sequence number. More...
 
Void setNbrActivityWnds (size_t nbr)
 Sets the number of activity windows. More...
 
RemoteNodeSPtr createRemoteNode (cpStr addr, UShort port)
 Creates a remote Node that this local node will "talk" to. More...
 
RemoteNodeSPtr createRemoteNode (EIpAddress &address, UShort port)
 Creates a remote Node that this local node will "talk" to. More...
 
RemoteNodeUMapremoteNodes ()
 Returns the map of current remote nodes. Access to this map must be protected with the read/write lock returned by remoteNodesLock() for thread-safety. More...
 
ERWLockremoteNodesLock ()
 Returns a lock protected access to the remote nodes map. More...
 
virtual Void collectStats (EJsonBuilder &builder)
 Appends stats about the current local node object to the provided json builder. Derived classes can override this function with additional information to append. This function is called during a call to Stats::collectNodeStats(). Derived implementations should call this base method in their implementation (e.g. LocalNode::collectStats(builder)). Derived implementations should ensure thread-safety for accessed members. This function is thread-safe. More...
 
SessionBaseSPtr createSession (LocalNodeSPtr &ln, RemoteNodeSPtr &rn)
 Creates a new Session object and registers it with the local and remote nodes. More...
 
NodeSocketsocket ()
 Returns a reference to the underlying socket object for this local host. More...
 
State state () const
 Returns the current state of the local node. More...
 
- Public Member Functions inherited from PFCP::Node
 Node ()
 Default constructor. More...
 
virtual ~Node ()
 Class destructor. More...
 
EIpAddressipAddress ()
 Returns the IP address associated with this node. More...
 
NodesetIpAddress (const EIpAddress &ipaddr)
 Assigns the IP address for this node. More...
 
ESocket::Addressaddress ()
 Returns the ESocket::Address object representing the IP address for this node. More...
 
NodesetAddress (const ESocket::Address &addr)
 Assigns the ESocket::Address object representing the IP address for this node. More...
 
const ETimestartTime () const
 Returns the Node start time. More...
 
NodesetStartTime (const ETime &st=ETime::Now())
 Assigns the Node start time. More...
 
SessionBaseSPtr getSession (Seid seid)
 Returns the session object for the specified SEID. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from PFCP::Node
static ULongLong nodesCreated ()
 
static ULongLong nodesDeleted ()
 

Detailed Description

Represents the local PFCP node.

Member Enumeration Documentation

Enumerator
Initialized 
Started 
Stopping 
Stopped 

Constructor & Destructor Documentation

PFCP::LocalNode::LocalNode ( )

Default constructor.

PFCP::LocalNode::~LocalNode ( )
virtual

Class destructor.

Member Function Documentation

Seid PFCP::LocalNode::allocSeid ( )

Creates a new SEID.

Returns
the newly created SEID.
ULong PFCP::LocalNode::allocSeqNbr ( )

Allocates a message sequence number for a request message.

Returns
the newly created sequence number.
Void PFCP::LocalNode::collectStats ( EJsonBuilder builder)
virtual

Appends stats about the current local node object to the provided json builder. Derived classes can override this function with additional information to append. This function is called during a call to Stats::collectNodeStats(). Derived implementations should call this base method in their implementation (e.g. LocalNode::collectStats(builder)). Derived implementations should ensure thread-safety for accessed members. This function is thread-safe.

Parameters
builderthe json builder to populate
RemoteNodeSPtr PFCP::LocalNode::createRemoteNode ( cpStr  addr,
UShort  port 
)
inline

Creates a remote Node that this local node will "talk" to.

Parameters
addrthe IP address of the remote host.
portthe port that messages will be sent to.
RemoteNodeSPtr PFCP::LocalNode::createRemoteNode ( EIpAddress address,
UShort  port 
)

Creates a remote Node that this local node will "talk" to.

Parameters
addressthe IP address of the remote host.
portthe port that messages will be sent to.
Returns
a reference to this object.
SessionBaseSPtr PFCP::LocalNode::createSession ( LocalNodeSPtr &  ln,
RemoteNodeSPtr &  rn 
)

Creates a new Session object and registers it with the local and remote nodes.

Parameters
lnthe local node shared pointer.
rnthe remote node shared pointer.
Returns
a shared pointer to the newly created session object.
Void PFCP::LocalNode::freeSeid ( Seid  seid)

Deallocates a SEID.

Parameters
seidthe SEID to deallocate.
Void PFCP::LocalNode::freeSeqNbr ( ULong  sn)

Deallocates a sequence number.

Parameters
snthe sequence number to deallocate.
RemoteNodeUMap& PFCP::LocalNode::remoteNodes ( )
inline

Returns the map of current remote nodes. Access to this map must be protected with the read/write lock returned by remoteNodesLock() for thread-safety.

Returns
a reference to the remote nodes map
ERWLock& PFCP::LocalNode::remoteNodesLock ( )
inline

Returns a lock protected access to the remote nodes map.

Returns
a reference to the read/write lock
Void PFCP::LocalNode::setNbrActivityWnds ( size_t  nbr)

Sets the number of activity windows.

Parameters
nbrthe number of activity windows.
NodeSocket& PFCP::LocalNode::socket ( )
inline

Returns a reference to the underlying socket object for this local host.

Returns
a reference to the underlying socket object.
State PFCP::LocalNode::state ( )
inline

Gets the state of the local node.

Returns
the state of the local node.
State PFCP::LocalNode::state ( ) const
inline

Returns the current state of the local node.

Returns
the current state of the local node.

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