LibLogicalAccess
2.5.0
An Open Source RFID Library
|
A value data field base class. More...
#include <valuedatafield.hpp>
Public Member Functions | |
ValueDataField () | |
Constructor. | |
virtual | ~ValueDataField () |
Destructor. | |
DataFieldType | getDFType () const override |
Get the field type. | |
virtual void | setDataLength (unsigned int length) |
Set data length in bits. | |
std::shared_ptr< DataRepresentation > | getDataRepresentation () const |
Get the Data Representation for the field. | |
void | setDataRepresentation (std::shared_ptr< DataRepresentation > &encoding) |
Set the Data Representation for the field. | |
std::shared_ptr< DataType > | getDataType () const |
Get the Data Type for the field. | |
void | setDataType (const std::shared_ptr< DataType > &encoding) |
Set the Data Type for the field. | |
void | setIsFixedField (bool isFixed) |
Set if the field is a fixed field. | |
bool | getIsFixedField () const |
Get if the field is a fixed field. | |
void | setIsIdentifier (bool isIdentifier) |
Set if the field is used as identifier. | |
bool | getIsIdentifier () const |
Get if the field is used as identifier. | |
void | convertNumericData (BitsetStream &data, unsigned long long field, unsigned int fieldlen) const |
Convert a numeric data into the configured DataRepresentation and DataType. | |
void | convertBinaryData (const BitsetStream &data, unsigned int fieldlen, BitsetStream &convertedData) const |
Convert a binary data into the configured DataRepresentation. | |
unsigned long long | revertNumericData (const BitsetStream &data, unsigned int pos, unsigned int fieldlen) const |
Revert a numeric data using the configured DataRepresentation and DataType. | |
BitsetStream | revertBinaryData (const BitsetStream &data, unsigned int pos, unsigned int fieldlen) const |
Revert a binary data using the configured DataRepresentation. | |
void | serialize (boost::property_tree::ptree &parentNode) override |
Serialize the current object to XML. | |
void | unSerialize (boost::property_tree::ptree &node) override |
UnSerialize a XML node to the current object. | |
![]() | |
DataField () | |
Constructor. | |
virtual | ~DataField () |
Destructor. | |
virtual unsigned int | getDataLength () const |
Get data length in bits. | |
virtual void | setPosition (unsigned int position) |
Set the field position in bits. | |
unsigned int | getPosition () const |
Get the field position in bits. | |
virtual DataFieldType | getDFType () const =0 |
Get the field type. | |
void | setName (const std::string &name) |
Set the field name. | |
std::string | getName () const |
Get the field name. | |
virtual BitsetStream | getLinearData (const BitsetStream &data) const =0 |
Get linear data. | |
virtual void | setLinearData (const ByteVector &data)=0 |
Set linear data. | |
virtual bool | checkSkeleton (std::shared_ptr< DataField > field) const =0 |
Check the current field skeleton with another field. | |
void | serialize (boost::property_tree::ptree &parentNode) override |
Serialize the current object to XML. | |
void | unSerialize (boost::property_tree::ptree &node) override |
UnSerialize a XML node to the current object. | |
![]() | |
virtual | ~XmlSerializable ()=default |
virtual std::string | serialize () |
Serialize object to Xml Node string. | |
virtual std::string | serializeWithHeaders () |
Serialize object to Xml Node string, with xml headers. | |
virtual void | serialize (boost::property_tree::ptree &parentNode)=0 |
Serialize object to Xml Node. | |
virtual void | serializeToFile (const std::string &filename) |
Serialize object to a Xml file. | |
virtual void | unSerialize (boost::property_tree::ptree &node)=0 |
UnSerialize object from a Xml Node. | |
virtual void | unSerialize (const std::string &xmlstring, const std::string &rootNode) |
UnSerialize object from a Xml Node string. | |
virtual void | unSerialize (std::istream &is, const std::string &rootNode) |
UnSerialize object from a Xml node. | |
virtual void | unSerialize (boost::property_tree::ptree &node, const std::string &rootNode) |
UnSerialize object from a Xml node. | |
virtual void | unSerializeFromFile (const std::string &filename) |
UnSerialize object from a Xml file. | |
virtual std::string | getDefaultXmlNodeName () const =0 |
Get the default Xml Node name for this object. | |
Protected Attributes | |
std::shared_ptr< DataRepresentation > | d_dataRepresentation |
The Data Representation. | |
std::shared_ptr< DataType > | d_dataType |
The Data Type. | |
bool | d_isFixedField |
The field is a value field. | |
bool | d_isIdentifier |
The field is used as identifier. | |
![]() | |
std::string | d_name |
The field name. | |
unsigned int | d_length |
The field length in bits. | |
unsigned int | d_position |
The field position in bits. | |
Additional Inherited Members | |
![]() | |
static std::string | removeXmlDeclaration (const std::string &xmlstring) |
Remove Xml declaration from a xml string. | |
static ByteVector | formatHexString (std::string hexstr) |
Format hex string to hex string with space. | |
![]() | |
static unsigned long long | atoull (const std::string &str) |
A value data field base class.
logicalaccess::ValueDataField::ValueDataField | ( | ) |
Constructor.
|
virtual |
Destructor.
void logicalaccess::ValueDataField::convertBinaryData | ( | const BitsetStream & | data, |
unsigned int | fieldlen, | ||
BitsetStream & | convertedData | ||
) | const |
Convert a binary data into the configured DataRepresentation.
data | The buffer data that contains the read buffer. |
dataLengthBytes | The buffer data length. |
pos | The current bit position into the buffer. Will contains the new position. |
fieldlen | The field length (in bits). |
convertedData | The buffer data that will contains the result. |
convertedDataLengthBytes | The buffer data length. |
void logicalaccess::ValueDataField::convertNumericData | ( | BitsetStream & | data, |
unsigned long long | field, | ||
unsigned int | fieldlen | ||
) | const |
Convert a numeric data into the configured DataRepresentation and DataType.
data | The buffer data that will contains the result. |
dataLengthBytes | The buffer data length. |
pos | The current bit position into the buffer. Will contains the new position. |
field | The numeric data value. |
fieldlen | The field length (in bits). |
std::shared_ptr< DataRepresentation > logicalaccess::ValueDataField::getDataRepresentation | ( | ) | const |
Get the Data Representation for the field.
std::shared_ptr< DataType > logicalaccess::ValueDataField::getDataType | ( | ) | const |
Get the Data Type for the field.
|
inlineoverridevirtual |
bool logicalaccess::ValueDataField::getIsFixedField | ( | ) | const |
Get if the field is a fixed field.
bool logicalaccess::ValueDataField::getIsIdentifier | ( | ) | const |
Get if the field is used as identifier.
BitsetStream logicalaccess::ValueDataField::revertBinaryData | ( | const BitsetStream & | data, |
unsigned int | pos, | ||
unsigned int | fieldlen | ||
) | const |
Revert a binary data using the configured DataRepresentation.
data | The buffer data that contains the encoded buffer. |
dataLengthBytes | The buffer data length. |
pos | The current bit position into the buffer. Will contains the new position. |
fieldlen | The field length (in bits). |
revertedData | The buffer data that will contains the result. |
revertedDataLengthBytes | The buffer data length. |
unsigned long long logicalaccess::ValueDataField::revertNumericData | ( | const BitsetStream & | data, |
unsigned int | pos, | ||
unsigned int | fieldlen | ||
) | const |
Revert a numeric data using the configured DataRepresentation and DataType.
data | The buffer data that contains the encoded field value. |
dataLengthBytes | The buffer data length. |
pos | The current bit position into the buffer. Will contains the new position. |
fieldlen | The field length (in bits). |
|
overridevirtual |
Serialize the current object to XML.
parentNode | The parent node. |
Reimplemented from logicalaccess::DataField.
|
virtual |
Set data length in bits.
length | The data length in bits. |
void logicalaccess::ValueDataField::setDataRepresentation | ( | std::shared_ptr< DataRepresentation > & | encoding | ) |
Set the Data Representation for the field.
encoding | The Data Representation. |
void logicalaccess::ValueDataField::setDataType | ( | const std::shared_ptr< DataType > & | encoding | ) |
Set the Data Type for the field.
encoding | The Data Type. |
void logicalaccess::ValueDataField::setIsFixedField | ( | bool | isFixed | ) |
Set if the field is a fixed field.
void logicalaccess::ValueDataField::setIsIdentifier | ( | bool | isIdentifier | ) |
Set if the field is used as identifier.
|
overridevirtual |
UnSerialize a XML node to the current object.
node | The XML node. |
Reimplemented from logicalaccess::DataField.
|
protected |
The Data Representation.
|
protected |
The Data Type.
|
protected |
The field is a value field.
|
protected |
The field is used as identifier.