Sirikata
Private Types | Private Member Functions | Static Private Member Functions
Sirikata::SST::BaseDatagramLayer< EndPointType > Class Template Reference

#include <SSTImpl.hpp>

List of all members.

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 Contextcontext ()
 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.

template<typename EndPointType>
class Sirikata::SST::BaseDatagramLayer< EndPointType >


Member Typedef Documentation

template<typename EndPointType>
typedef Ptr Sirikata::SST::BaseDatagramLayer< EndPointType >::BaseDatagramLayerPtr [private]
template<typename EndPointType>
typedef std::tr1::function<void(void*, int) Sirikata::SST::BaseDatagramLayer< EndPointType >::DataCallback) [private]
template<typename EndPointType>
typedef std::tr1::shared_ptr<BaseDatagramLayer<EndPointType> > Sirikata::SST::BaseDatagramLayer< EndPointType >::Ptr [private]

Member Function Documentation

template<typename EndPointType>
const Context* Sirikata::SST::BaseDatagramLayer< EndPointType >::context ( ) [inline, private]

Get the Context for this datagram layer.

template<typename EndPointType>
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.

template<typename EndPointType>
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.

template<typename EndPointType>
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().

template<typename EndPointType>
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.

template<typename EndPointType>
void Sirikata::SST::BaseDatagramLayer< EndPointType >::listenOn ( EndPoint< EndPointType > &  listeningEndPoint) [inline, private]

Listen to the specified endpoint, invoking Connection::handleReceive() when data arrives.

template<typename EndPointType>
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.

template<typename EndPointType>
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.

template<typename EndPointType>
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.

template<typename EndPointType>
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.


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