Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

SecurePlayLibrary::SPAbstractTransactionClass Class Reference

#include <SPAbstractTransactionClass.h>

Inheritance diagram for SecurePlayLibrary::SPAbstractTransactionClass:

SecurePlayLibrary::SPRootTransactionClass SecurePlayLibrary::SPAbstractTransactionInterface SecurePlayLibrary::SPTBlastClass SecurePlayLibrary::SPTMultiPartSecretClass SecurePlayLibrary::SPTMultiPartSimultaneousClass SecurePlayLibrary::SPTMultistepTurnClass SecurePlayLibrary::SPTRandomClass SecurePlayLibrary::SPTSecretClass SecurePlayLibrary::SPTShipClass SecurePlayLibrary::SPTSimultaneousClass SecurePlayLibrary::SPTStrobeClass List of all members.

Detailed Description

This is the common abstract transaction class for all transactions in the SecurePlay library
Author:
IT GlobalSecure Inc.
See also:
SecurePlay License Information


Public Member Functions

 SPAbstractTransactionClass ()
 ~SPAbstractTransactionClass ()
 SPAbstractTransactionClass (SPGameInterface *gameobj, string master, vector< string > playerIDList, bool privateflag, string transactionID)
bool APIbeginTransaction (string pid)
bool APIcompleteTransaction (string pid)
bool APIrequestCompleteTransaction (string pid)
bool APIconfigureTransaction (string pid, vector< string > args)
bool APIrequestconfigureTransaction (string pid, vector< string > args)
bool APIrequestbeginTransaction (string pid)
bool onincomingTransaction (SPMessageClass *incoming)
bool transComplete ()
bool transError ()
void onrequestcompleteTransaction (SPMessageClass *incoming)
void onrequestbeginTransaction (SPMessageClass *incoming)
bool isPlayerInternal (string pid)
bool sendMessage (string sender, vector< string > receivers, bool encryptflag, bool privateflag, string messagetype, vector< string > messagebody, vector< string > altmessage)
void logError ()
virtual SPAbstractTransactionAPIInterfacegetClassAPI ()
bool getPrivacyFlag ()
void setTransactionID (string tid)
string APISPawn (string pid)
bool APIsetGameBlock (string pid, string newgameblock)
string APIgetGameBlock ()
vector< string > getConfiguration ()
SPGameInterfacegetGameinstance ()
string getLasterror ()
bool isPrivateflag ()
string getTransactionstatus ()
string getTransactionType ()
SPAbstractTransactionInterfacecreateTransaction (SPGameAPIInterface *gameapiobj, string master, vector< string > playerIDList, bool privateflag, string transactionID)
string getGameID ()
string getTransactionID ()
string getMaster ()
vector< string > getPlayerIDList ()
void SPnotify (string eventdescription, vector< string > args)

Static Public Member Functions

string gettranstype ()

Protected Member Functions

void prinit (SPGameInterface *gameobj, string master, vector< string > playerIDList, bool privateflag, string transactionID)
void pruniqueinit ()
bool onbeginTransaction (string sourceID)
virtual bool pronincomingTransaction (SPMessageClass *incoming)
void onrequestconfigureTransaction (SPMessageClass *incoming)
bool onSpawn (SPMessageClass *incoming)
virtual SPAbstractTransactionInterfacebuildSPawn ()
bool spawnConfigure (SPAbstractTransactionInterface *a)
bool onconfigureTransaction (SPMessageClass *incoming)
bool onconfigureTransaction (string sourceID, vector< string > configarr)
bool setGameBlock (string sourceID, string newgameblock)

Protected Attributes

SPGameInterfacegameinstance
bool privateflag
string transactionstatus
vector< string > configuration
SPAbstractTransactionAPIInterfaceclassAPI
string lasterror
string gameblock
string transtype

Private Member Functions

bool onbeginTransaction (SPMessageClass *incoming)
bool oncompleteTransaction (string sourceid)
bool oncompleteTransaction (SPMessageClass *incoming)
bool onsetGameBlock (SPMessageClass *incoming)
 SPAbstractTransactionClass (const SPAbstractTransactionClass &p)
 operator= (const SPAbstractTransactionClass &p)


Constructor & Destructor Documentation

