OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SandeshReader Class Reference

#include <sandesh_session.h>

Collaboration diagram for SandeshReader:

Public Types

typedef boost::asio::const_buffer Buffer
 

Public Member Functions

 SandeshReader (SandeshSession *session)
 
virtual ~SandeshReader ()
 
virtual void OnRead (Buffer buffer)
 
void SetReceiveMsgCb (SandeshReceiveMsgCb cb)
 

Static Public Member Functions

static int ExtractMsgHeader (const std::string &msg, SandeshHeader &header, std::string &msg_type, uint32_t &header_offset)
 

Private Member Functions

bool MsgLengthKnown ()
 
size_t msg_length ()
 
void set_msg_length (size_t length)
 
void reset_msg_length ()
 
void SetBuf (const std::string &str)
 
void ReplaceBuf (const std::string &str)
 
bool LeftOver () const
 
int MatchString (const std::string &match, size_t &m_offset)
 
bool ExtractMsgLength (size_t &msg_length, int *result)
 
bool ExtractMsg (Buffer buffer, int *result, bool NewBuf)
 
 DISALLOW_COPY_AND_ASSIGN (SandeshReader)
 

Private Attributes

std::string buf_
 
size_t offset_
 
size_t msg_length_
 
SandeshSessionsession_
 
tbb::mutex cb_mutex_
 
SandeshReceiveMsgCb cb_
 

Static Private Attributes

static const int kDefaultRecvSize = SandeshWriter::kDefaultSendSize
 

Detailed Description

Definition at line 102 of file sandesh_session.h.

Member Typedef Documentation

typedef boost::asio::const_buffer SandeshReader::Buffer

Definition at line 104 of file sandesh_session.h.

Constructor & Destructor Documentation

SandeshReader::SandeshReader ( SandeshSession session)

Definition at line 462 of file sandesh_session.cc.

SandeshReader::~SandeshReader ( )
virtual

Definition at line 470 of file sandesh_session.cc.

Member Function Documentation

SandeshReader::DISALLOW_COPY_AND_ASSIGN ( SandeshReader  )
private
bool SandeshReader::ExtractMsg ( Buffer  buffer,
int *  result,
bool  NewBuf 
)
private

Definition at line 554 of file sandesh_session.cc.

Here is the call graph for this function:

int SandeshReader::ExtractMsgHeader ( const std::string &  msg,
SandeshHeader &  header,
std::string &  msg_type,
uint32_t &  header_offset 
)
static

Definition at line 473 of file sandesh_session.cc.

bool SandeshReader::ExtractMsgLength ( size_t &  msg_length,
int *  result 
)
private

Definition at line 520 of file sandesh_session.cc.

Here is the call graph for this function:

bool SandeshReader::LeftOver ( ) const
private

Definition at line 512 of file sandesh_session.cc.

int SandeshReader::MatchString ( const std::string &  match,
size_t &  m_offset 
)
private
size_t SandeshReader::msg_length ( )
inlineprivate

Definition at line 116 of file sandesh_session.h.

bool SandeshReader::MsgLengthKnown ( )
inlineprivate

Definition at line 114 of file sandesh_session.h.

void SandeshReader::OnRead ( Buffer  buffer)
virtual

Definition at line 577 of file sandesh_session.cc.

Here is the call graph for this function:

void SandeshReader::ReplaceBuf ( const std::string &  str)
private

Definition at line 506 of file sandesh_session.cc.

void SandeshReader::reset_msg_length ( )
inlineprivate

Definition at line 120 of file sandesh_session.h.

Here is the call graph for this function:

void SandeshReader::set_msg_length ( size_t  length)
inlineprivate

Definition at line 118 of file sandesh_session.h.

void SandeshReader::SetBuf ( const std::string &  str)
private

Definition at line 497 of file sandesh_session.cc.

Here is the call graph for this function:

void SandeshReader::SetReceiveMsgCb ( SandeshReceiveMsgCb  cb)

Definition at line 645 of file sandesh_session.cc.

Member Data Documentation

std::string SandeshReader::buf_
private

Definition at line 129 of file sandesh_session.h.

SandeshReceiveMsgCb SandeshReader::cb_
private

Definition at line 134 of file sandesh_session.h.

tbb::mutex SandeshReader::cb_mutex_
private

Definition at line 133 of file sandesh_session.h.

const int SandeshReader::kDefaultRecvSize = SandeshWriter::kDefaultSendSize
staticprivate

Definition at line 136 of file sandesh_session.h.

size_t SandeshReader::msg_length_
private

Definition at line 131 of file sandesh_session.h.

size_t SandeshReader::offset_
private

Definition at line 130 of file sandesh_session.h.

SandeshSession* SandeshReader::session_
private

Definition at line 132 of file sandesh_session.h.


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