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

The main class of evfileprocessor library - provides functionality for application's extraOperation (EEventFiller usually) More...

#include <ECardEventFileProcessor.h>

Classes

class  DataClass
 

Public Types

enum  ProcessEventResult {
  Undefined = 999, PurseToWrite = 0, TimeTicketToWrite = 1, BlockingToWrite = 2,
  NoEvents = 4, NoSpaceOnCard = 5, CardNotSold = 6, EvaluatingError = 7,
  KuwaitBlocking = 10, CardProviderMismatch = 11, ProlongToWrite = 12, NothingToProlong = 13,
  InsertedToDataCollection = 14, Correction = 15, UnknownCardEvent = 16, FictiveBlocking = 17,
  PersonalDataSaved = 18, ErrorCardData = 19, MaxPurseBalanceExceeded = 20, NothingToCorrect = 21,
  CustomerDataUpdateToWrite = 22, MinPurseBalanceExceeded = 23, Undefined = 999, PurseToWrite = 0,
  TimeTicketToWrite = 1, BlockingToWrite = 2, NoEvents = 4, NoSpaceOnCard = 5,
  CardNotSold = 6, EvaluatingError = 7, KuwaitBlocking = 10, CardProviderMismatch = 11,
  ProlongToWrite = 12, NothingToProlong = 13, InsertedToDataCollection = 14, Correction = 15,
  UnknownCardEvent = 16, FictiveBlocking = 17, PersonalDataSaved = 18, ErrorCardData = 19,
  MaxPurseBalanceExceeded = 20, NothingToCorrect = 21, CustomerDataUpdateToWrite = 22, MinPurseBalanceExceeded = 23
}
 ProcessEventResult enumerator. More...
 
enum  ProcessEventResult {
  Undefined = 999, PurseToWrite = 0, TimeTicketToWrite = 1, BlockingToWrite = 2,
  NoEvents = 4, NoSpaceOnCard = 5, CardNotSold = 6, EvaluatingError = 7,
  KuwaitBlocking = 10, CardProviderMismatch = 11, ProlongToWrite = 12, NothingToProlong = 13,
  InsertedToDataCollection = 14, Correction = 15, UnknownCardEvent = 16, FictiveBlocking = 17,
  PersonalDataSaved = 18, ErrorCardData = 19, MaxPurseBalanceExceeded = 20, NothingToCorrect = 21,
  CustomerDataUpdateToWrite = 22, MinPurseBalanceExceeded = 23, Undefined = 999, PurseToWrite = 0,
  TimeTicketToWrite = 1, BlockingToWrite = 2, NoEvents = 4, NoSpaceOnCard = 5,
  CardNotSold = 6, EvaluatingError = 7, KuwaitBlocking = 10, CardProviderMismatch = 11,
  ProlongToWrite = 12, NothingToProlong = 13, InsertedToDataCollection = 14, Correction = 15,
  UnknownCardEvent = 16, FictiveBlocking = 17, PersonalDataSaved = 18, ErrorCardData = 19,
  MaxPurseBalanceExceeded = 20, NothingToCorrect = 21, CustomerDataUpdateToWrite = 22, MinPurseBalanceExceeded = 23
}
 ProcessEventResult enumerator. More...
 

Public Member Functions

 ECardEventFileProcessor ()
 
 ECardEventFileProcessor (std::string path)
 
 ~ECardEventFileProcessor ()
 
void SetPath (std::string path)
 
void EnableWriting ()
 
EM::PT::EDataCollection * ProcessEvent (EEventFillerAttribute *eventFillerAttribute, ProcessEventResult &processEventResult, EStatisticsCollection &statistics)
 
bool WriteStatistics (EM::PT::EPTAnswer *answer, bool confirmingEvent, unsigned long readerNumber, bool unfinishedOperation, EStatisticsCollection &statistics)
 
CardEventGetLastProcessedEvent ()
 
void SetWritePhysicallyStatistics (bool writePhysically)
 
bool FillPrintData (EM::Common::EDataCol *dataCol)
 
void RegisterProcessedEvent (unsigned long processedEventID)
 
 ECardEventFileProcessor ()
 
 ECardEventFileProcessor (std::string path)
 
 ~ECardEventFileProcessor ()
 
void SetPath (std::string path)
 
void EnableWriting ()
 
EM::PT::EDataCollection * ProcessEvent (EEventFillerAttribute *eventFillerAttribute, ProcessEventResult &processEventResult, EStatisticsCollection &statistics)
 
bool WriteStatistics (EM::PT::EPTAnswer *answer, bool confirmingEvent, unsigned long readerNumber, bool unfinishedOperation, EStatisticsCollection &statistics)
 
