Public Member Functions | Protected Member Functions | List of all members
ndn::DerNode::DerStructure Class Reference

A DerStructure extends DerNode to hold other DerNodes. More...

#include <der-node.hpp>

Inheritance diagram for ndn::DerNode::DerStructure:
ndn::DerNode ndn::DerNode::DerSequence

Public Member Functions

virtual size_t getSize ()
 Override to get the total length of the encoding, including children. More...
 
virtual const std::vector< ptr_lib::shared_ptr< DerNode > > & getChildren ()
 Get the children of this node. More...
 
void addChild (const ptr_lib::shared_ptr< DerNode > &node, bool notifyParent=false)
 
virtual Blob encode ()
 Override the base encode to return raw data encoding for this node and its children. More...
 
- Public Member Functions inherited from ndn::DerNode
virtual Blob toVal ()
 Convert the encoded data to a standard representation. More...
 
Blob getPayload ()
 Get a copy of the payload bytes. More...
 

Protected Member Functions

 DerStructure (DerNodeType nodeType)
 Create a DerStructure with the given nodeType. More...
 
virtual void decode (const uint8_t *inputBuf, size_t startIdx)
 Override the base decode to decode and store the data from an input buffer. More...
 
- Protected Member Functions inherited from ndn::DerNode
 DerNode (DerNodeType nodeType)
 Create a generic DER node with the given nodeType. More...
 
void encodeHeader (size_t size)
 Encode the given size and update the header. More...
 
size_t decodeHeader (const uint8_t *inputBuf, size_t startIdx)
 Extract the header from an input buffer and return the size. More...
 
void payloadAppend (const uint8_t *value, size_t valueLength)
 Call payload_.copy to copy value into payload_ at payloadPosition_. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ndn::DerNode
static ptr_lib::shared_ptr< DerNodeparse (const uint8_t *inputBuf, size_t startIdx=0)
 Parse the data from the input buffer recursively and return the root as an object of a subclass of DerNode. More...
 
static DerNode::DerSequencegetSequence (const std::vector< ptr_lib::shared_ptr< DerNode > > &children, size_t index)
 Check that index is in bounds for the children list, cast children[index] to DerSequence and return it. More...
 
- Protected Attributes inherited from ndn::DerNode
DerStructureparent_
 
DerNodeType nodeType_
 
std::vector< uint8_t > header_
 
DynamicUInt8Vector payload_
 
size_t payloadPosition_
 

Detailed Description

A DerStructure extends DerNode to hold other DerNodes.

Constructor & Destructor Documentation

Create a DerStructure with the given nodeType.

This is a protected constructor. To create an object, use DerSequence.

Parameters
nodeTypeThe DER node type.

Member Function Documentation

void ndn::DerNode::DerStructure::decode ( const uint8_t *  inputBuf,
size_t  startIdx 
)
protectedvirtual

Override the base decode to decode and store the data from an input buffer.

Recursively populates child nodes.

Parameters
inputBufThe input buffer to read from. This reads from startIdx.
startIdxThe offset into the buffer.

Reimplemented from ndn::DerNode.

Blob ndn::DerNode::DerStructure::encode ( )
virtual

Override the base encode to return raw data encoding for this node and its children.

Returns
The raw data encoding.

Reimplemented from ndn::DerNode.

const std::vector< ptr_lib::shared_ptr< DerNode > > & ndn::DerNode::DerStructure::getChildren ( )
virtual

Get the children of this node.

Returns
The children as an array of shared_ptr<DerNode>.

Reimplemented from ndn::DerNode.

size_t ndn::DerNode::DerStructure::getSize ( )
virtual

Override to get the total length of the encoding, including children.

Returns
The total (header + payload) length.

Reimplemented from ndn::DerNode.


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