AppCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
EM::TicketIssueLogic::SnapshotHandler Class Reference

#include <SnapshotHandler.h>

Public Member Functions

 SnapshotHandler (ETicketIssueLogicDataStorage *dataStorage)
 
virtual ~SnapshotHandler ()
 
EIssueLogicDefines::ReturnValues Init ()
 Initializes instance for usage. More...
 
EIssueLogicDefines::ReturnValues CheckIfRollbackOfOneWayTicketIsPossible (bool &rollbackPossible) const
 CheckIfRollbackOfOneWayTicketIsPossible - detects if rollback from snapshots of one way ticket is possible according to combination of current settings of tariff system. More...
 
EIssueLogicDefines::ReturnValues CheckIfSnapshotIsRequired (bool &saveSnapshot) const
 Check if it's required to save snapshot of some ticket from card to catch state before operation was just realized. Checks data in DataStorage (like Operaration, CardWrite flags, IssuedTicket ...) More...
 
EIssueLogicDefines::ReturnValues SaveSnapshot ()
 Create and save snapshot into xml file. Ticket is determined by data in dataStorage (cardWrite flags, ticket index, etc.) More...
 
EIssueLogicDefines::ReturnValues LoadSnapshot (const char *cardUID, const unsigned long ticketNumber, const Snapshot::SnapshotType type, EM::TicketIssueLogic::Snapshot &snapshot) const
 Find snapshot in XML file with saved snapshots and return it (in output parameter) More...
 
EIssueLogicDefines::ReturnValues RestoreTimeTicketFromSnapshot (const char *cardUID, const unsigned long ticketNumber)
 Restore ticket from snapshot and write it to card (set via facade) More...
 
EIssueLogicDefines::ReturnValues RestoreOneWayTicketFromSnapshot (const char *cardUID, const unsigned long ticketNumber)
 

Constructor & Destructor Documentation

INTERNAL SnapshotHandler::SnapshotHandler ( ETicketIssueLogicDataStorage dataStorage)
SnapshotHandler::~SnapshotHandler ( )
virtual

Member Function Documentation

EIssueLogicDefines::ReturnValues SnapshotHandler::CheckIfRollbackOfOneWayTicketIsPossible ( bool &  rollbackPossible) const

CheckIfRollbackOfOneWayTicketIsPossible - detects if rollback from snapshots of one way ticket is possible according to combination of current settings of tariff system.

Parameters
rollbackPossible- output parameter where result will be stored. Will be set to true if rollback from snapshot is possible
Returns
See also
EIssueLogicDefines::ReturnValues
EIssueLogicDefines::ReturnValues SnapshotHandler::CheckIfSnapshotIsRequired ( bool &  saveSnapshot) const

Check if it's required to save snapshot of some ticket from card to catch state before operation was just realized. Checks data in DataStorage (like Operaration, CardWrite flags, IssuedTicket ...)

Parameters
saveSnapshot- output parameter telling if snapshot should be saved
Returns
value from EIssueLogicDefines::ReturnValues (Ok on success)
EIssueLogicDefines::ReturnValues SnapshotHandler::Init ( void  )

Initializes instance for usage.

Returns
Ok when no error occurred. See EIssueLogicDefines::ReturnValues
EIssueLogicDefines::ReturnValues SnapshotHandler::LoadSnapshot ( const char *  cardUID,
const unsigned long  ticketNumber,
const Snapshot::SnapshotType  type,
EM::TicketIssueLogic::Snapshot snapshot 
) const

Find snapshot in XML file with saved snapshots and return it (in output parameter)

Parameters
cardUID- UID of card which ticket is meant for (card where ticket will be written)
ticketNumber- number of statistical ticket for which snapshot was created
type
snapshot- output parameter filled with data read from XML (from found snapshot)
Returns
value from EIssueLogicDefines::ReturnValues (Ok when snapshot is found and deserialized from XML)

Here is the call graph for this function:

EIssueLogicDefines::ReturnValues SnapshotHandler::RestoreOneWayTicketFromSnapshot ( const char *  cardUID,
const unsigned long  ticketNumber 
)

Here is the call graph for this function:

EIssueLogicDefines::ReturnValues SnapshotHandler::RestoreTimeTicketFromSnapshot ( const char *  cardUID,
const unsigned long  ticketNumber 
)

Restore ticket from snapshot and write it to card (set via facade)

Parameters
cardUID- UID of card which ticket is meant for (card where ticket will be written). Used to identify snapshot together with ticketNumber
ticketNumber- number of statistical ticket for which snapshot was created. Used to identify snapshot together with cardUID
Returns
value from EIssueLogicDefines::ReturnValues (Ok on success)

Here is the call graph for this function:

EIssueLogicDefines::ReturnValues SnapshotHandler::SaveSnapshot ( )

Create and save snapshot into xml file. Ticket is determined by data in dataStorage (cardWrite flags, ticket index, etc.)

Note
Old snapshots are removed from XML on save.
Returns
value from EIssueLogicDefines::ReturnValues (Ok on success)

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