SecurePlayLibrary::SPAbstractTransactionClass::SPAbstractTransactionClass const SPAbstractTransactionClass p  )  [inline, private]
 

Private Copy Constructor that protects this class from being copied.

SPAbstractTransactionClass::SPAbstractTransactionClass  ) 
 

Default Constructor

SPAbstractTransactionClass::~SPAbstractTransactionClass  ) 
 

Default Destructor

SPAbstractTransactionClass::SPAbstractTransactionClass SPGameInterface gameobj,
string  master,
vector< string >  playerIDList,
bool  privateflag,
string  transactionID
 

Constructor.

Parameters:
gameobj SPGameInterface* - game associated with this transaction.
master string - master of this transaction.
playerIDList vector<string> - player id list associated with this transaction.
privateflag bool - privacy flag.
transactionID string - ID associated with this transaction.


Member Function Documentation

bool SPAbstractTransactionClass::APIbeginTransaction string  pid  ) 
 

This action can only be initiated by the Transaction master. It sends a "beginTransaction" message to all of the transaction participants. A Transaction can only be begun if it has been successfully configured.

Parameters:
pid string - id of the transaction beginner, must be the master and internal.
Returns:
bool: TRUE, if successful, FALSE, if not

Reimplemented in SecurePlayLibrary::SPTBlastClass, and SecurePlayLibrary::SPTRandomClass.

bool SPAbstractTransactionClass::APIcompleteTransaction string  pid  ) 
 

This method allows the Transaction Master ONLY to complete the transaction. Transactions that are in an error state cannot be cleared by completion.

Parameters:
pid string - id of the player who is completing the transaction, must be the master and internal.
Returns:
bool: TRUE, if successful, FALSE, if not.

Reimplemented in SecurePlayLibrary::SPTBlastClass, and SecurePlayLibrary::SPTRandomClass.

bool SPAbstractTransactionClass::APIconfigureTransaction string  pid,
vector< string >  args
 

This method allows the Transaction Master ONLY to configure the transactions unique parameters. NOTE, this method will be overridden for individual transaction types.

Parameters:
pid string - id of the configurer, must be internal.
args vector<string> - the configuration array, with configuration details inside.
Returns:
bool: TRUE if successful, FALSE, if unsuccessful

Reimplemented in SecurePlayLibrary::SPTBlastClass, and SecurePlayLibrary::SPTRandomClass.

string SPAbstractTransactionClass::APIgetGameBlock  )  [virtual]
 

This method returns the current game block

Returns:
gameblock - string.

Implements SecurePlayLibrary::SPAbstractTransactionInterface.

bool SPAbstractTransactionClass::APIrequestbeginTransaction string  pid  ) 
 

This method allows any transaction participant excluding the Transaction master to request that the transaction be begun. This can only be done after the transaction has been configured.

Parameters:
pid string - the id of the requestor, can not be master, must be internal
Returns:
bool: TRUE, if successful, FALSE, if not

Reimplemented in SecurePlayLibrary::SPTBlastClass, and SecurePlayLibrary::SPTRandomClass.

bool SPAbstractTransactionClass::APIrequestCompleteTransaction string  pid  ) 
 

This method allows any player, excluding the Transaction master to request that the transactoin be completed.

Parameters:
pid string - id of the requestor, can not be the master, must be internal.
Returns:
bool: TRUE, if successful, FALSE, if not

Reimplemented in SecurePlayLibrary::SPTBlastClass.

bool SPAbstractTransactionClass::APIrequestconfigureTransaction string  pid,
vector< string >  args
 

This method allows any player, excluding the Transaction master, to request that the transaction be configured as described in the configuration array.

Parameters:
pid string - the configure requestor, can not be the master, must be internal.
args vector<string> - the configuration array, with configuration details.
Returns:
bool: TRUE, if successful, FALSE, if not

Reimplemented in SecurePlayLibrary::SPTBlastClass.

bool SPAbstractTransactionClass::APIsetGameBlock string  pid,
string  newgameblock
[virtual]
 

This method allows the Transaction Master ONLY to set the game block.

Parameters:
pid string - id of the player attempting to set the game block, must be internal.
newgameblock string - the game block for this transaction.
Returns:
bool: TRUE if successful, FALSE, if unsuccessful

