ifw-core 7.0.0
 
Loading...
Searching...
No Matches
ifw::core::dit::did::Record Class Reference

Data Interface Dictionary keyword record class. More...

#include <record.hpp>

Public Member Functions

 Record ()
 
 Record (const std::string &name, const std::string &type, const std::string &comment, const std::string &description, const std::string &format="", const std::string &unit="")
 Set fields of the object from the keyword record contained in a string buffer.
 
 Record (const Record &source)
 
 ~Record ()
 
void Parse (const std::string &name, const std::string &type, const std::string &comment, const std::string &description, const std::string &format, const std::string &unit)
 Parse Parse/extract the fields of a keyword record from a Yaml object.
 
const std::string & GetName () const
 Return name of the keyword record.
 
const std::string & GetAltName () const
 Return name of the alternative keyword record (without the optional indeces).
 
ifw::core::dit::did::DataType GetDataType () const
 Return data type defined for the keyword.
 
const std::string & GetFormat () const
 Return the output format defined for the keyword.
 
template<class TYPE>
std::string Format (TYPE &value)
 Printf the given value according to the format specifier.
 
const std::string & GetUnit () const
 Return the unit, if defined for the key.
 
const std::string & GetComment () const
 Get the comment defined.
 
const std::string & GetDescription () const
 Get the description of the key.
 
const FormatSpecifierGetFormatSpecifier () const
 Return reference to the format specifier.
 
std::string ToString (const RecField fields=RecField::ALL, const bool compact=false) const
 Get string copy of one or more header fields.
 
Recordoperator= (const Record &source)
 Copy operator.
 

Static Public Member Functions

static std::string PrintRecords (std::vector< dit::did::Record > &records, const RecField fields=RecField::ALL)
 Decode the format in a DID record.
 

Protected Attributes

std::string m_field_name
 
std::string m_alt_field_name
 
std::string m_org_name
 
DataType m_field_type
 
std::string m_field_comment
 
std::string m_field_description
 
std::string m_field_format
 
FormatSpecifier m_format_specifier
 
std::string m_field_unit
 

Detailed Description

Data Interface Dictionary keyword record class.

Constructor & Destructor Documentation

◆ Record() [1/3]

ifw::core::dit::did::Record::Record ( )

◆ Record() [2/3]

ifw::core::dit::did::Record::Record ( const std::string & name,
const std::string & type,
const std::string & comment,
const std::string & description,
const std::string & format = "",
const std::string & unit = "" )

Set fields of the object from the keyword record contained in a string buffer.

Parameters
nameName of the key to process (unpack).

◆ Record() [3/3]

ifw::core::dit::did::Record::Record ( const Record & source)

◆ ~Record()

ifw::core::dit::did::Record::~Record ( )

Member Function Documentation

◆ Format()

template<class TYPE>
std::string ifw::core::dit::did::Record::Format ( TYPE & value)
inline

Printf the given value according to the format specifier.

◆ GetAltName()

const std::string & ifw::core::dit::did::Record::GetAltName ( ) const

Return name of the alternative keyword record (without the optional indeces).

◆ GetComment()

const std::string & ifw::core::dit::did::Record::GetComment ( ) const

Get the comment defined.

◆ GetDataType()

ifw::core::dit::did::DataType ifw::core::dit::did::Record::GetDataType ( ) const

Return data type defined for the keyword.

◆ GetDescription()

const std::string & ifw::core::dit::did::Record::GetDescription ( ) const

Get the description of the key.

◆ GetFormat()

const std::string & ifw::core::dit::did::Record::GetFormat ( ) const

Return the output format defined for the keyword.

◆ GetFormatSpecifier()

const FormatSpecifier & ifw::core::dit::did::Record::GetFormatSpecifier ( ) const

Return reference to the format specifier.

◆ GetName()

const std::string & ifw::core::dit::did::Record::GetName ( ) const

Return name of the keyword record.

◆ GetUnit()

const std::string & ifw::core::dit::did::Record::GetUnit ( ) const

Return the unit, if defined for the key.

◆ operator=()

Record & ifw::core::dit::did::Record::operator= ( const Record & source)

Copy operator.

◆ Parse()

void ifw::core::dit::did::Record::Parse ( const std::string & name,
const std::string & type,
const std::string & comment,
const std::string & description,
const std::string & format,
const std::string & unit )

Parse Parse/extract the fields of a keyword record from a Yaml object.

Parameters
key_nameName of key to process.
didDID Yaml object.

◆ PrintRecords()

std::string ifw::core::dit::did::Record::PrintRecords ( std::vector< dit::did::Record > & records,
const RecField fields = RecField::ALL )
static

Decode the format in a DID record.

Parameters
did_formatFormat as defined in the DID.
format_specifierFormat specifier object with the decoded properties.

Print (dump) records contained in the class in a string buffer.

◆ ToString()

std::string ifw::core::dit::did::Record::ToString ( const RecField fields = RecField::ALL,
const bool compact = false ) const

Get string copy of one or more header fields.

Parameters
fieldsKeyword record fields to return.
Returns
Buffer with fields, separated with newline if multiple requested.

Member Data Documentation

◆ m_alt_field_name

std::string ifw::core::dit::did::Record::m_alt_field_name
protected

◆ m_field_comment

std::string ifw::core::dit::did::Record::m_field_comment
protected

◆ m_field_description

std::string ifw::core::dit::did::Record::m_field_description
protected

◆ m_field_format

std::string ifw::core::dit::did::Record::m_field_format
protected

◆ m_field_name

std::string ifw::core::dit::did::Record::m_field_name
protected

◆ m_field_type

DataType ifw::core::dit::did::Record::m_field_type
protected

◆ m_field_unit

std::string ifw::core::dit::did::Record::m_field_unit
protected

◆ m_format_specifier

FormatSpecifier ifw::core::dit::did::Record::m_format_specifier
protected

◆ m_org_name

std::string ifw::core::dit::did::Record::m_org_name
protected

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