Software TSN Switch
A software switch to connect VMs and Containers to a TSN network
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Private Member Functions | List of all members
cnc::GclXmlBuilder Class Reference

Builds Gate Control List (GCL) XML payloads from CNC in-memory data structures. More...

#include <GclXmlBuilder.h>

Collaboration diagram for cnc::GclXmlBuilder:
Collaboration graph

Public Member Functions

 GclXmlBuilder ()=delete
 Constructor: Prevents instantiation of this utility class. Just tools.
 

Static Public Member Functions

static std::string buildXmlForNode (const CncNode_t &node)
 Builds XML configuration for the given CncNode_t's GCL. Function iterates over all Interfaces in CncNode_t and constructs the appropriate XML structure for the Gate Control List (GCL) if the interface has GCL data.
 
static std::string buildXmlForInterface (const ietfInterface_t &iface)
 Builds XML configuration for the given interface GCL. Function that builds the XML structure for the Gate Control List (GCL) for the given interface.
 

Static Private Member Functions

static void appendInterfaceXml (std::stringstream &ss, const ietfInterface_t &iface)
 Appends XML for a single interface's GCL configuration.
 
static void appendCycleTime (std::stringstream &ss, const RationalTime_t &time)
 Appends XML for cycle time.
 
static void appendControlList (std::stringstream &ss, const GclConfig_t &config)
 Appends the Gate Control List to Xml (AdminControlList)
 
static void appendPtpTime (std::stringstream &ss, PtpTime_t time, const std::string &tagName)
 Appends the ptpTime to the Xml.
 

Detailed Description

Builds Gate Control List (GCL) XML payloads from CNC in-memory data structures.

This utility class serializes TSN scheduling-related configuration from CncNode_t and nested interface/GCL types into the expected NETCONF/XML representation. It provides helper routines for composing cycle time, control-list entries, and PTP time fields used by bridge schedule configuration.

Constructor & Destructor Documentation

◆ GclXmlBuilder()

cnc::GclXmlBuilder::GclXmlBuilder ( )
delete

Constructor: Prevents instantiation of this utility class. Just tools.

Member Function Documentation

◆ appendControlList()

void cnc::GclXmlBuilder::appendControlList ( std::stringstream &  ss,
const GclConfig_t &  config 
)
staticprivate

Appends the Gate Control List to Xml (AdminControlList)

Parameters
ssThe stringstream to append the XML to.
configThe GCL holding all necessary information for node.

◆ appendCycleTime()

void cnc::GclXmlBuilder::appendCycleTime ( std::stringstream &  ss,
const RationalTime_t &  time 
)
staticprivate

Appends XML for cycle time.

Parameters
ssThe stringstream to append the XML to.
timeThe given cycle time in the GCL.

◆ appendInterfaceXml()

void cnc::GclXmlBuilder::appendInterfaceXml ( std::stringstream &  ss,
const ietfInterface_t &  iface 
)
staticprivate

Appends XML for a single interface's GCL configuration.

Parameters
ssThe stringstream to append the XML to.
ifaceThe ietfInterface_t containing GCL data.

◆ appendPtpTime()

void cnc::GclXmlBuilder::appendPtpTime ( std::stringstream &  ss,
PtpTime_t  time,
const std::string &  tagName 
)
staticprivate

Appends the ptpTime to the Xml.

Parameters
ssThe stringstream to append the XML to.
timeThe ptp time.
tagNameThe name of the tag to use.

◆ buildXmlForInterface()

std::string cnc::GclXmlBuilder::buildXmlForInterface ( const ietfInterface_t &  iface)
static

Builds XML configuration for the given interface GCL. Function that builds the XML structure for the Gate Control List (GCL) for the given interface.

Parameters
ifaceThe IetfInterface_t containing the GCL data.
Returns
A string containing the XML configuration.

◆ buildXmlForNode()

std::string cnc::GclXmlBuilder::buildXmlForNode ( const CncNode_t &  node)
static

Builds XML configuration for the given CncNode_t's GCL. Function iterates over all Interfaces in CncNode_t and constructs the appropriate XML structure for the Gate Control List (GCL) if the interface has GCL data.

Parameters
nodeThe CncNode_t containing GCL data.
Returns
A string containing the XML configuration.

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