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

A Cards format composite class. More...

#include <cardsformatcomposite.hpp>

Inheritance diagram for logicalaccess::CardsFormatComposite:
logicalaccess::XmlSerializable

Public Member Functions

 CardsFormatComposite ()
 Constructor.
 
virtual ~CardsFormatComposite ()
 Destructor.
 
std::shared_ptr< FormatcreateFormatFromXml (const std::string &xmlstring, const std::string &rootNode) const
 Create a format instance from Xml string.
 
void addFormatForCard (const std::string &type, std::shared_ptr< FormatInfos > formatInfos)
 Add a format for a card type.
 
std::shared_ptr< FormatInfosretrieveFormatForCard (const std::string &type)
 Retrieve format information for a card type.
 
void removeFormatForCard (const std::string &type)
 Remove a format for a card type.
 
CardTypeList getConfiguredCardTypes ()
 Get configured card type.
 
std::shared_ptr< FormatreadFormat ()
 Read format from a card.
 
std::shared_ptr< FormatreadFormat (std::shared_ptr< Chip > chip)
 Read format from a card.
 
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.
 
std::string getDefaultXmlNodeName () const override
 Get the default Xml Node name for this object.
 
std::shared_ptr< ReaderUnitgetReaderUnit () const
 Get the reader unit.
 
void setReaderUnit (std::weak_ptr< ReaderUnit > unit)
 
virtual std::string serialize ()
 Serialize object to Xml Node string.
 
virtual void serialize (boost::property_tree::ptree &parentNode)=0
 Serialize object to Xml Node.
 
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.
 
- Public Member Functions inherited from logicalaccess::XmlSerializable
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

FormatInfosList formatsList
 The configured formats' list.
 
std::weak_ptr< ReaderUnitd_ReaderUnit
 The reader unit.
 

Additional Inherited Members

- Static Public Member Functions inherited from logicalaccess::XmlSerializable
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 Protected Member Functions inherited from logicalaccess::XmlSerializable
static unsigned long long atoull (const std::string &str)
 

Detailed Description

A Cards format composite class.

Constructor & Destructor Documentation

◆ CardsFormatComposite()

logicalaccess::CardsFormatComposite::CardsFormatComposite ( )

Constructor.

◆ ~CardsFormatComposite()

logicalaccess::CardsFormatComposite::~CardsFormatComposite ( )
virtual

Destructor.

Member Function Documentation

◆ addFormatForCard()

void logicalaccess::CardsFormatComposite::addFormatForCard ( const std::string &  type,
std::shared_ptr< FormatInfos formatInfos 
)

Add a format for a card type.

Parameters
typeThe card type.
formatInfosThe format information.

◆ createFormatFromXml()

std::shared_ptr< Format > logicalaccess::CardsFormatComposite::createFormatFromXml ( const std::string &  xmlstring,
const std::string &  rootNode 
) const

Create a format instance from Xml string.

Parameters
xmlstringThe Xml string.
rootNodeThe root node.
Returns
The format instance.

◆ getConfiguredCardTypes()

CardTypeList logicalaccess::CardsFormatComposite::getConfiguredCardTypes ( )

Get configured card type.

Returns
The configured card type list.

◆ getDefaultXmlNodeName()

std::string logicalaccess::CardsFormatComposite::getDefaultXmlNodeName ( ) const
overridevirtual

Get the default Xml Node name for this object.

Returns
The Xml node name.

Implements logicalaccess::XmlSerializable.

◆ getReaderUnit()

std::shared_ptr< ReaderUnit > logicalaccess::CardsFormatComposite::getReaderUnit ( ) const

Get the reader unit.

Returns
The reader unit.

◆ readFormat() [1/2]

std::shared_ptr< Format > logicalaccess::CardsFormatComposite::readFormat ( )

Read format from a card.

Returns
The format.

◆ readFormat() [2/2]

std::shared_ptr< Format > logicalaccess::CardsFormatComposite::readFormat ( std::shared_ptr< Chip chip)

Read format from a card.

Parameters
chipThe chip object.
Returns
The format.

◆ removeFormatForCard()

void logicalaccess::CardsFormatComposite::removeFormatForCard ( const std::string &  type)

Remove a format for a card type.

Parameters
typeThe card type.

◆ retrieveFormatForCard()

std::shared_ptr< FormatInfos > logicalaccess::CardsFormatComposite::retrieveFormatForCard ( const std::string &  type)

Retrieve format information for a card type.

Parameters
typeThe card type.
formatThe format.
locationThe format location.
aiToUseThe format access information.
aiToWriteThe format access information to write in write mode.

◆ serialize() [1/3]

std::string logicalaccess::XmlSerializable::serialize ( )
virtual

Serialize object to Xml Node string.

Returns
The serialized object.

Reimplemented from logicalaccess::XmlSerializable.

◆ serialize() [2/3]

void logicalaccess::CardsFormatComposite::serialize ( boost::property_tree::ptree &  parentNode)
overridevirtual

Serialize the current object to XML.

Parameters
parentNodeThe parent node.

Implements logicalaccess::XmlSerializable.

◆ serialize() [3/3]

virtual void logicalaccess::XmlSerializable::serialize ( boost::property_tree::ptree &  parentNode)
virtual

Serialize object to Xml Node.

Parameters
osThe XML stream.

Implements logicalaccess::XmlSerializable.

◆ setReaderUnit()

void logicalaccess::CardsFormatComposite::setReaderUnit ( std::weak_ptr< ReaderUnit unit)

◆ unSerialize() [1/5]

void logicalaccess::CardsFormatComposite::unSerialize ( boost::property_tree::ptree &  node)
overridevirtual

UnSerialize a XML node to the current object.

Parameters
nodeThe XML node.

Implements logicalaccess::XmlSerializable.

◆ unSerialize() [2/5]

virtual void logicalaccess::XmlSerializable::unSerialize ( boost::property_tree::ptree &  node)
virtual

UnSerialize object from a Xml Node.

Parameters
nodeThe Xml node.

Implements logicalaccess::XmlSerializable.

◆ unSerialize() [3/5]

void logicalaccess::XmlSerializable::unSerialize ( boost::property_tree::ptree &  node,
const std::string &  rootNode 
)
virtual

UnSerialize object from a Xml node.

Parameters
nodeThe Xml node.
rootNodeThe root node.
Returns
True on success, false otherwise.

Reimplemented from logicalaccess::XmlSerializable.

◆ unSerialize() [4/5]

void logicalaccess::XmlSerializable::unSerialize ( const std::string &  xmlstring,
const std::string &  rootNode 
)
virtual

UnSerialize object from a Xml Node string.

Parameters
xmlstringThe Xml Node string.
rootNodeThe root node.
Returns
True on success, false otherwise.

Reimplemented from logicalaccess::XmlSerializable.

◆ unSerialize() [5/5]

void logicalaccess::XmlSerializable::unSerialize ( std::istream &  is,
const std::string &  rootNode 
)
virtual

UnSerialize object from a Xml node.

Parameters
isThe Xml stream.
rootNodeThe root node.
Returns
True on success, false otherwise.

Reimplemented from logicalaccess::XmlSerializable.

Member Data Documentation

◆ d_ReaderUnit

std::weak_ptr<ReaderUnit> logicalaccess::CardsFormatComposite::d_ReaderUnit
protected

The reader unit.

◆ formatsList

FormatInfosList logicalaccess::CardsFormatComposite::formatsList
protected

The configured formats' list.


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