BankAndCustomer
Loading...
Searching...
No Matches
Bank Class Reference

A bank or other money management organization. More...

#include <Bank.h>

Inheritance diagram for Bank:
Collaboration diagram for Bank:

Public Member Functions

 Bank ()
 
 Bank (const std::string &rsName, const std::string &rsBIC)
 
 ~Bank ()
 
int initBankAccounts ()
 
virtual int preDeleteInBase (glo::EnDeepMode eDeepMode, void *&prData) override
 
virtual void postDeleteInBase (int iDeleteErr, glo::EnDeepMode eDeepMode, void *pData) override
 
void setBIC (const std::string &rsBIC)
 
std::string getBIC () const
 
int removeBankAccount (const std::string &rsIBAN)
 
int getBankAccount (std::shared_ptr< BankAccount > &rRetVal, glo::EnSeekMode eMode)
 
int getBankAccount (std::shared_ptr< BankAccount > &rRetVal, const std::string &rsIBAN)
 
int getBankAccounts (std::vector< std::shared_ptr< BankAccount > > &rRetVal, std::shared_ptr< Person > rBankCustomer)
 
int getBankCustomer (std::shared_ptr< Person > &rRetVal, const std::string &rsIBAN)
 
int setBankAccount (Person &rBankCustomer, const std::string &rsIBAN)
 Creates a bank account with a passed IBAN for the person passed.
 
int setBankAccount (std::shared_ptr< Person > rBankCustomer, const std::string &rsIBAN)
 Creates a bank account with a passed IBAN for the person passed.
 
- Public Member Functions inherited from Person
 Person ()
 
 Person (const std::string &rsName)
 
 ~Person ()
 
int initBankAccounts ()
 
void setName (const std::string &rsName)
 
std::string getName () const
 
int setBankAccount (const std::string &rsIBAN, const std::string &rsBIC)
 
int setBankAccount (Bank &rBank, const std::string &rsIBAN)
 
int setBankAccount (std::shared_ptr< Bank > rBank, const std::string &rsIBAN)
 
int removeBankAccount (const std::string &rsIBAN)
 
int getBankAccount (std::shared_ptr< BankAccount > &rRetVal, glo::EnSeekMode eMode)
 
int getBankAccount (std::shared_ptr< BankAccount > &rRetVal, const std::string &rsIBAN)
 
int getBankAccounts (std::vector< std::shared_ptr< BankAccount > > &rRetVal, std::shared_ptr< Bank > rBank)
 
int getBank (std::shared_ptr< Bank > &rRetVal, const std::string &rsIBAN)
 
- Public Member Functions inherited from glo::Persistent
 Persistent ()
 
 Persistent (const Persistent &rT)
 
virtual void activate ()
 
virtual int assign (Base &rBase) override
 
virtual void removeBase () override
 
virtual ObjID getObjID () const override
 
virtual std::time_t getCreateDate () const override
 
virtual std::time_t getLastChangeDate () const override
 
virtual void takeOverRecord (Record *pRecord) override
 
virtual int preStore (EnDeepMode eDeepMode, void *&prData)
 
virtual int store (EnDeepMode eDeepMode=DM_SHALLOW) override
 
virtual void postStore (int iStoreErr, EnDeepMode eDeepMode, void *pData)
 
virtual int preDeleteInBase (EnDeepMode eDeepMode, void *&prData)
 
virtual int deleteInBase (EnDeepMode eDeepMode=DM_SHALLOW) override
 
virtual void postDeleteInBase (int iDeleteErr, EnDeepMode eDeepMode, void *pData)
 
virtual int preRefresh (void *&prData)
 
virtual int refresh () override
 
virtual void postRefresh (int iRefreshErr, void *pData)
 
virtual int preLock (EnLockMode eLockMode, EnDeepMode eDeepMode, void *&prData)
 
virtual int lock (EnLockMode eLockMode=LK_DELETEvWRITE, EnDeepMode eDeepMode=DM_SHALLOW) override
 
virtual void postLock (int iLockErr, EnLockMode eLockMode, EnDeepMode eDeepMode, void *pData)
 
virtual int preRelock (EnLockMode eLockMode, EnDeepMode eDeepMode, void *&prData)
 
virtual int relock (EnLockMode eLockMode=LK_DELETEvWRITE, EnDeepMode eDeepMode=DM_SHALLOW) override
 
virtual void postRelock (int iLockErr, EnLockMode eLockMode, EnDeepMode eDeepMode, void *pData)
 
virtual int preUnlock (EnLockMode eLockMode, EnDeepMode eDeepMode, void *&prData)
 
virtual int unlock (EnLockMode eLockMode=LK_DELETEvWRITE, EnDeepMode eDeepMode=DM_SHALLOW) override
 
