Sirikata
|
#include <SSTImpl.hpp>
Private Types | |
typedef std::tr1::shared_ptr < BaseDatagramLayer < EndPointType > > | Ptr |
typedef Ptr | BaseDatagramLayerPtr |
typedef std::tr1::function < void(void *, int) | DataCallback ) |
Private Member Functions | |
const Context * | context () |
Get the Context for this datagram layer. | |
uint32 | getUnusedPort (const EndPointType &ep) |
Get a port that isn't currently in use. | |
void | listenOn (EndPoint< EndPointType > &listeningEndPoint, DataCallback cb) |
Listen to the specified endpoint and invoke the given callback when data arrives. | |
void | listenOn (EndPoint< EndPointType > &listeningEndPoint) |
Listen to the specified endpoint, invoking Connection::handleReceive() when data arrives. | |
void | send (EndPoint< EndPointType > *src, EndPoint< EndPointType > *dest, void *data, int len) |
Send the given data from the given source port (possibly not allocated yet) to the given destination. | |
void | unlisten (EndPoint< EndPointType > &ep) |
Stop listening on the given endpoint. | |
void | invalidate () |
Mark this BaseDatagramLayer as invalid, ensuring that no more writes to the underlying datagram protocol will occur. | |
Static Private Member Functions | |
static BaseDatagramLayerPtr | createDatagramLayer (ConnectionVariables< EndPointType > *sstConnVars, EndPointType endPoint, const Context *ctx, void *extra) |
Create a datagram layer. | |
static BaseDatagramLayerPtr | getDatagramLayer (ConnectionVariables< EndPointType > *sstConnVars, EndPointType endPoint) |
Get the datagram layer for the given endpoint, if it exists. | |
static void | stopListening (ConnectionVariables< EndPointType > *sstConnVars, EndPoint< EndPointType > &listeningEndPoint) |
Stop listening to the specified endpoint and also remove from the ConnectionVariables datagram layer map. |
typedef Ptr Sirikata::SST::BaseDatagramLayer< EndPointType >::BaseDatagramLayerPtr [private] |
typedef std::tr1::function<void(void*, int) Sirikata::SST::BaseDatagramLayer< EndPointType >::DataCallback) [private] |
typedef std::tr1::shared_ptr<BaseDatagramLayer<EndPointType> > Sirikata::SST::BaseDatagramLayer< EndPointType >::Ptr [private] |
const Context* Sirikata::SST::BaseDatagramLayer< EndPointType >::context | ( | ) | [inline, private] |
Get the Context for this datagram layer.
static BaseDatagramLayerPtr Sirikata::SST::BaseDatagramLayer< EndPointType >::createDatagramLayer | ( | ConnectionVariables< EndPointType > * | sstConnVars, |
EndPointType | endPoint, | ||
const Context * | ctx, | ||
void * | extra | ||
) | [inline, static, private] |
Create a datagram layer.
Required parameters are the ConnectionVariables, Endpoint, and Context. Additional variables are permitted (this is called via a templated function in ConnectionManager).
Should insert into ConnectionVariable's datagram layer map; should also reuse existing datagram layers.
static BaseDatagramLayerPtr Sirikata::SST::BaseDatagramLayer< EndPointType >::getDatagramLayer | ( | ConnectionVariables< EndPointType > * | sstConnVars, |
EndPointType | endPoint | ||
) | [inline, static, private] |
Get the datagram layer for the given endpoint, if it exists.
uint32 Sirikata::SST::BaseDatagramLayer< EndPointType >::getUnusedPort | ( | const EndPointType & | ep | ) | [inline, private] |
Get a port that isn't currently in use.
Referenced by Sirikata::SST::Stream< EndPointType >::connectStream().
void Sirikata::SST::BaseDatagramLayer< EndPointType >::invalidate | ( | ) | [inline, private] |
Mark this BaseDatagramLayer as invalid, ensuring that no more writes to the underlying datagram protocol will occur.
Also remove this BaseDatagramLayer from the ConnectionVariables.
void Sirikata::SST::BaseDatagramLayer< EndPointType >::listenOn | ( | EndPoint< EndPointType > & | listeningEndPoint | ) | [inline, private] |
Listen to the specified endpoint, invoking Connection::handleReceive() when data arrives.
void Sirikata::SST::BaseDatagramLayer< EndPointType >::listenOn | ( | EndPoint< EndPointType > & | listeningEndPoint, |
DataCallback | cb | ||
) | [inline, private] |
Listen to the specified endpoint and invoke the given callback when data arrives.
void Sirikata::SST::BaseDatagramLayer< EndPointType >::send | ( | EndPoint< EndPointType > * | src, |
EndPoint< EndPointType > * | dest, | ||
void * | data, | ||
int | len | ||
) | [inline, private] |
Send the given data from the given source port (possibly not allocated yet) to the given destination.
This is the core function for outbound communication.
static void Sirikata::SST::BaseDatagramLayer< EndPointType >::stopListening | ( | ConnectionVariables< EndPointType > * | sstConnVars, |
EndPoint< EndPointType > & | listeningEndPoint | ||
) | [inline, static, private] |
Stop listening to the specified endpoint and also remove from the ConnectionVariables datagram layer map.
void Sirikata::SST::BaseDatagramLayer< EndPointType >::unlisten | ( | EndPoint< EndPointType > & | ep | ) | [inline, private] |
Stop listening on the given endpoint.
You can fully deallocate the underlying resources for the endpoint.