Implements SecurePlayLibrary::SPAbstractTransactionInterface.

string SPAbstractTransactionClass::APISPawn string  pid  ) 
 

This method creates a new transaction with the identical participants and configuration as the spawning transaction.

Parameters:
pid string - player id must be master of the transaction
Returns:
string - transaction id of the new spawned transaction.

Reimplemented in SecurePlayLibrary::SPTRandomClass.

SPAbstractTransactionInterface * SPAbstractTransactionClass::buildSPawn  )  [protected, virtual]
 

This method builds the spawned transaction object

Returns:
tran - SPAbstractTransactionInterface - spawned transaction

Reimplemented in SecurePlayLibrary::SPTMultiPartSecretClass, SecurePlayLibrary::SPTMultiPartSimultaneousClass, SecurePlayLibrary::SPTMultistepTurnClass, SecurePlayLibrary::SPTRandomClass, SecurePlayLibrary::SPTSecretClass, SecurePlayLibrary::SPTSimultaneousClass, and SecurePlayLibrary::SPTStrobeClass.

SPAbstractTransactionInterface * SPAbstractTransactionClass::createTransaction SPGameAPIInterface gameapiobj,
string  master,
vector< string >  playerIDList,
bool  privateflag,
string  transactionID
[virtual]
 

Creates a new instance of an Abstract Transaction class.

Parameters:
gameapiobj SPGameInterface - game associated with this transaction.
master string - master of this transaction.
playerIDList vector<string> - player id list associated with this transaction.
privateflag bool - privacy flag.
transactionID string - ID associated with this transaction.

Implements SecurePlayLibrary::SPAbstractTransactionInterface.

Reimplemented in SecurePlayLibrary::SPTMultiPartSecretClass, SecurePlayLibrary::SPTMultiPartSimultaneousClass, SecurePlayLibrary::SPTMultistepTurnClass, SecurePlayLibrary::SPTRandomClass, SecurePlayLibrary::SPTSecretClass, SecurePlayLibrary::SPTSimultaneousClass, and SecurePlayLibrary::SPTStrobeClass.

SPAbstractTransactionAPIInterface * SPAbstractTransactionClass::getClassAPI  )  [virtual]
 

Gets this class's API

Returns:
SPAbstractTransactionAPIClass* - api version of this class

Implements SecurePlayLibrary::SPAbstractTransactionInterface.

vector< string > SPAbstractTransactionClass::getConfiguration  )  [virtual]
 

Getter function that returns the property: configuration

Returns:
vector<string> - the transaction configuration.

Implements SecurePlayLibrary::SPAbstractTransactionInterface.

string SPAbstractTransactionClass::getGameID  )  [virtual]
 

Gets the game id

Returns:
string - the game id

Implements SecurePlayLibrary::SPAbstractTransactionInterface.

SPGameInterface * SPAbstractTransactionClass::getGameinstance  ) 
 

Getter function that returns the property: gameinstance

Returns:
SPGameInterface* - the instance of the game associated with this class.

string SPAbstractTransactionClass::getLasterror  ) 
 

Getter function that returns the property: lasterror

Returns:
string - error

string SPAbstractTransactionClass::getMaster  )  [virtual]
 

Gets the master of the transaction or game

Returns:
string - returns the id of the master

Implements SecurePlayLibrary::SPAbstractTransactionInterface.

vector< string > SPAbstractTransactionClass::getPlayerIDList  )  [virtual]
 

Gets the player id list of the players associated with the transaction or the game.

Returns:
vector<string> - players associated with a game or transaction in a string array.

Implements SecurePlayLibrary::SPAbstractTransactionInterface.

bool SPAbstractTransactionClass::getPrivacyFlag  )  [virtual]
 

Gets the privacy flag of this class.

Returns:
bool - the privacy flag

Implements SecurePlayLibrary::SPAbstractTransactionInterface.

string SPAbstractTransactionClass::getTransactionID  )  [virtual]
 

Gets the transaction id.

Returns:
string - the transaction id

Implements SecurePlayLibrary::SPAbstractTransactionInterface.

string SPAbstractTransactionClass::getTransactionstatus  )  [virtual]
 

