OSB_LIB::ChargeTraitsList Class Reference

Collaboration diagram for OSB_LIB::ChargeTraitsList:

Collaboration graph
[legend]
List of all members.

Detailed Description

Manager of ChargeTraits.

The class supports on-the-fly creation of charge traits: Clients search the list for a given charge traits setting. If this set of attributes does not exist in the internal list and in the database, it is automatically created.

Remarks:
Default and copy constructor, assignment and destructor by compiler.

Definition at line 349 of file chargetraits.h.

Public Types

STL container type definitions

Public Member Functions

Pure wrappers to the STL container
Remarks:
Do not add an STL operation to this group if the function does more than just wrapping!
All functions return the STL operation on list_.

Private Member Functions

Private Attributes


Member Typedef Documentation

typedef List::const_iterator OSB_LIB::ChargeTraitsList::ConstIterator

STL const_iterator.

Definition at line 358 of file chargetraits.h.

typedef List::iterator OSB_LIB::ChargeTraitsList::Iterator

STL iterator.

Definition at line 356 of file chargetraits.h.

typedef List::key_type OSB_LIB::ChargeTraitsList::KeyType

STL container key_type.

Definition at line 362 of file chargetraits.h.

typedef std::map<ChargeTraits::Oid, ChargeTraits> OSB_LIB::ChargeTraitsList::List

STL container type used to store the object id and object.

Definition at line 354 of file chargetraits.h.

typedef List::size_type OSB_LIB::ChargeTraitsList::SizeType

STL container size_type.

Definition at line 360 of file chargetraits.h.


Member Function Documentation

void OSB_LIB::ChargeTraitsList::add ( const ChargeTraits ct  )  [private]

Add a charge traits to the list.

Parameters:
ct Charge traits to add.

ConstIterator OSB_LIB::ChargeTraitsList::begin (  )  const [inline]

Const iterator to the beginning of the list.

Definition at line 383 of file chargetraits.h.

References list_.

Iterator OSB_LIB::ChargeTraitsList::begin (  )  [inline]

Iterator to the beginning of the list.

Definition at line 377 of file chargetraits.h.

References list_.

ConstIterator OSB_LIB::ChargeTraitsList::end (  )  const [inline]

Const iterator to the end of the list.

Definition at line 385 of file chargetraits.h.

References list_.

Iterator OSB_LIB::ChargeTraitsList::end (  )  [inline]

Iterator to the end of the list.

Definition at line 379 of file chargetraits.h.

References list_.

bool OSB_LIB::ChargeTraitsList::find ( ChargeTraits ct  )  const

Get matching charge traits.

Parameters:
ct Charge traits to find.
Returns:
true if a match for was found in the list, else false.
Uses ChargeTraits::match() to search the list.
If matching charge traits are found, the object id of ct is set accordingly.

ConstIterator OSB_LIB::ChargeTraitsList::find ( const KeyType k  )  const [inline]

Finds an element whose key is k.

Definition at line 387 of file chargetraits.h.

References list_.

Iterator OSB_LIB::ChargeTraitsList::find ( const KeyType k  )  [inline]

Finds an element whose key is k.

Definition at line 381 of file chargetraits.h.

References list_.

const ChargeTraits* OSB_LIB::ChargeTraitsList::findChargeTraits ( const ChargeTraits::Oid id  )  const

Find a charge traits based on the given charge traits id.

Parameters:
id Id of the charge traits.
Returns:
Pointer to the charge traits,
NULL pointer if charge traits can not be found.

ChargeTraits::Oid OSB_LIB::ChargeTraitsList::findMatch ( const ChargeTraits ct  )  const [private]

Search the id for a given charge traits setting.

Search whether the given charge traits is in the list.
The function uses all data members of ct (except its id) when comparing against existing charge traits.

Parameters:
ct Charge traits to search for.
Returns:
The id of the found charge traits. It is not set, if no matching entry exists in the list.

const ChargeTraits& OSB_LIB::ChargeTraitsList::getChargeTraits ( const ChargeTraits::Oid id  )  const

Get a charge traits based on the given charge traits id.

Parameters:
id Id of the charge traits.
Returns:
Reference to the charge traits.
Exceptions:
ObjectNotFound (315) if charge traits can not be found.

void OSB_LIB::ChargeTraitsList::getChargeTraits ( OSB_DB::Session session,
ChargeTraits ct 
)

Find charge traits or create in database.

Parameters:
session Database session to use, pending transactions are commited or, if insertion fails, rolled back.
ct Charge traits to insert.
Use find(ChargeTraits& ct) if you do not want commited database transactions if the charge traits alreay exist.

const List& OSB_LIB::ChargeTraitsList::list (  )  const [inline]

Access to the list of charge traits.

Definition at line 366 of file chargetraits.h.

References list_.

long OSB_LIB::ChargeTraitsList::read ( const OSB_DB::Session session  ) 

Read all charge traits from the database.

Parameters:
session Database session to use, transactions are not commited.
Returns:
Number of charge traits read.

bool OSB_LIB::ChargeTraitsList::remove ( OSB_DB::Session session,
ChargeTraits ct 
)

Remove a charge traits from the list.

SizeType OSB_LIB::ChargeTraitsList::size (  )  const [inline]

The size of the list.

Definition at line 390 of file chargetraits.h.

References list_.


Member Data Documentation

List OSB_LIB::ChargeTraitsList::list_ [private]

The STL container with the charge traits id and charge traits object.

Definition at line 485 of file chargetraits.h.

Referenced by begin(), end(), find(), list(), and size().


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