dtn::BlockInfo Class Reference

Class used to store unparsed bundle blocks and associated metadata about them. More...

#include <BlockInfo.h>

List of all members.

Public Types

enum  list_owner_t {
  LIST_NONE = 0x00, LIST_RECEIVED = 0x01, LIST_API = 0x02, LIST_EXT = 0x03,
  LIST_XMIT = 0x04
}
 List owner indicator (not transmitted). More...
typedef oasys::ScratchBuffer
< u_char *, 64 > 
DataBuffer
 To store the formatted block data, we use a scratch buffer with 64 bytes of static buffer space which should be sufficient to cover most blocks and avoid mallocs.

Public Member Functions

 BlockInfo (BlockProcessor *owner, const BlockInfo *source=NULL)
 Default constructor assigns the owner and optionally the BlockInfo source (i.e.
 BlockInfo (oasys::Builder &builder)
 Constructor for unserializing.
 BlockInfo (const BlockInfo &bi)
 Copy constructor to increment refcount for locals_.
virtual ~BlockInfo ()
 Virtual destructor.
virtual void serialize (oasys::SerializeAction *action)
 Virtual from SerializableObject.
BlockProcessorowner () const
 Accessors.
const BlockInfosource () const
 Accessors.
const EndpointIDVectoreid_list () const
 Accessors.
const DataBuffercontents () const
 Accessors.
BP_Locallocals () const
 Accessors.
u_int32_t data_length () const
 Accessors.
u_int32_t data_offset () const
 Accessors.
u_int32_t full_length () const
 Accessors.
u_char * data () const
 Accessors.
bool complete () const
 Accessors.
bool reloaded () const
 Accessors.
bool last_block () const
 Accessors.
void set_owner (BlockProcessor *o)
 Mutating accessors.
void set_eid_list (const EndpointIDVector &l)
 Mutating accessors.
void set_complete (bool t)
 Mutating accessors.
void set_data_length (u_int32_t l)
 Mutating accessors.
void set_data_offset (u_int32_t o)
 Mutating accessors.
DataBufferwritable_contents ()
 Mutating accessors.
void set_locals (BP_Local *l)
 Mutating accessors.
void add_eid (EndpointID e)
 Mutating accessors.
void set_reloaded (bool t)
 Mutating accessors.
int type () const
u_int64_t flags () const
void set_flag (u_int64_t flag)

Protected Attributes

BlockProcessorowner_
 Owner of this block.
u_int16_t owner_type_
 Extracted from owner.
const BlockInfosource_
 Owner of this block.
EndpointIDVector eid_list_
 List of EIDs used in this block.
DataBuffer contents_
 Block contents with length set to the amount currently in the buffer.
BP_LocalRef locals_
 Local variable storage for block processor.
u_int32_t data_length_
 Length of the block data (w/o preamble).
u_int32_t data_offset_
 Offset of first byte of the block data.
bool complete_
 Whether or not this block is complete.
bool reloaded_
 Whether or not this block is reloaded from store (set in reload_post_process of the BlockProcessor classes).


Detailed Description

Class used to store unparsed bundle blocks and associated metadata about them.

Definition at line 38 of file BlockInfo.h.


Member Typedef Documentation

typedef oasys::ScratchBuffer<u_char*, 64> dtn::BlockInfo::DataBuffer

To store the formatted block data, we use a scratch buffer with 64 bytes of static buffer space which should be sufficient to cover most blocks and avoid mallocs.

Definition at line 43 of file BlockInfo.h.


Member Enumeration Documentation

List owner indicator (not transmitted).

Enumerator:
LIST_NONE 
LIST_RECEIVED 
LIST_API 
LIST_EXT 
LIST_XMIT 

Definition at line 63 of file BlockInfo.h.


Constructor & Destructor Documentation

dtn::BlockInfo::BlockInfo ( BlockProcessor owner,
const BlockInfo source = NULL 
)

Default constructor assigns the owner and optionally the BlockInfo source (i.e.

the block as it arrived off the wire)

Definition at line 31 of file BlockInfo.cc.

References eid_list_.

dtn::BlockInfo::BlockInfo ( oasys::Builder &  builder  ) 

Constructor for unserializing.

Definition at line 48 of file BlockInfo.cc.

dtn::BlockInfo::BlockInfo ( const BlockInfo bi  ) 

Copy constructor to increment refcount for locals_.

Definition at line 65 of file BlockInfo.cc.

dtn::BlockInfo::~BlockInfo (  )  [virtual]

Virtual destructor.

Definition at line 81 of file BlockInfo.cc.


Member Function Documentation

void dtn::BlockInfo::add_eid ( EndpointID  e  )  [inline]

Mutating accessors.

Definition at line 96 of file BlockInfo.h.

References eid_list_.

Referenced by dtn::SessionBlockProcessor::generate(), and dtn::SequenceIDBlockProcessor::generate().

bool dtn::BlockInfo::complete (  )  const [inline]

const DataBuffer& dtn::BlockInfo::contents (  )  const [inline]

u_char* dtn::BlockInfo::data (  )  const [inline]

u_int32_t dtn::BlockInfo::data_length (  )  const [inline]

u_int32_t dtn::BlockInfo::data_offset (  )  const [inline]

const EndpointIDVector& dtn::BlockInfo::eid_list (  )  const [inline]

u_int64_t dtn::BlockInfo::flags (  )  const

u_int32_t dtn::BlockInfo::full_length (  )  const [inline]

bool dtn::BlockInfo::last_block (  )  const

BP_Local* dtn::BlockInfo::locals (  )  const [inline]

BlockProcessor* dtn::BlockInfo::owner (  )  const [inline]

bool dtn::BlockInfo::reloaded (  )  const [inline]

Accessors.

Definition at line 84 of file BlockInfo.h.

References reloaded_.

void dtn::BlockInfo::serialize ( oasys::SerializeAction *  action  )  [virtual]

void dtn::BlockInfo::set_complete ( bool  t  )  [inline]

Mutating accessors.

Definition at line 91 of file BlockInfo.h.

References complete_.

Referenced by dtn::PayloadBlockProcessor::consume(), and dtn::BlockProcessor::consume().

void dtn::BlockInfo::set_data_length ( u_int32_t  l  )  [inline]

void dtn::BlockInfo::set_data_offset ( u_int32_t  o  )  [inline]

Mutating accessors.

Definition at line 93 of file BlockInfo.h.

References data_offset_.

Referenced by dtn::BlockProcessor::consume_preamble(), and dtn::BlockProcessor::generate_preamble().

void dtn::BlockInfo::set_eid_list ( const EndpointIDVector l  )  [inline]

Mutating accessors.

Definition at line 90 of file BlockInfo.h.

References eid_list_.

Referenced by dtn::BlockProcessor::consume_preamble(), and dtn::UnknownBlockProcessor::generate().

void dtn::BlockInfo::set_flag ( u_int64_t  flag  ) 

These accessors need special case processing since the primary block doesn't have the fields in the same place.

Definition at line 133 of file BlockInfo.cc.

References ASSERT, contents_, encode(), and encoding_len().

void dtn::BlockInfo::set_locals ( BP_Local l  ) 

Mutating accessors.

Definition at line 87 of file BlockInfo.cc.

References locals_.

Referenced by dtn::MetadataBlockProcessor::parse_metadata().

void dtn::BlockInfo::set_owner ( BlockProcessor o  )  [inline]

Mutating accessors.

Definition at line 89 of file BlockInfo.h.

References owner_.

void dtn::BlockInfo::set_reloaded ( bool  t  )  [inline]

Mutating accessors.

Definition at line 97 of file BlockInfo.h.

References reloaded_.

Referenced by dtn::BlockProcessor::reload_post_process().

const BlockInfo* dtn::BlockInfo::source (  )  const [inline]

int dtn::BlockInfo::type (  )  const

DataBuffer* dtn::BlockInfo::writable_contents (  )  [inline]


Member Data Documentation

Whether or not this block is complete.

Definition at line 120 of file BlockInfo.h.

Referenced by complete(), serialize(), and set_complete().

Block contents with length set to the amount currently in the buffer.

Definition at line 115 of file BlockInfo.h.

Referenced by contents(), data(), flags(), last_block(), serialize(), set_flag(), type(), and writable_contents().

u_int32_t dtn::BlockInfo::data_length_ [protected]

Length of the block data (w/o preamble).

Definition at line 118 of file BlockInfo.h.

Referenced by data_length(), full_length(), serialize(), and set_data_length().

u_int32_t dtn::BlockInfo::data_offset_ [protected]

Offset of first byte of the block data.

Definition at line 119 of file BlockInfo.h.

Referenced by data(), data_offset(), full_length(), serialize(), and set_data_offset().

List of EIDs used in this block.

Definition at line 114 of file BlockInfo.h.

Referenced by add_eid(), BlockInfo(), eid_list(), serialize(), and set_eid_list().

Local variable storage for block processor.

Definition at line 117 of file BlockInfo.h.

Referenced by locals(), and set_locals().

Owner of this block.

Definition at line 111 of file BlockInfo.h.

Referenced by owner(), serialize(), set_owner(), and type().

u_int16_t dtn::BlockInfo::owner_type_ [protected]

Extracted from owner.

Definition at line 112 of file BlockInfo.h.

Referenced by serialize().

Whether or not this block is reloaded from store (set in reload_post_process of the BlockProcessor classes).

Definition at line 121 of file BlockInfo.h.

Referenced by reloaded(), and set_reloaded().

const BlockInfo* dtn::BlockInfo::source_ [protected]

Owner of this block.

Definition at line 113 of file BlockInfo.h.

Referenced by source().


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

Generated on Fri Jan 30 09:43:12 2009 for DTN Reference Implementation by  doxygen 1.5.8