Getter function that returns the property: transactionstatus

Returns:
string

Implements SecurePlayLibrary::SPAbstractTransactionInterface.

string SPAbstractTransactionClass::getTransactionType  )  [virtual]
 

This method returns a String of the transactiontype.

Returns:
string - name of transaction type

Implements SecurePlayLibrary::SPAbstractTransactionInterface.

string SPAbstractTransactionClass::gettranstype  )  [static]
 

This method gets the transaction type.

Returns:
string - the transaction type.

Reimplemented in SecurePlayLibrary::SPTBlastClass, SecurePlayLibrary::SPTMultiPartSecretClass, SecurePlayLibrary::SPTMultiPartSimultaneousClass, SecurePlayLibrary::SPTMultistepTurnClass, SecurePlayLibrary::SPTRandomClass, SecurePlayLibrary::SPTSecretClass, SecurePlayLibrary::SPTShipClass, SecurePlayLibrary::SPTSimultaneousClass, and SecurePlayLibrary::SPTStrobeClass.

bool SPAbstractTransactionClass::isPlayerInternal string  pid  ) 
 

Checks to see if the playr is internal

Parameters:
pid string - id of the player to be checked.
Returns:
bool: TRUE if player is internal, FALSE if not

bool SPAbstractTransactionClass::isPrivateflag  )  [virtual]
 

Getter function that returns the property: privateflag

Returns:
bool - True; if privacy flag true, False: if false.

Implements SecurePlayLibrary::SPAbstractTransactionInterface.

void SPAbstractTransactionClass::logError  ) 
 

This is a shell method for future use.

bool SPAbstractTransactionClass::onbeginTransaction string  sourceID  )  [protected]
 

This method safely updates the state of the Transaction into the "ready" state, if possible. This can only be initiated by the Transaction Master

Parameters:
sourceID string - source id
Returns:
bool: TRUE, if successful, FALSE, if not

bool SPAbstractTransactionClass::onbeginTransaction SPMessageClass incoming  )  [private]
 

This method safely updates the state of the Transaction into the "ready" state, if possible. This can only be initiated by the Transaction Master

Parameters:
incoming SPMessageClass - incomng message
Returns:
bool: TRUE, if successful, FALSE, if not

Reimplemented in SecurePlayLibrary::SPTBlastClass.

bool SPAbstractTransactionClass::oncompleteTransaction SPMessageClass incoming  )  [private]
 

This method allows the Transaction Master ONLY to complete the transaction. Transactions that are in an error state cannot be cleared by completion.

Parameters:
incoming SPMessageClass - incomng message
Returns:
bool: TRUE, if successful, FALSE, if not.

Reimplemented in SecurePlayLibrary::SPTBlastClass, and SecurePlayLibrary::SPTRandomClass.

bool SPAbstractTransactionClass::oncompleteTransaction string  sourceid  )  [private]
 

This method allows the Transaction Master ONLY to complete the transaction. Transactions that are in an error state cannot be cleared by completion.

Parameters:
sourceid string - source id
Returns:
bool: TRUE, if successful, FALSE, if not.

bool SPAbstractTransactionClass::onconfigureTransaction string  sourceID,
vector< string >  configarr
[protected]
 

This method safely configures a transaction. NOTE: This can only be done by the Transaction master. This method will likely be replaced by any unique transaction class implementation.

Parameters:
sourceID string - id of the source.
configarr vector<string> - configuration array
Returns:
bool: TRUE, if successful, FALSE, if not.

bool SPAbstractTransactionClass::onconfigureTransaction SPMessageClass incoming  )  [protected]
 

This method safely configures a transaction. NOTE: This can only be done by the Transaction master. This method will likely be replaced by any unique transaction class implementation.

Parameters:
incoming SPMessageClass - incomng message
Returns:
bool: TRUE, if successful, FALSE, if not.

Reimplemented in SecurePlayLibrary::SPTBlastClass, and SecurePlayLibrary::SPTShipClass.

bool SPAbstractTransactionClass::onincomingTransaction SPMessageClass incoming  )  [virtual]
 

This method handles the various incoming messages and passes them to the appropriate message type handler.