CardEventGetLastProcessedEvent ()
 
void SetWritePhysicallyStatistics (bool writePhysically)
 
bool FillPrintData (EM::Common::EDataCol *dataCol)
 
void RegisterProcessedEvent (unsigned long processedEventID)
 

Static Public Member Functions

static long GetVersion ()
 
static long GetVersion ()
 

Detailed Description

The main class of evfileprocessor library - provides functionality for application's extraOperation (EEventFiller usually)

It looks for events for a card identified by SNR (UID), prepares data for writing if there is something to write and writes statistics

Member Enumeration Documentation

ProcessEventResult enumerator.

Enumerator
Undefined 
PurseToWrite 

Initialization value.

TimeTicketToWrite 

DataCollection for purse prepared to write.

BlockingToWrite 

DataCollection for time ticket prepared to write.

NoEvents 

DataCollection for blocking card prepared to write.

NoSpaceOnCard 

There are no events for this card.

CardNotSold 

There is no space on card to write new time ticket.

EvaluatingError 

Card is not sold.

KuwaitBlocking 

Not specified evaluating error.

CardProviderMismatch 

Probably not necessary anymore, but not deleted - just in case...

ProlongToWrite 

Provider in event and on card doesn't match.

NothingToProlong 

DataCollection for prolonging time ticket prepared to write.

InsertedToDataCollection 

There is an event for prolonging time ticket, but the time ticket not found on card.

Correction 

Nothing to write, but some changes were made to DataCollection.

UnknownCardEvent 

DataCollection for time ticket correction prepared to write.

FictiveBlocking 

There is no processor for such type of event.

PersonalDataSaved 

Nothing to write, just DataColletion was modified in order to set CardBlocked flag.

ErrorCardData 

Personal data was saved to statistics.

MaxPurseBalanceExceeded 

Insufficient card data - one of the needed card structures not found.

NothingToCorrect 

Maximum purse balance (due to tariff system setting) would be exceeded.

CustomerDataUpdateToWrite 

There is an event for correction, but the prepaid ticket was not found on card.

MinPurseBalanceExceeded 

DataCollection for customer data update prepared to write.

Undefined 
PurseToWrite 

Initialization value.

TimeTicketToWrite 

DataCollection for purse prepared to write.

BlockingToWrite 

DataCollection for time ticket prepared to write.

NoEvents 

DataCollection for blocking card prepared to write.

NoSpaceOnCard 

There are no events for this card.

CardNotSold 

There is no space on card to write new time ticket.

EvaluatingError 

Card is not sold.

KuwaitBlocking 

Not specified evaluating error.

CardProviderMismatch 

Probably not necessary anymore, but not deleted - just in case...

ProlongToWrite 

Provider in event and on card doesn't match.

NothingToProlong 

DataCollection for prolonging time ticket prepared to write.

InsertedToDataCollection 

There is an event for prolonging time ticket, but the time ticket not found on card.

Correction 

Nothing to write, but some changes were made to DataCollection.

UnknownCardEvent 

DataCollection for time ticket correction prepared to write.

FictiveBlocking 

There is no processor for such type of event.

PersonalDataSaved 

Nothing to write, just DataColletion was modified in order to set CardBlocked flag.

ErrorCardData 

Personal data was saved to statistics.

MaxPurseBalanceExceeded 

Insufficient card data - one of the needed card structures not found.

NothingToCorrect 

Maximum purse balance (due to tariff system setting) would be exceeded.

CustomerDataUpdateToWrite 

There is an event for correction, but the prepaid ticket was not found on card.

MinPurseBalanceExceeded 

DataCollection for customer data update prepared to write.

ProcessEventResult enumerator.

Enumerator
Undefined 
PurseToWrite 

Initialization value.

TimeTicketToWrite 

DataCollection for purse prepared to write.

BlockingToWrite 

DataCollection for time ticket prepared to write.

NoEvents 

DataCollection for blocking card prepared to write.

NoSpaceOnCard 

There are no events for this card.

CardNotSold 

There is no space on card to write new time ticket.

EvaluatingError 

Card is not sold.

KuwaitBlocking 

Not specified evaluating error.

CardProviderMismatch 

Probably not necessary anymore, but not deleted - just in case...

ProlongToWrite 

Provider in event and on card doesn't match.

NothingToProlong 

DataCollection for prolonging time ticket prepared to write.

InsertedToDataCollection 

There is an event for prolonging time ticket, but the time ticket not found on card.

Correction 

Nothing to write, but some changes were made to DataCollection.

UnknownCardEvent 

DataCollection for time ticket correction prepared to write.

