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 15 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)
 Return the next chunk of 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 10 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 23 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 36 of file BufferedSerializeAction.h.

References oasys::SerializableObject::serialize().

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

Return the next chunk of buffer.

Returns:
R/W buffer of size length or NULL on error

Definition at line 60 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 37 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 43 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 49 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 61 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 65 of file BufferedSerializeAction.h.

Referenced by buf(), and next_slice().

size_t oasys::BufferedSerializeAction::length_ [private]

Length of the buffer.

Definition at line 66 of file BufferedSerializeAction.h.

Referenced by length(), and next_slice().

size_t oasys::BufferedSerializeAction::offset_ [private]

Offset into the buffer.

Definition at line 67 of file BufferedSerializeAction.h.

Referenced by next_slice(), and offset().


The documentation for this class was generated from the following files:
Generated on Fri Dec 22 14:48:06 2006 for DTN Reference Implementation by  doxygen 1.5.1