PcapPlusPlus  Next
pcpp::FieldDescriptor Struct Reference

#include <Serializers.h>

Inheritance diagram for pcpp::FieldDescriptor:
pcpp::ObjectFieldDescriptor< TimestampObject > pcpp::ObjectFieldDescriptor< Derived > pcpp::Packet::SerializedFields::TimestampObject

Public Member Functions

 FieldDescriptor (uint16_t fieldId, std::string fieldName, std::vector< FieldDescriptor >(*fieldChildren)()=nullptr)
 
bool hasChildren () const
 

Public Attributes

const uint16_t id
 Stable numeric identifier of the field.
 
const std::string name
 Name of the field.
 
std::vector< FieldDescriptor >(*const getChildren )()
 Function returning the descriptors of the field's children, or nullptr if the field has no children.
 

Detailed Description

Describes a serializable field.

Constructor & Destructor Documentation

◆ FieldDescriptor()

pcpp::FieldDescriptor::FieldDescriptor ( uint16_t  fieldId,
std::string  fieldName,
std::vector< FieldDescriptor >(*)()  fieldChildren = nullptr 
)
inline

Create a field descriptor.

Parameters
[in]fieldIdThe stable numeric identifier of the field
[in]fieldNameThe name of the field
[in]fieldChildrenA function returning the field's child descriptors, or nullptr if the field has no children

Member Function Documentation

◆ hasChildren()

bool pcpp::FieldDescriptor::hasChildren ( ) const
inline

Check whether the field has child fields.

Returns
True if the field has child fields, false otherwise