rasdaman complete source
Public Member Functions | List of all members
rnp::RnpReceiver Class Reference

#include <rnpembedded.hh>

Public Member Functions

 RnpReceiver () throw ()
 Default constructor. More...
 
 ~RnpReceiver () throw ()
 Destructor. More...
 
void reset () throw ()
 Resets the receiver, preparing for a new message. More...
 
akg::CommBuffergetCurrentBuffer () throw ()
 Returns a pointer to the current buffer (the header one or the message one) More...
 
akg::CommBuffergetMessageBuffer () throw ()
 
bool validateMessage () throw ()
 Returns 'true' if the whole message was received, 'false' if more data is expected. More...
 
bool isDiscarding () const throw ()
 
RnpTransport::CarrierProtocol getCarrierProtocol () const throw ()
 Returns the type of the carrier protocol. More...
 
int getCarrierHeaderSize () const throw ()
 Returns the size of the carrier header. More...
 
const void * getCarrierHeader () throw ()
 Returns a pointer to the carrier header. More...
 

Detailed Description

RnpReceiver is a class that is able to receive an message in a CommBuffer and decide if it is a valid Rnp message, embedded or not.

It is designed to be used by a NbJob for receiving the message and cooperate with it.

If it is an invalid message or the message buffer can't be allocated, the rest of the message is discarded and the NbJob has to close the connection and do appropriate cleaning

The receiver has two buffers, a fixed length one, for header and a dynamic one for the RNP message

Constructor & Destructor Documentation

rnp::RnpReceiver::RnpReceiver ( )
throw (
)

Default constructor.

rnp::RnpReceiver::~RnpReceiver ( )
throw (
)

Destructor.

Member Function Documentation

const void* rnp::RnpReceiver::getCarrierHeader ( )
throw (
)

Returns a pointer to the carrier header.

int rnp::RnpReceiver::getCarrierHeaderSize ( ) const
throw (
)

Returns the size of the carrier header.

RnpTransport::CarrierProtocol rnp::RnpReceiver::getCarrierProtocol ( ) const
throw (
)

Returns the type of the carrier protocol.

akg::CommBuffer* rnp::RnpReceiver::getCurrentBuffer ( )
throw (
)

Returns a pointer to the current buffer (the header one or the message one)

akg::CommBuffer* rnp::RnpReceiver::getMessageBuffer ( )
throw (
)

Returns a pointer to the message buffer, which contains the RNP message, whitout any carrier header

bool rnp::RnpReceiver::isDiscarding ( ) const
throw (
)

Returns 'true' if an error occured and the message has to be discarded If validate()==false and isDiscarding()==true => NbJob has to reset receiver and close connection

void rnp::RnpReceiver::reset ( )
throw (
)

Resets the receiver, preparing for a new message.

bool rnp::RnpReceiver::validateMessage ( )
throw (
)

Returns 'true' if the whole message was received, 'false' if more data is expected.


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