FictiveBlocking 

There is no processor for such type of event.

PersonalDataSaved 

Nothing to write, just DataColletion was modified in order to set CardBlocked flag.

ErrorCardData 

Personal data was saved to statistics.

MaxPurseBalanceExceeded 

Insufficient card data - one of the needed card structures not found.

NothingToCorrect 

Maximum purse balance (due to tariff system setting) would be exceeded.

CustomerDataUpdateToWrite 

There is an event for correction, but the prepaid ticket was not found on card.

MinPurseBalanceExceeded 

DataCollection for customer data update prepared to write.

Undefined 
PurseToWrite 

Initialization value.

TimeTicketToWrite 

DataCollection for purse prepared to write.

BlockingToWrite 

DataCollection for time ticket prepared to write.

NoEvents 

DataCollection for blocking card prepared to write.

NoSpaceOnCard 

There are no events for this card.

CardNotSold 

There is no space on card to write new time ticket.

EvaluatingError 

Card is not sold.

KuwaitBlocking 

Not specified evaluating error.

CardProviderMismatch 

Probably not necessary anymore, but not deleted - just in case...

ProlongToWrite 

Provider in event and on card doesn't match.

NothingToProlong 

DataCollection for prolonging time ticket prepared to write.

InsertedToDataCollection 

There is an event for prolonging time ticket, but the time ticket not found on card.

Correction 

Nothing to write, but some changes were made to DataCollection.

UnknownCardEvent 

DataCollection for time ticket correction prepared to write.

FictiveBlocking 

There is no processor for such type of event.

PersonalDataSaved 

Nothing to write, just DataColletion was modified in order to set CardBlocked flag.

ErrorCardData 

Personal data was saved to statistics.

MaxPurseBalanceExceeded 

Insufficient card data - one of the needed card structures not found.

NothingToCorrect 

Maximum purse balance (due to tariff system setting) would be exceeded.

CustomerDataUpdateToWrite 

There is an event for correction, but the prepaid ticket was not found on card.

MinPurseBalanceExceeded 

DataCollection for customer data update prepared to write.

Constructor & Destructor Documentation

ECardEventFileProcessor::ECardEventFileProcessor ( )

CONSTRUCTOR

EM::EventFileProcessor::ECardEventFileProcessor::ECardEventFileProcessor ( std::string  path)
ECardEventFileProcessor::~ECardEventFileProcessor ( )

DESTRUCTOR

EM::EventFileProcessor::ECardEventFileProcessor::ECardEventFileProcessor ( )
EM::EventFileProcessor::ECardEventFileProcessor::ECardEventFileProcessor ( std::string  path)
EM::EventFileProcessor::ECardEventFileProcessor::~ECardEventFileProcessor ( )

Member Function Documentation

void ECardEventFileProcessor::EnableWriting ( )

This function is supposed to be called after manipulating with event files It closes filestreams in order to allow performing merging operations on event files if neccessarry

EnableWriting

void EM::EventFileProcessor::ECardEventFileProcessor::EnableWriting ( )

This function is supposed to be called after manipulating with event files It closes filestreams in order to allow performing merging operations on event files if neccessarry

bool EM::EventFileProcessor::ECardEventFileProcessor::FillPrintData ( EM::Common::EDataCol *  dataCol)

Fills data for printing tickets

Parameters
dataCol: EDataCol* - ticket's dataCol
codePage: codepage - code page of input data
bool EM::EventFileProcessor::ECardEventFileProcessor::FillPrintData ( EM::Common::EDataCol *  dataCol)

Fills data for printing tickets

Parameters
dataCol: EDataCol* - ticket's dataCol
codePage: codepage - code page of input data
CardEvent * ECardEventFileProcessor::GetLastProcessedEvent ( )

Returns last processed event

Returns
CardEvent* = pointer to last processed event

GetLastProcessedEvent

CardEvent* EM::EventFileProcessor::ECardEventFileProcessor::GetLastProcessedEvent ( )

Returns last processed event

Returns
CardEvent* = pointer to last processed event
static long EM::EventFileProcessor::ECardEventFileProcessor::GetVersion ( )
static

Returns version of library It's used by monitoring system

long ECardEventFileProcessor::GetVersion ( )
static

Returns version of library It's used by monitoring system

GetVersion

Here is the caller graph for this function:

EM::PT::EDataCollection* EM::EventFileProcessor::ECardEventFileProcessor::ProcessEvent ( EEventFillerAttribute eventFillerAttribute,
ProcessEventResult processEventResult,
EStatisticsCollection statistics 
)

It looks for events for card identified by SNR/UID, evaluates events if there are some and eventually creates EDataCollection for writing

