rasdaman complete source
Classes | Public Member Functions | Protected Attributes | List of all members
r_Collection< T > Singleton Reference

#include <collection.hh>

Inheritance diagram for r_Collection< T >:
r_Object r_Set< T >

Classes

struct  CNode
 

Public Member Functions

 r_Collection () throw (r_Error)
 default constructor More...
 
 r_Collection (const r_Collection< T > &collection) throw (r_Error)
 copy constructor More...
 
virtual ~r_Collection ()
 virtual destructor More...
 
virtual void r_deactivate ()
 it is called when an object leaves transient memory More...
 
unsigned long cardinality () const
 get number of elements More...
 
int is_empty () const
 tells if the collection is empty or not More...
 
int is_ordered () const
 tells if the collection is ordered or not More...
 
int allows_duplicates () const
 tells if the collections allowes duplicates or not More...
 
int contains_element (const T &element) const
 asks about the containment of a specific element More...
 
virtual void insert_element (const T &element, int no_modification=0)
 inserts an alement at the beginning More...
 
virtual void remove_element (const T &element)
 removes an element More...
 
void remove_all ()
 removes all elements More...
 
const r_Collection< T > & operator= (const r_Collection< T > &collection)
 assignment operator More...
 
r_Iterator< T > create_iterator ()
 create an iterator pointing at the first element in the collection More...
 
const r_Typeget_element_type_schema ()
 get base type schema More...
 
virtual void insert_obj_into_db ()
 insert myself into the database More...
 
virtual void insert_obj_into_db (const char *)
 inserts an object into a specific collection in the database More...
 
virtual void update_obj_in_db ()
 update myself More...
 
 r_Collection (const void *node1)
 constructor getting an internal collection representation More...
 
void * get_internal_representation () const
 
void set_internal_representation (const void *node1)
 
- Public Member Functions inherited from r_Object
 r_Object ()
 default constructor More...
 
 r_Object (unsigned short objType) throw (r_Error)
 constructor getting objType More...
 
 r_Object (const r_Object &, unsigned short objType=0) throw (r_Error)
 copy constructor More...
 
virtual ~r_Object ()
 virtual destructor More...
 
void mark_modified ()
 mark the object as modified More...
 
void * operator new (size_t size)
 new operator for transient objects More...
 
void * operator new (size_t size, r_Database *database, const char *type_name=0)
 new operator for persistent objects More...
 
void * operator new (size_t size, const char *type_name)
 new operator for transient objects carrying type information More...
 
void operator delete (void *obj_ptr)
 delete operator More...
 
void set_type_by_name (const char *name) throw (r_Error)
 set object type by name More...
 
void set_type_structure (const char *name) throw (r_Error)
 set object type by name More...
 
const char * get_type_name () const
 get object type name More...
 
const char * get_type_structure () const
 get object type structure More...
 
const r_OIdget_oid () const
 get oid More...
 
const r_Typeget_type_schema ()
 get type schema More...
 
void set_type_schema (const r_Type *type) throw (r_Error)
 
virtual void load_obj_from_db ()
 load an object from the database More...
 
void delete_obj_from_db ()
 deletes an object from the database More...
 
void initialize_oid (const r_OId &initOId)
 initialize oid of the object More...
 
virtual void r_activate ()
 it is called when an object comes into transient memory More...
 
int test_status (ObjectStatus status)
 test object status returns 1 if it matches More...
 
ObjectStatus get_status () const
 gets the status of the object More...
 
void set_object_name (const char *name) throw (r_Error)
 set object name. object name should contain only [a-zA-Z0-9_] More...
 
const char * get_object_name () const
 get object name More...
 
void * operator new (size_t size, r_Database *database, ObjectStatus status, const r_OId &oid)
 new operator for activating an object (status = read) More...
 

Protected Member Functions

void add_node (CNode *&root, const T &element)
 
int remove_node (CNode *&root, const T &element)
 
void remove_all_nodes (CNode *&root)
 
void init_node_list (CNode *&root)
 
- Protected Member Functions inherited from r_Object
int test_type (ObjectType type)
 test object type returns 1 if it matches More...
 

Protected Attributes

CNodecoll
 pointer to collection elements More...
 
int isOrdered
 
int allowsDuplicates
 
unsigned long card
 
- Protected Attributes inherited from r_Object
char * object_name
 stores object name if it has one More...
 
char * type_name
 stores object type name if it has one More...
 
