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

#include <sandesh_session.h>

Collaboration diagram for SandeshWriter:

Public Member Functions

 SandeshWriter (SandeshSession *session)
 
 ~SandeshWriter ()
 
void SendMsg (Sandesh *sandesh, bool more)
 
void SendBuffer (boost::shared_ptr< TMemoryBuffer > sbuffer, bool more=false)
 
void WriteReady (const boost::system::error_code &ec)
 
bool SendReady ()
 

Static Public Attributes

static const uint32_t kEncodeBufferSize = 2048
 
static const unsigned int kDefaultSendSize = 16384
 
static const std::string sandesh_open_ = sXML_SANDESH_OPEN
 
static const std::string sandesh_open_attr_length_
 
static const std::string sandesh_close_ = sXML_SANDESH_CLOSE
 

Protected Member Functions

void SendMsgMore (boost::shared_ptr< TMemoryBuffer >)
 
void SendMsgAll (boost::shared_ptr< TMemoryBuffer >)
 

Private Member Functions

void SendInternal (boost::shared_ptr< TMemoryBuffer >)
 
void ConnectTimerExpired (const boost::system::error_code &error)
 
size_t send_buf_offset ()
 
uint8_t * send_buf () const
 
void set_send_buf (uint8_t *buf, size_t len)
 
void append_send_buf (uint8_t *buf, size_t len)
 
void reset_send_buf ()
 
 DISALLOW_COPY_AND_ASSIGN (SandeshWriter)
 

Private Attributes

SandeshSessionsession_
 
tbb::mutex send_mutex_
 
bool ready_to_send_
 
uint8_t * send_buf_
 
size_t send_buf_offset_
 

Friends

class SandeshSessionTest
 
class SandeshSendMsgUnitTest
 

Detailed Description

Definition at line 34 of file sandesh_session.h.

Constructor & Destructor Documentation

SandeshWriter::SandeshWriter ( SandeshSession session)

Definition at line 44 of file sandesh_session.cc.

SandeshWriter::~SandeshWriter ( )

Definition at line 51 of file sandesh_session.cc.

Member Function Documentation

void SandeshWriter::append_send_buf ( uint8_t *  buf,
size_t  len 
)
inlineprivate

Definition at line 77 of file sandesh_session.h.

Here is the call graph for this function:

void SandeshWriter::ConnectTimerExpired ( const boost::system::error_code &  error)
private
SandeshWriter::DISALLOW_COPY_AND_ASSIGN ( SandeshWriter  )
private
void SandeshWriter::reset_send_buf ( )
inlineprivate

Definition at line 82 of file sandesh_session.h.

uint8_t* SandeshWriter::send_buf ( ) const
inlineprivate

Definition at line 71 of file sandesh_session.h.

size_t SandeshWriter::send_buf_offset ( )
inlineprivate

Definition at line 70 of file sandesh_session.h.

void SandeshWriter::SendBuffer ( boost::shared_ptr< TMemoryBuffer sbuffer,
bool  more = false 
)
inline

Definition at line 42 of file sandesh_session.h.

Here is the call graph for this function:

void SandeshWriter::SendInternal ( boost::shared_ptr< TMemoryBuffer buf)
private

Definition at line 270 of file sandesh_session.cc.

Here is the call graph for this function:

void SandeshWriter::SendMsg ( Sandesh sandesh,
bool  more 
)

Definition at line 73 of file sandesh_session.cc.

Here is the call graph for this function:

void SandeshWriter::SendMsgAll ( boost::shared_ptr< TMemoryBuffer send_buffer)
protected

Definition at line 223 of file sandesh_session.cc.

Here is the call graph for this function:

void SandeshWriter::SendMsgMore ( boost::shared_ptr< TMemoryBuffer send_buffer)
protected

Definition at line 174 of file sandesh_session.cc.

Here is the call graph for this function:

bool SandeshWriter::SendReady ( )
inline

Definition at line 47 of file sandesh_session.h.

void SandeshWriter::set_send_buf ( uint8_t *  buf,
size_t  len 
)
inlineprivate

Definition at line 72 of file sandesh_session.h.

Here is the call graph for this function:

void SandeshWriter::WriteReady ( const boost::system::error_code &  ec)

Definition at line 55 of file sandesh_session.cc.

Here is the call graph for this function:

Friends And Related Function Documentation

friend class SandeshSendMsgUnitTest
friend

Definition at line 64 of file sandesh_session.h.

friend class SandeshSessionTest
friend

Definition at line 57 of file sandesh_session.h.

Member Data Documentation

const unsigned int SandeshWriter::kDefaultSendSize = 16384
static

Definition at line 37 of file sandesh_session.h.

const uint32_t SandeshWriter::kEncodeBufferSize = 2048
static

Definition at line 36 of file sandesh_session.h.

bool SandeshWriter::ready_to_send_
private

Definition at line 87 of file sandesh_session.h.

const std::string SandeshWriter::sandesh_close_ = sXML_SANDESH_CLOSE
static

Definition at line 54 of file sandesh_session.h.

const std::string SandeshWriter::sandesh_open_ = sXML_SANDESH_OPEN
static

Definition at line 52 of file sandesh_session.h.

const std::string SandeshWriter::sandesh_open_attr_length_
static
Initial value:

Definition at line 53 of file sandesh_session.h.

uint8_t* SandeshWriter::send_buf_
private

Definition at line 89 of file sandesh_session.h.

size_t SandeshWriter::send_buf_offset_
private

Definition at line 90 of file sandesh_session.h.

tbb::mutex SandeshWriter::send_mutex_
private

Definition at line 86 of file sandesh_session.h.

SandeshSession* SandeshWriter::session_
private

Definition at line 66 of file sandesh_session.h.


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