virtual void postUnlock (int iUnlockErr, EnLockMode eLockMode, EnDeepMode eDeepMode, void *pData)
 
virtual int preSetWatch (TdWatchNotifyMode ulWatchMode, EnDeepMode eDeepMode, CallBack *pCallBack, void *&prData)
 
virtual int setWatch (TdWatchNotifyMode ulWatchMode, EnDeepMode eDeepMode, CallBack *pCallBack=0) override
 
virtual void postSetWatch (int iSetWatchErr, TdWatchNotifyMode ulWatchMode, EnDeepMode eDeepMode, CallBack *pCallBack, void *pData)
 
virtual int preUnsetWatch (TdWatchNotifyMode ulWatchMode, EnDeepMode eDeepMode, CallBack *pCallBack, void *&prData)
 
virtual int unsetWatch (TdWatchNotifyMode ulWatchMode, EnDeepMode eDeepMode, CallBack *pCallBack=0) override
 
virtual void postUnsetWatch (int iUnsetWatchErr, TdWatchNotifyMode ulWatchMode, EnDeepMode eDeepMode, CallBack *pCallBack, void *pData)
 
virtual unsigned long getGloClassID () const override
 
virtual int getTypeAsString (std::string &rsTypeName) override
 
virtual int setGloAttribute (const AttributeID &rAttributeID, void *pPara)
 
virtual void * getGloAttribute (const AttributeID &rAttributeID)
 
virtual int setGloAttribute (const std::string &rstrAttributName, void *pPara)
 
virtual void * getGloAttribute (const std::string &rstrAttributName)
 
virtual bool isSameOrSuperClassFrom (const glo::Persistent *pPersistent) const
 Checks if passed object can be cast to this.
 
virtual bool isSameOrSuperClassFrom (const std::shared_ptr< glo::Persistent > pPersistent) const
 Checks if passed object can be cast to this.
 
- Public Member Functions inherited from glo::BasePersistent
 BasePersistent ()
 
 BasePersistent (const BasePersistent &)
 
virtual int getClassInfo (ClassInfo *&prClassInfo)
 
virtual unsigned int remember ()
 
virtual unsigned int forget ()
 
virtual bool isAssigned () const
 
unsigned int getLinkCount () const
 
int getRecord (Record *&prRecord) const
 
int getRecord (std::shared_ptr< Record > &rRetVal) const
 
int getAllPersAttributeNames (std::list< std::string > &rRetValList, const std::vector< unsigned long > *pClassIdVector=0) const
 
int getAllPersAttributeNamesSortByID (std::map< AttributeID, std::string > &rRetValMap, const std::vector< unsigned long > *pClassIdVector=0) const
 
int getPersAttribute (BaseRecordAttribute *&prRetVal, const std::string &sName) const
 
int getPersAttribute (std::shared_ptr< BaseRecordAttribute > &rRetVal, const std::string &sName) const
 
int getPersAttribute (BaseRecordAttribute *&prRetVal, const AttributeID &rAttributeID) const
 
int getPersAttribute (std::shared_ptr< BaseRecordAttribute > &rRetVal, const AttributeID &rAttributeID) const
 
int getAllPersAttributes (std::list< BaseRecordAttribute * > &rRetValList, const std::vector< unsigned long > *pClassIdVector=0) const
 
int getAllPersAttributes (std::list< std::shared_ptr< BaseRecordAttribute > > &rRetValList, const std::vector< unsigned long > *pClassIdVector=0) const
 
int getAllPersAttributesSortByName (std::map< std::string, BaseRecordAttribute *, std::less< std::string > > &rRetValMap, const std::vector< unsigned long > *pClassIdVector=0) const
 
int getAllPersAttributesSortByName (std::map< std::string, std::shared_ptr< BaseRecordAttribute >, std::less< std::string > > &rRetValMap, const std::vector< unsigned long > *pClassIdVector=0) const
 
int getAllPersAttributesSortByID (std::map< AttributeID, BaseRecordAttribute *, std::less< AttributeID > > &rRetValMap, const std::vector< unsigned long > *pClassIdVector=0) const
 
int getAllPersAttributesSortByID (std::map< AttributeID, std::shared_ptr< BaseRecordAttribute >, std::less< AttributeID > > &rRetValMap, const std::vector< unsigned long > *pClassIdVector=0) const
 
virtual bool isStored ()
 
virtual bool isDeletedInBase ()
 
virtual int lock (const LockSpecification &rLockSpecification)
 
virtual int relock (const LockSpecification &rLockSpecification)
 
virtual int unlock (const LockSpecification &rLockSpecification)
 
