dtn::MetadataBlock Class Reference

The representation of a metadata extension block. More...

#include <MetadataBlock.h>

Inheritance diagram for dtn::MetadataBlock:
dtn::BP_Local

List of all members.

Classes

class  OutgoingMetadata

Public Member Functions

 MetadataBlock ()
 MetadataBlock (BlockInfo *block)
 MetadataBlock (u_int64_t type, u_char *buf, u_int32_t len)
 MetadataBlock (unsigned int source_id, u_int64_t type, u_char *buf, u_int32_t len)
 MetadataBlock (oasys::Builder &builder)
 MetadataBlock (const MetadataBlock &copy)
 ~MetadataBlock ()
unsigned int id () const
bool generated () const
bool error () const
unsigned int source_id () const
bool source () const
u_int64_t flags () const
u_int64_t ontology () const
u_char * metadata () const
u_int32_t metadata_len () const
oasys::Lock * lock ()
void set_flags (u_int64_t flags)
void set_block_error ()
void set_ontology (u_int64_t ontology)
void set_metadata (u_char *buf, u_int32_t len)
bool remove_outgoing_metadata (const LinkRef &link)
 Mark the metadata block for removal from the bundle on the specified outgoing link.
bool modify_outgoing_metadata (const LinkRef &link, u_char *buf, u_int32_t len)
 Modify the metadata block for the specified outgoing link.
bool metadata_removed (const LinkRef &link)
bool metadata_modified (const LinkRef &link)
bool metadata_modified (const LinkRef &link, u_char **buf, u_int32_t &len)
void delete_outgoing_metadata (const LinkRef &link)
 Remove any outgoing metadata state for the specified link.
virtual void serialize (oasys::SerializeAction *action)
 Virtual from SerializableObject.
void operator= (const MetadataBlock &copy)

Static Public Member Functions

static unsigned int get_next_index ()

Private Member Functions

OutgoingMetadatafind_outgoing_metadata (const LinkRef &link)
bool has_outgoing_metadata (const LinkRef &link)

Private Attributes

oasys::Mutex lock_
unsigned int id_
 unique identifier
BlockInfoblock_
 corresponding BlockInfo
bool generated_
 flag that indicates if the metadata was locally generated, and therefore memory allocated to the ontology buf
bool error_
 flag that indicates if the metadata block was received with errors
unsigned int source_id_
bool source_
u_int64_t flags_
u_int64_t ontology_
u_char * metadata_
u_int32_t metadata_len_
std::vector< OutgoingMetadataoutgoing_metadata_

Static Private Attributes

static unsigned int index_ = 0

Detailed Description

The representation of a metadata extension block.

Definition at line 35 of file MetadataBlock.h.


Constructor & Destructor Documentation

dtn::MetadataBlock::MetadataBlock (  )  [inline]

Definition at line 39 of file MetadataBlock.h.

dtn::MetadataBlock::MetadataBlock ( BlockInfo block  )  [inline]

Definition at line 45 of file MetadataBlock.h.

dtn::MetadataBlock::MetadataBlock ( u_int64_t  type,
u_char *  buf,
u_int32_t  len 
)

Definition at line 36 of file MetadataBlock.cc.

References ASSERT, metadata_, and metadata_len_.

dtn::MetadataBlock::MetadataBlock ( unsigned int  source_id,
u_int64_t  type,
u_char *  buf,
u_int32_t  len 
)

Definition at line 51 of file MetadataBlock.cc.

References ASSERT, metadata_, and metadata_len_.

dtn::MetadataBlock::MetadataBlock ( oasys::Builder &  builder  )  [inline]

Definition at line 56 of file MetadataBlock.h.

dtn::MetadataBlock::MetadataBlock ( const MetadataBlock copy  ) 

Definition at line 67 of file MetadataBlock.cc.

References ASSERT, generated_, metadata_, and metadata_len_.

dtn::MetadataBlock::~MetadataBlock (  ) 