char * type_structure
 store type structure as string if it has one More...
 
r_Typetype_schema
 pointer to type schema (built on request) More...
 
unsigned short internal_obj_type
 internal object type (1 marray, 2 collection) More...
 
CNoderemoved_objects
 pointer to list of removed elements More...
 
r_Iterator< T > create_removed_iterator ()
 create an iterator for removed objects More...
 

Additional Inherited Members

- Public Types inherited from r_Object
enum  ObjectStatus {
  no_status, deleted, created, modified,
  read, transient
}
 object life status More...
 
enum  ObjectType { no_object, persistent_object, transient_object }
 object types More...
 

Constructor & Destructor Documentation

template<class T>
r_Collection< T >::r_Collection ( )
throw (r_Error
)

default constructor

template<class T>
r_Collection< T >::r_Collection ( const r_Collection< T > &  collection)
throw (r_Error
)

copy constructor

template<class T>
virtual r_Collection< T >::~r_Collection ( )
virtual

virtual destructor

template<class T>
r_Collection< T >::r_Collection ( const void *  node1)

constructor getting an internal collection representation

Member Function Documentation

template<class T>
void r_Collection< T >::add_node ( CNode *&  root,
const T &  element 
)
protected
template<class T>
int r_Collection< T >::allows_duplicates ( ) const
inline

tells if the collections allowes duplicates or not

template<class T>
unsigned long r_Collection< T >::cardinality ( ) const
inline

get number of elements

template<class T>
int r_Collection< T >::contains_element ( const T &  element) const

asks about the containment of a specific element

template<class T>
r_Iterator<T> r_Collection< T >::create_iterator ( )

create an iterator pointing at the first element in the collection

template<class T>
r_Iterator<T> r_Collection< T >::create_removed_iterator ( )
protected

create an iterator for removed objects

template<class T>
const r_Type* r_Collection< T >::get_element_type_schema ( )

get base type schema

template<class T>
void* r_Collection< T >::get_internal_representation ( ) const
inline
template<class T>
void r_Collection< T >::init_node_list ( CNode *&  root)
protected
template<class T>
virtual void r_Collection< T >::insert_element ( const T &  element,
int  no_modification = 0 
)
virtual

inserts an alement at the beginning

Reimplemented in r_Set< T >, r_Set< GenRefElement * >, r_Set< r_GMarray * >, and r_Set< r_Ref< r_Object > >.

template<class T>
virtual void r_Collection< T >::insert_obj_into_db ( )
virtual

insert myself into the database

Implements r_Object.

template<class T>
virtual void r_Collection< T >::insert_obj_into_db ( const char *  )
inlinevirtual

inserts an object into a specific collection in the database

Implements r_Object.

template<class T>
int r_Collection< T >::is_empty ( ) const
inline

tells if the collection is empty or not

template<class T>
int r_Collection< T >::is_ordered ( ) const
inline

tells if the collection is ordered or not

template<class T>
const r_Collection<T>& r_Collection< T >::operator= ( const r_Collection< T > &  collection)

assignment operator

template<class T>
virtual void r_Collection< T >::r_deactivate ( )
virtual

it is called when an object leaves transient memory

Reimplemented from r_Object.

template<class T>
void r_Collection< T >::remove_all ( )

removes all elements

template<class T>
void r_Collection< T >::remove_all_nodes ( CNode *&  root)
protected
template<class T>
virtual void r_Collection< T >::remove_element ( const T &  element)
virtual

removes an element

The method inserts an element into the collection. If { no_modification} is set, the { mark_modified()} method of r_Object is not invoked and, therefore, a modification will not be recognized at the commit point.

template<class T>
int r_Collection< T >::remove_node ( CNode *&  root,
const T &  element 
)
protected
template<class T>
void r_Collection< T >::set_internal_representation ( const void *  node1)
template<class T>
virtual void r_Collection< T >::update_obj_in_db ( )
virtual

update myself

The method has no functionality in this class. It supposed to be removed in future.

Reimplemented from r_Object.

Member Data Documentation

template<class T>
int r_Collection< T >::allowsDuplicates
protected
template<class T>
unsigned long r_Collection< T >::card
protected
template<class T>
CNode* r_Collection< T >::coll
protected

pointer to collection elements

template<class T>
int r_Collection< T >::isOrdered
protected
template<class T>
CNode* r_Collection< T >::removed_objects
protected

pointer to list of removed elements


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