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

#include <Snapshot.h>

Inheritance diagram for EM::TicketIssueLogic::Snapshot:
Inheritance graph
[legend]

Public Types

enum  SnapshotType { TypeUndefined = 0, TypeOneWayTicket = 1, TypeTimeTicket = 2 }
 

Public Member Functions

void SetCardUID (const std::string &uid)
 
void SetTicketNumber (const unsigned long ticketNumber)
 
void SetTimeStamp (const unsigned long timeStamp)
 
const std::string & GetCardUID () const
 
unsigned long GetTicketNumber () const
 
SnapshotType GetSnapshotType () const
 
unsigned long GetTimeStamp () const
 
virtual bool Serialize (QDomDocument &doc, QDomElement &newElement) const
 Serialize saves snapshot into given xml element (Sets attributes and value/data) More...
 
virtual bool Deserialize (const QDomElement &xmlElement)
 Deserialize loads attributes and data from given XML element and sets snapshot members with its values. More...
 

Static Public Member Functions

static bool Check (const QDomElement &xmlElement, const std::string &cardUID, const unsigned long ticketNumber, const SnapshotType type)
 Check if this snapshot has required parameters (given as arguments) More...
 
static bool ExtractTimeStamp (const QDomElement &xmlElement, unsigned long &timeStamp)
 Extract information about snapshot creation time from given xml node. More...
 

Protected Member Functions

 Snapshot (const SnapshotType type)
 
virtual ~Snapshot ()
 

Member Enumeration Documentation

Enumerator
TypeUndefined 
TypeOneWayTicket 
TypeTimeTicket 

Constructor & Destructor Documentation

INTERNAL Snapshot::Snapshot ( const SnapshotType  type)
protected
Snapshot::~Snapshot ( )
protectedvirtual

Member Function Documentation

bool Snapshot::Check ( const QDomElement &  xmlElement,
const std::string &  cardUID,
const unsigned long  ticketNumber,
const SnapshotType  type 
)
static

Check if this snapshot has required parameters (given as arguments)

Parameters
cardUID- UID of card from which snapshot has to originate
ticketNumber- number of statistic ticket for operation to be cancelled (snapshot come from state right before this operation)
type- type of required snapshot (TimeTicket/OneWayTicket...)
Returns
true if snapshot corresponds with given arguments, false if not
bool Snapshot::Deserialize ( const QDomElement &  xmlElement)
virtual

Deserialize loads attributes and data from given XML element and sets snapshot members with its values.

Parameters
xmlElement- reference to XML element with snapshot parameters and data (created with Serialize)
Returns
false on data extraction error (e.g. failed to convert som data from text) or other error. True when loading values was successful.

Reimplemented in EM::TicketIssueLogic::TimeTicketSnapshot, and EM::TicketIssueLogic::OneWayTicketSnapshot.

Here is the caller graph for this function:

bool Snapshot::ExtractTimeStamp ( const QDomElement &  xmlElement,
unsigned long &  timeStamp 
)
static

Extract information about snapshot creation time from given xml node.

Parameters
xmlElement- xml element whit snapshot information
timeStamp- output parameter filled with time of snapshot creation
Returns
false on error. True when extraction was without errors
const std::string & Snapshot::GetCardUID ( ) const
Snapshot::SnapshotType Snapshot::GetSnapshotType ( ) const
unsigned long Snapshot::GetTicketNumber ( ) const
unsigned long Snapshot::GetTimeStamp ( ) const
bool Snapshot::Serialize ( QDomDocument &  doc,
QDomElement &  newElement 
) const
virtual

Serialize saves snapshot into given xml element (Sets attributes and value/data)

Parameters
doc- reference to instance of QDomDocument where element will be saved (used to create data node)
newElement- reference to XML element to be filled with snapshot data
Returns
true on successful serializtion (xml element filling), otherwise false

Reimplemented in EM::TicketIssueLogic::TimeTicketSnapshot, and EM::TicketIssueLogic::OneWayTicketSnapshot.

Here is the caller graph for this function:

void Snapshot::SetCardUID ( const std::string &  uid)
void Snapshot::SetTicketNumber ( const unsigned long  ticketNumber)
void Snapshot::SetTimeStamp ( const unsigned long  timeStamp)

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