Definition at line 89 of file MetadataBlock.cc.

References generated_, metadata_, metadata_len_, and outgoing_metadata_.


Member Function Documentation

void dtn::MetadataBlock::delete_outgoing_metadata ( const LinkRef link  ) 

Remove any outgoing metadata state for the specified link.

Definition at line 196 of file MetadataBlock.cc.

References outgoing_metadata_.

bool dtn::MetadataBlock::error (  )  const [inline]

Definition at line 71 of file MetadataBlock.h.

References error_.

MetadataBlock::OutgoingMetadata * dtn::MetadataBlock::find_outgoing_metadata ( const LinkRef link  )  [private]

Definition at line 242 of file MetadataBlock.cc.

References outgoing_metadata_.

Referenced by has_outgoing_metadata(), metadata_modified(), and metadata_removed().

u_int64_t dtn::MetadataBlock::flags (  )  const [inline]

Definition at line 74 of file MetadataBlock.h.

References flags_.

bool dtn::MetadataBlock::generated (  )  const [inline]

Definition at line 70 of file MetadataBlock.h.

References generated_.

static unsigned int dtn::MetadataBlock::get_next_index (  )  [inline, static]

Definition at line 134 of file MetadataBlock.h.

References index_.

bool dtn::MetadataBlock::has_outgoing_metadata ( const LinkRef link  )  [inline, private]

Definition at line 191 of file MetadataBlock.h.

References find_outgoing_metadata().

Referenced by modify_outgoing_metadata(), and remove_outgoing_metadata().

unsigned int dtn::MetadataBlock::id (  )  const [inline]

Definition at line 69 of file MetadataBlock.h.

References id_.

oasys::Lock* dtn::MetadataBlock::lock (  )  [inline]

Definition at line 79 of file MetadataBlock.h.

References lock_.

u_char* dtn::MetadataBlock::metadata (  )  const [inline]

Definition at line 76 of file MetadataBlock.h.

References metadata_.

Referenced by metadata_modified(), and metadata_removed().

u_int32_t dtn::MetadataBlock::metadata_len (  )  const [inline]

Definition at line 77 of file MetadataBlock.h.

References metadata_len_.

bool dtn::MetadataBlock::metadata_modified ( const LinkRef link,
u_char **  buf,
u_int32_t &  len 
)
Returns:
true if the metadata block is modified for the specified outgoing link; otherwise false. The modified ontology data and length are returned if the metadata block was modified.

Definition at line 181 of file MetadataBlock.cc.

References find_outgoing_metadata(), dtn::MetadataBlock::OutgoingMetadata::metadata(), dtn::MetadataBlock::OutgoingMetadata::metadata_len(), and dtn::MetadataBlock::OutgoingMetadata::remove().

bool dtn::MetadataBlock::metadata_modified ( const LinkRef link  ) 
Returns:
true if the metadata block is modified for the specified outgoing link; otherwise false.

Definition at line 170 of file MetadataBlock.cc.

References find_outgoing_metadata(), metadata(), and dtn::MetadataBlock::OutgoingMetadata::remove().

bool dtn::MetadataBlock::metadata_removed ( const LinkRef link  ) 
Returns:
true if the metadata block is marked for removal from from the bundle on the specified outgoing link; otherwise false.

Definition at line 158 of file MetadataBlock.cc.

References find_outgoing_metadata(), metadata(), and dtn::MetadataBlock::OutgoingMetadata::remove().

bool dtn::MetadataBlock::modify_outgoing_metadata ( const LinkRef link,
u_char *  buf,
u_int32_t  len 
)

Modify the metadata block for the specified outgoing link.

Returns:
true if the metadata block was successfully modified; otherwise false.

Definition at line 141 of file MetadataBlock.cc.

References has_outgoing_metadata(), dtn::log, log_err_p, and outgoing_metadata_.

u_int64_t dtn::MetadataBlock::ontology (  )  const [inline]