Parameters
eventFillerAttribute: EEventFillerAttribute* = class encapsulating some neccessarry additional information
See also
EEventFillerAttribute
Parameters
processEventResult: ProcessEventResult - OUTPUT parameter - return value of this method (No events, writing purse, writing time ticket etc..)
statistics: EStatisticsCollection - OUTPUT parameter - collection of statistics records (which have to be deleted by client)
Returns
EDataCollection* = dataCollection for writing (if there is something to write) This collection is sent by application
EDataCollection * ECardEventFileProcessor::ProcessEvent ( EEventFillerAttribute eventFillerAttribute,
ProcessEventResult processEventResult,
EStatisticsCollection statistics 
)

It looks for events for card identified by SNR/UID, evaluates events if there are some and eventually creates EDataCollection for writing

Parameters
eventFillerAttribute: EEventFillerAttribute* = class encapsulating some neccessarry additional information
See also
EEventFillerAttribute
Parameters
processEventResult: ProcessEventResult - OUTPUT parameter - return value of this method (No events, writing purse, writing time ticket etc..)
statistics: EStatisticsCollection - OUTPUT parameter - collection of statistics records (which have to be deleted by client)
Returns
EDataCollection* = dataCollection for writing (if there is something to write) This collection is sent by application

ProcessEvent

Here is the call graph for this function:

void EM::EventFileProcessor::ECardEventFileProcessor::RegisterProcessedEvent ( unsigned long  processedEventID)

Adds processed event ID to recently processed events in order not to process it repeatedly (it's usually event from master/slave)

Parameters
processedEventID- card event ID
void ECardEventFileProcessor::RegisterProcessedEvent ( unsigned long  processedEventID)

Adds processed event ID to recently processed events in order not to process it repeatedly (it's usually event from master/slave)

Parameters
processedEventID- card event ID

RegisterProcessedEvent

void EM::EventFileProcessor::ECardEventFileProcessor::SetPath ( std::string  path)

Sets path to event files on local fileSystem

Parameters
path: string - path to event files including filename without extension (e.g. /opt/emtest/var/events) it will append extensions .idx and .dat fot itself
void EM::EventFileProcessor::ECardEventFileProcessor::SetPath ( std::string  path)

Sets path to event files on local fileSystem

Parameters
path: string - path to event files including filename without extension (e.g. /opt/emtest/var/events) it will append extensions .idx and .dat fot itself
void ECardEventFileProcessor::SetWritePhysicallyStatistics ( bool  writePhysically)

Enables to turn off physical write of statistics. It can be used on slaves which are only sending statistics to master and there is no need to write it locally. Think twice before using this method True by default

SetWritePhysicallyStatistics

void EM::EventFileProcessor::ECardEventFileProcessor::SetWritePhysicallyStatistics ( bool  writePhysically)

Enables to turn off physical write of statistics. It can be used on slaves which are only sending statistics to master and there is no need to write it locally. Think twice before using this method True by default

bool EM::EventFileProcessor::ECardEventFileProcessor::WriteStatistics ( EM::PT::EPTAnswer *  answer,
bool  confirmingEvent,
unsigned long  readerNumber,
bool  unfinishedOperation,
EStatisticsCollection statistics 
)

WriteStatistics Returns statistic records related to last processed event

Parameters
answer: EPTAnswer* - answer from PT
confirmingEvent: bool - if confirming file for webservice should be written (true in most cases)
readerNumber: unsigned long - reader SNR on Slave, otherwise 0
unfinishedOperation: bool - if unfinished operation was detected
statistics: EStatisticsCollection - OUTPUT parameter - collection of statistics records (which have to be deleted by client)
Returns
bool - true if statistics was written false if writting failed or it is not possible to write statistics now (deduction not opened or service not logged in)
bool EM::EventFileProcessor::ECardEventFileProcessor::WriteStatistics ( EM::PT::EPTAnswer *  answer,
bool  confirmingEvent,
unsigned long  readerNumber,
bool  unfinishedOperation,
EStatisticsCollection statistics 
)

WriteStatistics Returns statistic records related to last processed event

Parameters
answer: EPTAnswer* - answer from PT
confirmingEvent: bool - if confirming file for webservice should be written (true in most cases)
readerNumber: unsigned long - reader SNR on Slave, otherwise 0
unfinishedOperation: bool - if unfinished operation was detected
statistics: EStatisticsCollection - OUTPUT parameter - collection of statistics records (which have to be deleted by client)
Returns
bool - true if statistics was written false if writting failed or it is not possible to write statistics now (deduction not opened or service not logged in)

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