Keyple C++  0.9.0
Keyple, an Open Source SDK for Ticketing
Public Types | Public Member Functions | List of all members
keyple::calypso::transaction::SamResourceManager::ManagedSamResource Class Referencefinal

#include <SamResourceManager.h>

Inherits keyple::core::selection::SeResource< CalypsoSam >.

Public Types

enum  SamResourceStatus { SamResourceStatus::FREE, SamResourceStatus::BUSY }
 

Public Member Functions

 ManagedSamResource (std::shared_ptr< SeReader > seReader, std::shared_ptr< CalypsoSam > calypsoSam)
 
bool isSamResourceFree () const
 
void setSamIdentifier (std::shared_ptr< SamIdentifier > samIdentifier)
 
bool isSamMatching (const std::shared_ptr< SamIdentifier > samIdentifier) const
 
void setSamResourceStatus (const SamResourceStatus &samResourceStatus)
 
- Public Member Functions inherited from keyple::core::selection::SeResource< CalypsoSam >
 SeResource (std::shared_ptr< SeReader > seReader, std::shared_ptr< CalypsoSam > matchingSe)
 
virtual ~SeResource ()
 
virtual const std::shared_ptr< SeReadergetSeReader () const
 
virtual const std::shared_ptr< CalypsoSam > getMatchingSe () const
 

Detailed Description

(package-private)
Inner class to handle specific attributes associated with an

SeResource<CalypsoSam>

in the SamResourceManager context.

Since
0.9

Member Enumeration Documentation

◆ SamResourceStatus

The free/busy enum status

Enumerator
FREE 
BUSY 

Constructor & Destructor Documentation

◆ ManagedSamResource()

keyple::calypso::transaction::ManagedSamResource::ManagedSamResource ( std::shared_ptr< SeReader seReader,
std::shared_ptr< CalypsoSam calypsoSam 
)

Constructor

Parameters
seReaderthe keyple::core::seproxy::SeReader with which the SE is communicating
calypsoSamthe keyple::calypso::transaction::CalypsoSam information structure

Member Function Documentation

◆ isSamMatching()

bool keyple::calypso::transaction::ManagedSamResource::isSamMatching ( const std::shared_ptr< SamIdentifier samIdentifier) const

Indicates whether the ManagedSamResource matches the provided SAM identifier.

The test includes the keyple::calypso::command::sam::SamRevision, serial number and group reference provided by the keyple::calypso::transaction::SamIdentifier.

The SAM serial number can be null or empty, in this case all serial numbers are accepted. It can also be a regular expression target one or more specific serial numbers.

The groupe reference can be null or empty to let all group references match but not empty the group reference must match the keyple::calypso::transaction::SamIdentifier to have the method returning true.

Parameters
samIdentifierthe SAM identifier
Returns
true or false according to the result of the correspondence test

◆ isSamResourceFree()

bool keyple::calypso::transaction::ManagedSamResource::isSamResourceFree ( ) const

Indicates whether the ManagedSamResource is FREE or BUSY

Returns
the busy status

◆ setSamIdentifier()

void keyple::calypso::transaction::ManagedSamResource::setSamIdentifier ( std::shared_ptr< SamIdentifier samIdentifier)

◆ setSamResourceStatus()

void keyple::calypso::transaction::ManagedSamResource::setSamResourceStatus ( const SamResourceStatus samResourceStatus)

Sets the free/busy status of the ManagedSamResource

Parameters
samResourceStatusFREE/BUSY enum value

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