virtual int isLocked (EnLockMode eLockMode=LK_DELETEvWRITE, EnDeepMode eDeepMode=DM_SHALLOW) const
 
virtual int isLocked (const LockSpecification &rLockSpecification) const
 
virtual int isPossible (bool bRead, bool bWrite, bool bDelete, EnDeepMode eDeepMode=DM_SHALLOW) const
 
virtual int isPossible (const LockPossibleSpecification &rLockPossibleSpec, EnDeepMode eDeepMode=DM_SHALLOW) const
 
virtual int getProcessingPossibilities (LockPossibleSpecification &rLockPossibleSpec, EnDeepMode eDeepMode=DM_SHALLOW) const
 
virtual int setWatch (const WatchSpecification &rWatchSpec)
 
virtual int unsetWatch (const WatchSpecification &rWatchSpec)
 
BasePersistentoperator= (const BasePersistent &rT)
 
bool operator== (const BasePersistent &rT) const
 Comparison operator, all attributes are compared.
 
bool operator!= (const BasePersistent &rT) const
 Comparison operator, all attributes are compared.
 
- Public Member Functions inherited from glo::CallBack
 CallBack ()
 
 CallBack (Base &rBase)
 
virtual ~CallBack ()
 
virtual void notify (NotifyNote &rNote)
 
virtual void setBase (Base *pBase)
 
Base * getBase () const
 
CallBackoperator= (const CallBack &rT)
 
bool operator== (const CallBack &rT) const
 Comparison operator, all attributes are compared.
 
bool operator!= (const CallBack &rT) const
 Comparison operator, all attributes are compared.
 

Private Member Functions

 GLO_OBJECT (Bank:LegalEntity)
 
 GLO_INDEX (IDXBIC, Bank.m_BIC[11], UNIQUE|UNDEFINED)
 
 Bank (const Bank &)
 
Bankoperator= (const Bank &)
 

Private Attributes

std::string m_BIC
 
glo::TAllSet< BankAccountm_AllBankAccounts
 

Additional Inherited Members

- Public Attributes inherited from glo::CallBack
std::string m_strDebugInfo
 
- Protected Member Functions inherited from glo::Persistent
virtual ~Persistent ()
 
virtual void insertInObjectSpy () const override
 
virtual void removeInObjectSpy () const override
 
virtual void setCreateDate () override
 
virtual void _postAssign (Base &rBase)
 
Persistentoperator= (const Persistent &rT)
 
bool operator== (const Persistent &rT) const
 Comparison operator.
 
bool operator!= (const Persistent &rT) const
 Comparison operator.
 
- Protected Member Functions inherited from glo::BasePersistent
virtual ~BasePersistent ()
 
void setSpyaction (bool bSpyaction)
 
- Protected Member Functions inherited from glo::CallBack
 CallBack (const CallBack &rT)
 
- Protected Attributes inherited from glo::BasePersistent
unsigned int m_uiReferenceCount
 
eut::CriticalSection m_LocalCriticalSection
 
Record * m_pRecord
 
bool m_bSpyaction
 

Detailed Description

A bank or other money management organization.

Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ Bank() [1/3]

Bank::Bank ( )

Standard constructor.

◆ Bank() [2/3]

Bank::Bank ( const std::string & rsName,
const std::string & rsBIC )

Constructor with parameter passing.

Parameters
[in]rsNameThe Name of the person.
[in]rsBICThe BIC.

◆ ~Bank()

Bank::~Bank ( )

Destructor.

◆ Bank() [3/3]

Bank::Bank ( const Bank & )
private

The copy constructor is not available.

Member Function Documentation

◆ getBankAccount() [1/2]

int Bank::getBankAccount ( std::shared_ptr< BankAccount > & rRetVal,
const std::string & rsIBAN )

Returns a bank account with the passed IBAN.

Parameters
[in,out]rRetValThe object in a std::shared_ptr if found.
[in]rsIBANThe IBAN of the account.
Returns
A return < 0 indicates an error.

◆ getBankAccount() [2/2]

int Bank::getBankAccount ( std::shared_ptr< BankAccount > & rRetVal,
glo::EnSeekMode eMode )

Returns a BankAccount from m_AllBankAccounts of the referenced database in relation to eMode.

Parameters
[in,out]rRetValThe object in a std::shared_ptr if found.
[in]eModeThe seek mode.

Parameter examples:

  • glo::START = returns first element
  • glo::END = returns last element
  • glo::CURRENT = returns current element
  • glo::NEXT = returns next element
  • glo::PREVIOUS = returns previous element
Returns
A return < 0 indicates an error. A return == ::ERR_RANGE indicates the end of m_AllBankAccounts.

◆ getBankAccounts()

