All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ndn::nfd::LocalControlHeader Class Reference

#include <nfd-local-control-header.hpp>

Data Structures

class  Error
 

Public Member Functions

 LocalControlHeader ()
 
 LocalControlHeader (const Block &wire, bool encodeIncomingFaceId=true, bool encodeNextHopFaceId=true)
 Create from wire encoding. More...
 
template<class U >
Block wireEncode (const U &payload, bool encodeIncomingFaceId, bool encodeNextHopFaceId) const
 Create wire encoding with options LocalControlHeader and the supplied item. More...
 
void wireDecode (const Block &wire, bool encodeIncomingFaceId=true, bool encodeNextHopFaceId=true)
 Decode from the wire format and set LocalControlHeader on the supplied item. More...
 
bool empty (bool encodeIncomingFaceId, bool encodeNextHopFaceId) const
 
bool hasIncomingFaceId () const
 
uint64_t getIncomingFaceId () const
 
void setIncomingFaceId (uint64_t incomingFaceId)
 
bool hasNextHopFaceId () const
 
uint64_t getNextHopFaceId () const
 
void setNextHopFaceId (uint64_t nextHopFaceId)
 

Static Public Member Functions

static const BlockgetPayload (const Block &wire)
 

Detailed Description

Definition at line 16 of file nfd-local-control-header.hpp.

Constructor & Destructor Documentation

ndn::nfd::LocalControlHeader::LocalControlHeader ( )
inline

Definition at line 29 of file nfd-local-control-header.hpp.

ndn::nfd::LocalControlHeader::LocalControlHeader ( const Block wire,
bool  encodeIncomingFaceId = true,
bool  encodeNextHopFaceId = true 
)
inlineexplicit

Create from wire encoding.

See Also
wireDecode

Definition at line 41 of file nfd-local-control-header.hpp.

Member Function Documentation

bool ndn::nfd::LocalControlHeader::empty ( bool  encodeIncomingFaceId,
bool  encodeNextHopFaceId 
) const
inline

Definition at line 90 of file nfd-local-control-header.hpp.

uint64_t ndn::nfd::LocalControlHeader::getIncomingFaceId ( ) const
inline

Definition at line 105 of file nfd-local-control-header.hpp.

uint64_t ndn::nfd::LocalControlHeader::getNextHopFaceId ( ) const
inline

Definition at line 125 of file nfd-local-control-header.hpp.

const Block & ndn::nfd::LocalControlHeader::getPayload ( const Block wire)
inlinestatic

Definition at line 228 of file nfd-local-control-header.hpp.

bool ndn::nfd::LocalControlHeader::hasIncomingFaceId ( ) const
inline

Definition at line 99 of file nfd-local-control-header.hpp.

bool ndn::nfd::LocalControlHeader::hasNextHopFaceId ( ) const
inline

Definition at line 119 of file nfd-local-control-header.hpp.

void ndn::nfd::LocalControlHeader::setIncomingFaceId ( uint64_t  incomingFaceId)
inline

Definition at line 111 of file nfd-local-control-header.hpp.

void ndn::nfd::LocalControlHeader::setNextHopFaceId ( uint64_t  nextHopFaceId)
inline

Definition at line 131 of file nfd-local-control-header.hpp.

void ndn::nfd::LocalControlHeader::wireDecode ( const Block wire,
bool  encodeIncomingFaceId = true,
bool  encodeNextHopFaceId = true 
)
inline

Decode from the wire format and set LocalControlHeader on the supplied item.

The supplied wire MUST contain LocalControlHeader. Determination whether the optional LocalControlHeader should be done before calling this method.

Definition at line 196 of file nfd-local-control-header.hpp.

template<class U >
Block ndn::nfd::LocalControlHeader::wireEncode ( const U &  payload,
bool  encodeIncomingFaceId,
bool  encodeNextHopFaceId 
) const
inline

Create wire encoding with options LocalControlHeader and the supplied item.

The caller is responsible of checking whether LocalControlHeader contains any information.

!It is an error to call this method if neither IncomingFaceId nor NextHopFaceId is set, or neither of them is enabled.

Exceptions
LocalControlHeader::Errorwhen empty LocalControlHeader be produced
Returns
Block, containing LocalControlHeader. Top-level length field of the returned LocalControlHeader includes payload length, but the memory block is independent of the payload's wire buffer. It is expected that both LocalControlHeader's and payload's wire will be send out together within a single send call.
See Also
http://redmine.named-data.net/projects/nfd/wiki/LocalControlHeader
Todo:
should this be BOOST_ASSERT instead? This is kind of unnecessary overhead

Definition at line 177 of file nfd-local-control-header.hpp.