Public Member Functions | Static Public Member Functions | Friends | List of all members
ndn::DataLite Class Reference

A DataLite holds a NameLite and other fields to represent an NDN Data packet. More...

#include <data-lite.hpp>

Inheritance diagram for ndn::DataLite:
ndn_Data

Public Member Functions

 DataLite (ndn_NameComponent *nameComponents, size_t maxNameComponents, ndn_NameComponent *keyNameComponents, size_t maxKeyNameComponents)
 Create a DataLite with the pre-allocated nameComponents and keyNameComponents, and defaults for all the values. More...
 
const SignatureLite & getSignature () const
 
SignatureLite & getSignature ()
 
const NameLite & getName () const
 
NameLite & getName ()
 
const MetaInfoLite & getMetaInfo () const
 
MetaInfoLite & getMetaInfo ()
 
const BlobLite & getContent () const
 
ndn_Error setName (const NameLite &name)
 Set this data packet's name to have the values from the given name. More...
 
DataLite & setContent (const BlobLite &content)
 Set this data packet's content. More...
 
ndn_Error set (const DataLite &other)
 Set this data packet object to have the values from the other data. More...
 

Static Public Member Functions

static DataLite & downCast (ndn_Data &data)
 Downcast the reference to the ndn_Data struct to a DataLite. More...
 
static const DataLite & downCast (const ndn_Data &data)
 

Friends

class Tlv0_1_1WireFormatLite
 

Detailed Description

A DataLite holds a NameLite and other fields to represent an NDN Data packet.

Constructor & Destructor Documentation

ndn::DataLite::DataLite ( ndn_NameComponent *  nameComponents,
size_t  maxNameComponents,
ndn_NameComponent *  keyNameComponents,
size_t  maxKeyNameComponents 
)

Create a DataLite with the pre-allocated nameComponents and keyNameComponents, and defaults for all the values.

Parameters
nameComponentsThe pre-allocated array of ndn_NameComponent. Instead of an array of NameLite::Component, this is an array of the underlying ndn_NameComponent struct so that it doesn't run the default constructor unnecessarily.
maxNameComponentsThe number of elements in the allocated nameComponents array.
keyNameComponentsThe pre-allocated array of ndn_NameComponent for the signature.keyLocator. Instead of an array of NameLite::Component, this is an array of the underlying ndn_NameComponent struct so that it doesn't run the default constructor unnecessarily.
maxKeyNameComponentsThe number of elements in the allocated keyNameComponents array.

Member Function Documentation

static DataLite& ndn::DataLite::downCast ( ndn_Data &  data)
inlinestatic

Downcast the reference to the ndn_Data struct to a DataLite.

Parameters
dataA reference to the ndn_Data struct.
Returns
The same reference as DataLite.
ndn_Error ndn::DataLite::set ( const DataLite &  other)

Set this data packet object to have the values from the other data.

Parameters
otherThe other DataLite to get values from.
Returns
0 for success, or an error code if there is not enough room in this object's name or key locator keyName components array.
DataLite& ndn::DataLite::setContent ( const BlobLite &  content)
inline

Set this data packet's content.

Parameters
contentThe data packet's content. This does not copy the bytes of the content.
Returns
This DataLite so that you can chain calls to update values.
ndn_Error ndn::DataLite::setName ( const NameLite &  name)
inline

Set this data packet's name to have the values from the given name.

Parameters
nameThe name to get values from.
Returns
0 for success, or an error code if there is not enough room in this object's name components array.

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