int Bank::getBankAccounts ( std::vector< std::shared_ptr< BankAccount > > & rRetVal,
std::shared_ptr< Person > rBankCustomer )

Returns bank accounts of the transferred bank customer.

Parameters
[in,out]rRetValIf no errors occur, the retrieved objects are stored in a std::vector.
[in]rBankCustomerThe bank customer.
Returns
A return < 0 indicates an error.

◆ getBankCustomer()

int Bank::getBankCustomer ( std::shared_ptr< Person > & rRetVal,
const std::string & rsIBAN )

Returns a bank customer with the passed IBAN.

Parameters
[in,out]rRetValThe object in a std::shared_ptr if found.
[in]rsIBANThe IBAN of the account.
Returns
A return < 0 indicates an error.

◆ getBIC()

std::string Bank::getBIC ( ) const

Returns the BIC.

Returns
see above

◆ GLO_INDEX()

Bank::GLO_INDEX ( IDXBIC ,
Bank. m_BIC[11],
UNIQUE| UNDEFINED )
private

The BIC is a unique index.

◆ GLO_OBJECT()

Bank::GLO_OBJECT ( Bank:LegalEntity )
private

◆ initBankAccounts()

int Bank::initBankAccounts ( )

m_AllBankAccounts is initialized here.

Returns
A return < 0 indicates an error.

◆ operator=()

Bank & Bank::operator= ( const Bank & )
private

The assignment operator is not available.

◆ postDeleteInBase()

virtual void Bank::postDeleteInBase ( int iDeleteErr,
glo::EnDeepMode eDeepMode,
void * pData )
overridevirtual

Releases the lock on this Bank and terminates the transaction with a commit or abort, depending on the iDeleteErr parameter.

Parameters
[in]iDeleteErrPossibly a deleting error, if != 0 the deleteing in Persistent::deleteInBase(EnDeepMode) was not performed.
[in]eDeepModeThe deletion depth mode is set by the calling method.
[in]pDataThis reference tells the method Bank::postDeleteInBase (...) whether the lock, transaction start and deletion of the accounts were successful.
See also
glo::Persistent::postDeleteInBase( EnDeepMode, void *& )

Reimplemented from Person.

◆ preDeleteInBase()

virtual int Bank::preDeleteInBase ( glo::EnDeepMode eDeepMode,
void *& prData )
overridevirtual

Locks the bank to be deleted, starts a transaction and deletes all accounts of this Bank.

Parameters
[in]eDeepModeThe deletion depth mode is set by the calling method.
[in]prDataThis reference tells the method Bank::postDeleteInBase (...) whether the lock and transaction start were successful.
Returns
A return < 0 indicates an error.
See also
glo::Persistent::preDeleteInBase( EnDeepMode, void *& )

Reimplemented from Person.

◆ removeBankAccount()

int Bank::removeBankAccount ( const std::string & rsIBAN)

Removes a bank account with the passed IBAN.

Parameters
[in]rsIBANThe IBAN of the account.
Returns
A return < 0 indicates an error.
Exceptions
eut::ErrorNExceptionAn exception is thrown if there is an unhandleable database error.

◆ setBankAccount() [1/2]

int Bank::setBankAccount ( Person & rBankCustomer,
const std::string & rsIBAN )

Creates a bank account with a passed IBAN for the person passed.

Parameters
[in]rBankCustomerThe Bank customer.
[in]rsIBANThe IBAN of the account.
Returns
A return < 0 indicates an error.
Exceptions
eut::ErrorNExceptionAn exception is thrown if there is an unhandleable database error.

◆ setBankAccount() [2/2]

int Bank::setBankAccount ( std::shared_ptr< Person > rBankCustomer,
const std::string & rsIBAN )

Creates a bank account with a passed IBAN for the person passed.

Parameters
[in]rBankCustomerThe Bank customer.
[in]rsIBANThe IBAN of the account.
Returns
A return < 0 indicates an error.
Exceptions
eut::ErrorNExceptionAn exception is thrown if there is an unhandleable database error.

◆ setBIC()

void Bank::setBIC ( const std::string & rsBIC)

Sets the BIC.

Parameters
[in]rsBICThe new BIC.

Member Data Documentation

◆ m_AllBankAccounts

glo::TAllSet< BankAccount > Bank::m_AllBankAccounts
private

Due to the potentially large number of bank accounts, there is no list of references because it would take too long to read.
Instead, an AllSet of bank accounts is used, which is instantiated with a corresponding index filter.

◆ m_BIC

std::string Bank::m_BIC
private

The BIC is an international code that can be used to uniquely identify financial institutions worldwide. The terms SWIFT code, SWIFT-BIC or SWIFT address are also common.


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