LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
Public Member Functions | Static Private Member Functions | List of all members
logicalaccess::BinaryDataType Class Reference

A Binary data type class. More...

#include <binarydatatype.hpp>

Inheritance diagram for logicalaccess::BinaryDataType:
logicalaccess::DataType logicalaccess::Encoding

Public Member Functions

 BinaryDataType ()
 Constructor.
 
 ~BinaryDataType ()
 Destructor.
 
std::string getName () const override
 Get the encoder name.
 
EncodingType getType () const override
 Get the encoder type.
 
BitsetStream convert (unsigned long long data, unsigned int dataLengthBits) override
 Convert "data" to the data type.
 
unsigned long long revert (BitsetStream &data, unsigned int dataLengthBits) override
 Revert data type to data.
 
- Public Member Functions inherited from logicalaccess::DataType
 DataType ()
 Constructor.
 
virtual ~DataType ()
 Constructor.
 
virtual BitsetStream convert (unsigned long long data, unsigned int dataLengthBits)=0
 Convert "data" to the data type.
 
virtual unsigned long long revert (BitsetStream &data, unsigned int dataLengthBits)=0
 Revert data type to data.
 
void setLeftParityType (ParityType type)
 Set the left parity type of the wiegand format.
 
ParityType getLeftParityType () const
 Get the left parity type.
 
void setRightParityType (ParityType type)
 Set the right parity type of the wiegand format.
 
ParityType getRightParityType () const
 Get the right parity type.
 
void setBitDataRepresentationType (EncodingType bitDataRepresentationType)
 Get the bit data representation type.
 
EncodingType getBitDataRepresentationType () const
 Get the bit data representation type.
 
unsigned char getBitDataSize () const
 
- Public Member Functions inherited from logicalaccess::Encoding
virtual ~Encoding ()=default
 
virtual std::string getName () const =0
 Get the encoder name.
 
virtual EncodingType getType () const =0
 Get the encoder type.
 

Static Private Member Functions

static void Alg (int s, int *i)
 
static void Alg (int *i)
 

Additional Inherited Members

- Static Public Member Functions inherited from logicalaccess::DataType
static DataTypegetByEncodingType (EncodingType type)
 Create a new Data Type instance by the encoding type.
 
static long long pow (int base, unsigned int exp)
 
static BitsetStream addParity (ParityType leftParity, ParityType rightParity, unsigned int blocklen, BitsetStream &buf)
 Add parity to a buffer.
 
static BitsetStream removeParity (ParityType leftParity, ParityType rightParity, unsigned int blocklen, BitsetStream &buf)
 Remove parity to a buffer.
 
static unsigned char invertBitSex (unsigned char c, size_t length=8)
 Convert a character to the oser bit-sex (Least Significant Bit / Most Significant Bit).
 
- Protected Attributes inherited from logicalaccess::DataType
ParityType d_leftParityType
 The left parity type.
 
ParityType d_rightParityType
 The right parity type.
 
EncodingType d_bitDataRepresentationType
 The bit data representation type.
 

Detailed Description

A Binary data type class.

Constructor & Destructor Documentation

◆ BinaryDataType()

logicalaccess::BinaryDataType::BinaryDataType ( )

Constructor.

Create a BinaryDataType encoder.

◆ ~BinaryDataType()

logicalaccess::BinaryDataType::~BinaryDataType ( )

Destructor.

Release the BinaryDataType encoder.

Member Function Documentation

◆ Alg() [1/2]

void logicalaccess::BinaryDataType::Alg ( int *  i)
staticprivate

◆ Alg() [2/2]

void logicalaccess::BinaryDataType::Alg ( int  s,
int *  i 
)
staticprivate

◆ convert()

BitsetStream logicalaccess::BinaryDataType::convert ( unsigned long long  data,
unsigned int  dataLengthBits 
)
overridevirtual

Convert "data" to the data type.

Parameters
dataData to convert
dataLengthBitsLength of data to convert in bits
dataConvertedData after conversion
dataConvertedLengthBytesLength of "dataConverted" in bytes
Returns
Length of data written in bits

Implements logicalaccess::DataType.

◆ getName()

std::string logicalaccess::BinaryDataType::getName ( ) const
overridevirtual

Get the encoder name.

Returns
The encoder name

Implements logicalaccess::Encoding.

◆ getType()

EncodingType logicalaccess::BinaryDataType::getType ( ) const
overridevirtual

Get the encoder type.

Returns
The encoder type.

Implements logicalaccess::Encoding.

◆ revert()

unsigned long long logicalaccess::BinaryDataType::revert ( BitsetStream data,
unsigned int  dataLengthBits 
)
overridevirtual

Revert data type to data.

Parameters
dataData to revert
dataLengthBytesLength of "data" in bits
lengthBitsLength of data to revert in bits
Returns
Data after reversion

Implements logicalaccess::DataType.


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