Parameters:
incoming SPMessageClass - incomng message
Returns:
bool: TRUE if successful, FALSE, if unsuccessful

Implements SecurePlayLibrary::SPAbstractTransactionInterface.

Reimplemented in SecurePlayLibrary::SPTBlastClass.

void SPAbstractTransactionClass::onrequestbeginTransaction SPMessageClass incoming  ) 
 

This method safely handles requests to begin the transaction. Note, only the Transaction master can begin the transaction.

Parameters:
incoming SPMessageClass - incomng message

Reimplemented in SecurePlayLibrary::SPTBlastClass.

void SPAbstractTransactionClass::onrequestcompleteTransaction SPMessageClass incoming  ) 
 

This method safely handles requests to complete a Transaction by a player that is not the Transaction master.

Parameters:
incoming SPAbstractMessageClass - incomng message

Reimplemented in SecurePlayLibrary::SPTBlastClass.

void SPAbstractTransactionClass::onrequestconfigureTransaction SPMessageClass incoming  )  [protected]
 

This method safely handles a request from a player who is not the Transaction master to configure the transaction.

Parameters:
incoming SPMessageClass - incomng message

Reimplemented in SecurePlayLibrary::SPTBlastClass, and SecurePlayLibrary::SPTRandomClass.

bool SPAbstractTransactionClass::onsetGameBlock SPMessageClass incoming  )  [private]
 

This method safely sets the gameblock. NOTE: This can only be done by the Transaction master.

Parameters:
incoming SPMessageClass - incomng message
Returns:
bool: TRUE, if successful, FALSE, if not.

bool SPAbstractTransactionClass::onSpawn SPMessageClass incoming  )  [protected]
 

This method handles incoming spawn messages.

Parameters:
incoming SPMessageClass* - the spawn message.
Returns:
bool: TRUE, if successful, FALSE, if not

Reimplemented in SecurePlayLibrary::SPTRandomClass.

SecurePlayLibrary::SPAbstractTransactionClass::operator= const SPAbstractTransactionClass p  )  [inline, private]
 

Private = operator that protects this class from being copied.

void SPAbstractTransactionClass::prinit SPGameInterface gameobj,
string  master,
vector< string >  playerIDList,
bool  privateflag,
string  transactionID
[protected]
 

Initializes the transaction.

Parameters:
gameobj SPGameInterface(but actually SPAbstractGameClass) - the game object to which the transaction is associated.
master string - the id of the master of the transaction
playerIDList vector<string> - the player id list associated with the transaction
privateflag bool - virtual flag
transactionID string - id of the transaction

bool SPAbstractTransactionClass::pronincomingTransaction SPMessageClass incoming  )  [protected, virtual]
 

this is a shell for unique incoming transactions

Parameters:
incoming SPAbstractMessageClass - incoming message
Returns:
bool - TRUE if successful, FALSE, if unsuccessful

Reimplemented in SecurePlayLibrary::SPTMultiPartSecretClass, SecurePlayLibrary::SPTMultiPartSimultaneousClass, SecurePlayLibrary::SPTMultistepTurnClass, SecurePlayLibrary::SPTRandomClass, SecurePlayLibrary::SPTSecretClass, SecurePlayLibrary::SPTSimultaneousClass, and SecurePlayLibrary::SPTStrobeClass.

void SPAbstractTransactionClass::pruniqueinit  )  [protected]
 

shell to allow unique initialization of transactions

Reimplemented in SecurePlayLibrary::SPTMultiPartSimultaneousClass, SecurePlayLibrary::SPTRandomClass, SecurePlayLibrary::SPTSimultaneousClass, and SecurePlayLibrary::SPTStrobeClass.

bool SPAbstractTransactionClass::sendMessage string  sender,
vector< string >  receivers,
bool  encryptflag,
bool  privateflag,
string  messagetype,
vector< string >  messagebody,
vector< string >  altmessage
[virtual]
 

This method sends a message. It hands the configured message off to the appropriate comms service. Also, for virtual messages, it sends an alternate message to the parties not recieving the main message.

Parameters:
sender string - player id of the sender.
receivers vector<string> - player ids of recievers.
encryptflag bool - enrypted flag
privateflag bool - virtual flag
messagetype string - message type
messagebody vector<string> - the message body as a string
altmessage vector<string> - alternative message.
Returns:
bool: TRUE, if successful, FALSE, if not