Definition at line 75 of file MetadataBlock.h.

References ontology_.

void dtn::MetadataBlock::operator= ( const MetadataBlock copy  ) 
bool dtn::MetadataBlock::remove_outgoing_metadata ( const LinkRef link  ) 

Mark the metadata block for removal from the bundle on the specified outgoing link.

Returns:
true if the metadata block was successfully marked for removal; otherwise false.

Definition at line 125 of file MetadataBlock.cc.

References has_outgoing_metadata(), dtn::log, log_err_p, and outgoing_metadata_.

virtual void dtn::MetadataBlock::serialize ( oasys::SerializeAction *  action  )  [inline, virtual]

Virtual from SerializableObject.

Definition at line 130 of file MetadataBlock.h.

void dtn::MetadataBlock::set_block_error (  )  [inline]

Definition at line 83 of file MetadataBlock.h.

References error_.

void dtn::MetadataBlock::set_flags ( u_int64_t  flags  ) 

Definition at line 101 of file MetadataBlock.cc.

References ASSERT, flags_, and generated_.

Referenced by dtn::APIClient::handle_send().

void dtn::MetadataBlock::set_metadata ( u_char *  buf,
u_int32_t  len 
)

Definition at line 109 of file MetadataBlock.cc.

References ASSERT, generated_, metadata_, and metadata_len_.

void dtn::MetadataBlock::set_ontology ( u_int64_t  ontology  )  [inline]

Definition at line 84 of file MetadataBlock.h.

References ontology_.

bool dtn::MetadataBlock::source (  )  const [inline]

Definition at line 73 of file MetadataBlock.h.

References source_.

unsigned int dtn::MetadataBlock::source_id (  )  const [inline]

Definition at line 72 of file MetadataBlock.h.

References source_id_.


Member Data Documentation

corresponding BlockInfo

Definition at line 140 of file MetadataBlock.h.

Referenced by operator=().

flag that indicates if the metadata block was received with errors

Definition at line 146 of file MetadataBlock.h.

Referenced by error(), operator=(), and set_block_error().

u_int64_t dtn::MetadataBlock::flags_ [private]

Definition at line 154 of file MetadataBlock.h.

Referenced by flags(), and set_flags().

flag that indicates if the metadata was locally generated, and therefore memory allocated to the ontology buf

Definition at line 142 of file MetadataBlock.h.

Referenced by generated(), MetadataBlock(), operator=(), set_flags(), set_metadata(), and ~MetadataBlock().

unsigned int dtn::MetadataBlock::id_ [private]

unique identifier

Definition at line 139 of file MetadataBlock.h.

Referenced by id(), and operator=().

unsigned int dtn::MetadataBlock::index_ = 0 [static, private]

Definition at line 194 of file MetadataBlock.h.

Referenced by get_next_index().

oasys::Mutex dtn::MetadataBlock::lock_ [private]

Definition at line 137 of file MetadataBlock.h.

Referenced by lock().

u_char* dtn::MetadataBlock::metadata_ [private]

Definition at line 158 of file MetadataBlock.h.

Referenced by metadata(), MetadataBlock(), operator=(), set_metadata(), and ~MetadataBlock().

u_int32_t dtn::MetadataBlock::metadata_len_ [private]

Definition at line 159 of file MetadataBlock.h.

Referenced by metadata_len(), MetadataBlock(), operator=(), set_metadata(), and ~MetadataBlock().

u_int64_t dtn::MetadataBlock::ontology_ [private]

Definition at line 157 of file MetadataBlock.h.

Referenced by ontology(), operator=(), and set_ontology().

Definition at line 150 of file MetadataBlock.h.

Referenced by source().

unsigned int dtn::MetadataBlock::source_id_ [private]

Definition at line 149 of file MetadataBlock.h.

Referenced by source_id().


The documentation for this class was generated from the following files:
Generated on Sun Nov 21 13:21:13 2010 for DTN Reference Implementation by  doxygen 1.6.3