OSB_LIB::ListMgr Class Reference

Collaboration diagram for OSB_LIB::ListMgr:

Collaboration graph
[legend]
List of all members.

Detailed Description

Singleton class to access the various global lists.

Access to the global lists:
If the pointer to the respective list is 0, the function allocates a new list in a fairly thread-safe way.

Note:
To achieve absolute thread safety, applications must call the respective member before they create any threads.
      ChargeTraitsList& ctList()
      {
          // Seems that nobody has initialized the list yet: create one.
          if (0 == ctList_) {
              ChargeTraitsList* tmp = new ChargeTraitsList;
              // If the list pointer is still 0: set it.
              if (0 == ctList_) ctList_ = tmp;
              // The list pointer has been initialized in the meantime:
              // use this first pointer.
              else              delete tmp;
          }
          return *ctList_;
      }

Todo:
Provide functions init<X>(const Session&) to initialize the list pointers and read their content from the database; throw in the list access functions if a pointer is 0.
Todo:
Should we provide an optional mutex (read/write) so that applications can refresh the lists?

Definition at line 93 of file osblistmgr.h.

Static Public Member Functions

Private Member Functions

Static Private Member Functions

Static Private Attributes

Friends

Classes


Constructor & Destructor Documentation

OSB_LIB::ListMgr::ListMgr (  )  [private]

Prevent construction: not implemented.

OSB_LIB::ListMgr::ListMgr ( const ListMgr  )  [private]

Prevent copying: not implemented.


Member Function Documentation

static ChargeTraitsList& OSB_LIB::ListMgr::ctList (  )  [static]

List of charge traits.

static CurrencyBook& OSB_LIB::ListMgr::currencyBook (  )  [static]

List of currencies.

static void OSB_LIB::ListMgr::delInstance (  )  [static, private]

Delete all list pointers and set them to 0.

static AccountList& OSB_LIB::ListMgr::glAccounts (  )  [static]

List of GL accounts.

static RoundRuleList& OSB_LIB::ListMgr::roundRules (  )  [static]

List of rounding rules.

static TaxKeyList& OSB_LIB::ListMgr::taxKeys (  )  [static]

List of tax keys.

static UnitList& OSB_LIB::ListMgr::units (  )  [static]

List of units.


Friends And Related Function Documentation

friend class DelInstance [friend]

Allow to call delInstance() in its destructor.

Definition at line 102 of file osblistmgr.h.


Member Data Documentation

ChargeTraitsList* OSB_LIB::ListMgr::ctList_ [static, private]

List of charge traits.

Definition at line 134 of file osblistmgr.h.

CurrencyBook* OSB_LIB::ListMgr::currencyBook_ [static, private]

List of currencies.

Definition at line 126 of file osblistmgr.h.

DelInstance OSB_LIB::ListMgr::delInstance_ [static, private]

Make sure the lists get deleted at program end.

Definition at line 139 of file osblistmgr.h.

AccountList* OSB_LIB::ListMgr::glAccounts_ [static, private]

List of GL accounts.

Definition at line 130 of file osblistmgr.h.

RoundRuleList* OSB_LIB::ListMgr::roundRules_ [static, private]

List of rounding rules.

Definition at line 128 of file osblistmgr.h.

TaxKeyList* OSB_LIB::ListMgr::taxKeys_ [static, private]

List of tax keys.

Definition at line 132 of file osblistmgr.h.

UnitList* OSB_LIB::ListMgr::units_ [static, private]

List of units.

Definition at line 136 of file osblistmgr.h.


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:12:13 2006 for OSB Library by  doxygen 1.4.7