Implements SecurePlayLibrary::SPAbstractTransactionInterface.

bool SPAbstractTransactionClass::setGameBlock string  sourceID,
string  newgameblock
[protected]
 

This method safely sets the game bock of a transaction. NOTE: This can only be done by the Transaction master.

Parameters:
sourceID string - id of the source.
gameblock string - candidate game block
Returns:
bool: TRUE, if successful, FALSE, if not.

void SPAbstractTransactionClass::setTransactionID string  tid  )  [virtual]
 

Sets the transaction id to a specified id.

Parameters:
string - the id of the transaction.

Implements SecurePlayLibrary::SPAbstractTransactionInterface.

bool SPAbstractTransactionClass::spawnConfigure SPAbstractTransactionInterface a  )  [protected]
 

This method configures the spawned transaction object

Parameters:
a SPAbstractTransactionInterface - the transaction to be spawned
Returns:
bool: TRUE, if successful, FALSE, if not

Reimplemented in SecurePlayLibrary::SPTMultiPartSecretClass, SecurePlayLibrary::SPTMultiPartSimultaneousClass, SecurePlayLibrary::SPTMultistepTurnClass, SecurePlayLibrary::SPTSecretClass, SecurePlayLibrary::SPTSimultaneousClass, and SecurePlayLibrary::SPTStrobeClass.

void SPAbstractTransactionClass::SPnotify string  eventdescription,
vector< string >  args
 

This method notifies the Listeners of events

Parameters:
eventdescription 
vector<string> - arguments

Reimplemented from SecurePlayLibrary::SPRootTransactionClass.

bool SPAbstractTransactionClass::transComplete  )  [virtual]
 

This method returns a flag for whether the transaction is currently in the "complete" state.

Returns:
bool: TRUE, if transaction complete, FALSE, if not.

Implements SecurePlayLibrary::SPAbstractTransactionInterface.

bool SPAbstractTransactionClass::transError  ) 
 

This method returns a flag for whether the status of the transaction is in error or not.

Returns:
bool: TRUE if transaction in error state, FALSE, if not.


Member Data Documentation

SPAbstractTransactionAPIInterface* SecurePlayLibrary::SPAbstractTransactionClass::classAPI [protected]
 

This is the api verion of this class

vector<string> SecurePlayLibrary::SPAbstractTransactionClass::configuration [protected]
 

This property holds the configuration of the Transaction Instance.

string SecurePlayLibrary::SPAbstractTransactionClass::gameblock [protected]
 

GameBlock or code associated with this transaction

SPGameInterface* SecurePlayLibrary::SPAbstractTransactionClass::gameinstance [protected]
 

This is the object handler for the Game Instance Object with which the transaction is associated.

string SecurePlayLibrary::SPAbstractTransactionClass::lasterror [protected]
 

This is the PlayerID of the player that is the master of this transaction. The master of the transaction is the only entity that can start, configure, or end the transaction.

bool SecurePlayLibrary::SPAbstractTransactionClass::privateflag [protected]
 

This is a flag to describe whether the specific transaction is a virtual transaction to the non-participating Players.

string SecurePlayLibrary::SPAbstractTransactionClass::transactionstatus [protected]
 

This is a string that describes the current state of the transaction. The common states are "new" - a newly created transaction, "configured" - a custom configured transaction, "ready" - a transaction ready to be begun, "complete" - a successfully completed transaction, and "error" - a transaction that has failed for some reason.

string SecurePlayLibrary::SPAbstractTransactionClass::transtype [protected]
 

Type of Transaction


The documentation for this class was generated from the following files: 2006 Copyright Filed by IT GlobalSecure, Inc. All Rights Reserved. Not to be used without authorization by Author. SecurePlay, IT GlobalSecure, and IT Armor are registered trademarks by IT GlobalSecure, Inc. Software protected by software license, and one or more the following U.S. and International patent numbers: U.S. Patent 6,030,288, U.S. Patent 6,165,072, European Patent Office EP1016049A1,and World Intellectual Property Organization WO9912135C1 and additional filings worldwide.