Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

RefList< T > Class Template Reference

Template that acts as persistent list of references to persistent objects. Example of user defined persistent data type. More...

#include <RefList.h>

Collaboration diagram for RefList< T >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef T value_type
typedef RefList_iterator< T > iterator
typedef const RefList_iterator<
T > 
const_iterator

Public Member Functions

 RefList ()
bool empty () const
iterator begin ()
iterator end ()
void push_front (const Ref< T > &value)
void pop_front ()
void clear ()
iterator insert_after (iterator it, const Ref< T > &value)
iterator erase_after (iterator it)
 RefList (const RefList< T > &)
RefList< T > & operator= (const RefList< T > &X)
OidType iopcExport (IopcPersistentObject *_owner)
void iopcImport (const OidType _head, IopcPersistentObject *_owner)

Protected Attributes

OidType head
Connectionconnection
IopcPersistentObjectowner

Detailed Description

template<class T>
class RefList< T >

Template that acts as persistent list of references to persistent objects. Example of user defined persistent data type.

Interface of this class is very similar to slist, single linked list implemented in STL extension STLPort (http://www.sgi.com/tech/stl/Slist.html).

All methods of this class and all methods of iterator RefList_iterator throws exception RefList_exception in case of error.


Member Typedef Documentation

template<class T>
typedef T RefList< T >::value_type
 

Value type - as in STL.

template<class T>
typedef RefList_iterator<T> RefList< T >::iterator
 

Iterator typedef - as in STL.

template<class T>
typedef const RefList_iterator<T> RefList< T >::const_iterator
 

Constant iterator typedef - as in STL.


Constructor & Destructor Documentation

template<class T>
RefList< T >::RefList  )  [inline]
 

Creates empty RefList<T>.

template<class T>
RefList< T >::RefList const RefList< T > &   )  [inline]
 

Copy constructor - throws RefList_exception. Suppresses generation of default copy constructor.


Member Function Documentation

template<class T>
bool RefList< T >::empty  )  const [inline]
 

Tests whether the list is empty.

template<class T>
iterator RefList< T >::begin  )  [inline]
 

Returns iterator pointing to the beginning of the list.

template<class T>
iterator RefList< T >::end  )  [inline]
 

Returns iterator pointing after the last element in the list.

template<class T>
void RefList< T >::push_front const Ref< T > &  value  )  [inline]
 

Adds value to the beginning of the list.

template<class T>
void RefList< T >::pop_front  )  [inline]
 

Removes first entry from the list.

template<class T>
void RefList< T >::clear  )  [inline]
 

Clears the list.

template<class T>
iterator RefList< T >::insert_after iterator  it,
const Ref< T > &  value
[inline]
 

Inserts value after the position specified by iterator.

Returns:
Iterator pointing to the inserted element.

template<class T>
iterator RefList< T >::erase_after iterator  it  )  [inline]
 

Removes element after the position specified by iterator from the list.

Returns:
Returns the element after the erased one.

template<class T>
RefList<T>& RefList< T >::operator= const RefList< T > &  X  )  [inline]
 

Operator = - throws RefList_exception. Suppresses generation of default operator =.

template<class T>
OidType RefList< T >::iopcExport IopcPersistentObject _owner  )  [inline]
 

Method called by IOPC LIB runtime if persistent object containing RefList<T> should be saved into the database.

Method returns the head of the list to be stored in the persistent object's table.

Parameters:
_owner Object that owns the RefList.
See also:
IopcPersistentObject::iopcExportAttributes().

template<class T>
void RefList< T >::iopcImport const OidType  _head,
IopcPersistentObject _owner
[inline]
 

Method called by IOPC LIB runtime if persistent object containing RefList<T> attribute is loaded from the database.

Method initializes the list according to given values.

Parameters:
_head OID of RefListEntry that is the head of this list (head is set according to it).
_owner Object that owns the RefList (connection and owner is set according to it).
See also:
IopcPersistentObject::iopcImportAttributes()


Member Data Documentation

template<class T>
OidType RefList< T >::head [protected]
 

Head of the list.

In user's persistent class's table is RefList<T> mapped to column containing lists' heads.

template<class T>
Connection* RefList< T >::connection [protected]
 

Connection used to retrieve list entries from the database.

template<class T>
IopcPersistentObject* RefList< T >::owner [protected]
 

Persistent object that owns this list. Needed to mark object as dirty if the list was changed.


The documentation for this class was generated from the following file:
Generated on Wed Aug 11 22:36:38 2004 for IOPC by Doxygen 1.3.6