oasys::BufferedSerializeAction Class Reference

#include <BufferedSerializeAction.h>

Inheritance diagram for oasys::BufferedSerializeAction:

oasys::SerializeAction oasys::Serialize oasys::Marshal oasys::Unmarshal

List of all members.


Detailed Description

Common base class for Marshal and Unmarshal that manages the flat buffer.

Definition at line 31 of file BufferedSerializeAction.h.


Public Member Functions

 BufferedSerializeAction (action_t action, context_t context, u_char *buf, size_t length, int options=0)
 Constructor with a fixed-length buffer.
 BufferedSerializeAction (action_t action, context_t context, ExpandableBuffer *buf, int options=0)
 Constructor with an expandable buffer.
virtual void process (const char *name, SerializableObject *object)
 Since BufferedSerializeAction ignores the name field, calling process() on a contained object is the same as just calling the contained object's serialize() method.

Protected Member Functions

u_char * next_slice (size_t length)
 Get the next R/W length of the buffer.
u_char * buf ()
 
Returns:
buffer

size_t length ()
 
Returns:
buffer length

size_t offset ()
 
Returns:
offset into the buffer


Private Attributes

ExpandableBufferexpandable_buf_
 Expandable buffer.
u_char * buf_
 Buffer that is un/marshalled.
size_t length_
 Length of the buffer.
size_t offset_
 Offset into the buffer.

Constructor & Destructor Documentation

oasys::BufferedSerializeAction::BufferedSerializeAction ( action_t  action,
context_t  context,
u_char *  buf,
size_t  length,
int  options = 0 
)

Constructor with a fixed-length buffer.

Definition at line 26 of file BufferedSerializeAction.cc.

oasys::BufferedSerializeAction::BufferedSerializeAction ( action_t  action,
context_t  context,
ExpandableBuffer buf,
int  options = 0 
)

Constructor with an expandable buffer.

Definition at line 39 of file BufferedSerializeAction.cc.

References expandable_buf_, and oasys::ExpandableBuffer::set_len().


Member Function Documentation

virtual void oasys::BufferedSerializeAction::process ( const char *  name,
SerializableObject object 
) [inline, virtual]

Since BufferedSerializeAction ignores the name field, calling process() on a contained object is the same as just calling the contained object's serialize() method.

Reimplemented from oasys::SerializeAction.

Reimplemented in oasys::Marshal.

Definition at line 52 of file BufferedSerializeAction.h.

u_char * oasys::BufferedSerializeAction::next_slice ( size_t  length  )  [protected]

Get the next R/W length of the buffer.

Return the next chunk of buffer.

Returns:
R/W buffer of size length or NULL on error
If there was a previous error or if we're in fixed-length mode and the buffer isn't big enough, set the error_ flag and return NULL.

Definition at line 76 of file BufferedSerializeAction.cc.

References buf_, oasys::SerializeAction::error(), expandable_buf_, oasys::ExpandableBuffer::incr_len(), length_, offset_, oasys::SerializeAction::signal_error(), and oasys::ExpandableBuffer::tail_buf().

Referenced by oasys::Unmarshal::process(), and oasys::Marshal::process().

u_char * oasys::BufferedSerializeAction::buf (  )  [protected]

Returns:
buffer

Definition at line 53 of file BufferedSerializeAction.cc.

References buf_, expandable_buf_, and oasys::ExpandableBuffer::raw_buf().

Referenced by oasys::Unmarshal::begin_action(), oasys::Marshal::end_action(), oasys::Unmarshal::process(), and oasys::Marshal::process().

size_t oasys::BufferedSerializeAction::length (  )  [protected]

Returns:
buffer length

Definition at line 59 of file BufferedSerializeAction.cc.

References oasys::ExpandableBuffer::buf_len(), expandable_buf_, and length_.

Referenced by oasys::Unmarshal::begin_action(), and oasys::Unmarshal::process().

size_t oasys::BufferedSerializeAction::offset (  )  [protected]

Returns:
offset into the buffer

Definition at line 65 of file BufferedSerializeAction.cc.

References expandable_buf_, oasys::ExpandableBuffer::len(), and offset_.

Referenced by oasys::Marshal::end_action(), and oasys::Unmarshal::process().


Member Data Documentation

ExpandableBuffer* oasys::BufferedSerializeAction::expandable_buf_ [private]

Expandable buffer.

Definition at line 77 of file BufferedSerializeAction.h.

Referenced by buf(), BufferedSerializeAction(), length(), next_slice(), and offset().

u_char* oasys::BufferedSerializeAction::buf_ [private]

Buffer that is un/marshalled.

Definition at line 81 of file BufferedSerializeAction.h.

Referenced by buf(), and next_slice().

size_t oasys::BufferedSerializeAction::length_ [private]

Length of the buffer.

Definition at line 82 of file BufferedSerializeAction.h.

Referenced by length(), and next_slice().

size_t oasys::BufferedSerializeAction::offset_ [private]

Offset into the buffer.

Definition at line 83 of file BufferedSerializeAction.h.

Referenced by next_slice(), and offset().


The documentation for this class was generated from the following files:
Generated on Sat Sep 8 08:36:24 2007 for DTN Reference Implementation by  doxygen 1.5.3