rasdaman client API 10.6.3
The Array Analytics Engine: Datacubes at Your Fingertips
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
r_Collection< T > Class Template Reference

Basic class of a collection. More...

#include <collection.hh>

Inheritance diagram for r_Collection< T >:
r_Object r_Set< r_GMarray * > r_Set< r_Ref< r_Object > > r_Set< GenRefElement * > r_Set< T >

Classes

struct  CNode
 

Public Member Functions

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

Protected Member Functions

r_Iterator< T > create_removed_iterator ()
 create an iterator for removed objects
 
void add_node (CNode *&root, const T &element)
 
bool 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
void update_transaction ()
 resets to the global r_Transaction::actual_transaction if necessary
 
bool test_type (ObjectType type)
 test object type returns 1 if it matches
 

Protected Attributes

CNoderemoved_objects
 pointer to list of removed elements
 
int isOrdered
 
int allowsDuplicates
 
unsigned long card
 
CNodecoll
 pointer to collection elements
 
- Protected Attributes inherited from r_Object
char * object_name {0}
 stores object name if it has one
 
char * type_name {0}
 stores object type name if it has one
 
char * type_structure {0}
 store type structure as string if it has one
 
r_Typetype_schema {0}
 pointer to type schema (built on request)
 
unsigned short internal_obj_type {0}
 internal object type (1 marray, 2 collection)
 
r_Transactiontransaction {NULL}
 pointer to the transaction this object belongs to.
 

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 }
 created - The object was created in the current transaction and has to be stored in the database. More...
 

Detailed Description

template<class T>
class r_Collection< T >

Basic class of a collection.

Possible subclasses are r_Set. The protected members isOrdered and allowsDuplicates are not initialized here, they have to be initialized in the respective subclasses.

Constructor & Destructor Documentation

◆ r_Collection() [1/2]

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

default constructor

◆ r_Collection() [2/2]

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

copy constructor

◆ ~r_Collection()

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

virtual destructor

Member Function Documentation

◆ add_node()

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

◆ allows_duplicates()

template<class T >
bool r_Collection< T >::allows_duplicates ( ) const

tells if the collections allowes duplicates or not

◆ cardinality()

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

get number of elements

◆ contains_element()

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

asks about the containment of a specific element

◆ create_iterator()

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

create an iterator pointing at the first element in the collection

◆ create_removed_iterator()

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

create an iterator for removed objects

◆ get_element_type_schema()

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

get base type schema

◆ init_node_list()

template<class T >
void r_Collection< T >::init_node_list ( CNode *&  root)
protected

◆ insert_element()

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 >.

◆ insert_obj_into_db() [1/2]

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

insert myself into the database

Implements r_Object.

◆ insert_obj_into_db() [2/2]

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.

◆ is_empty()

template<class T >
bool r_Collection< T >::is_empty ( ) const

tells if the collection is empty or not

◆ is_ordered()

template<class T >
bool r_Collection< T >::is_ordered ( ) const

tells if the collection is ordered or not

◆ operator=()

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

assignment operator

◆ r_deactivate()

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

it is called when an object leaves transient memory

Reimplemented from r_Object.

◆ remove_all()

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

removes all elements

◆ remove_all_nodes()

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

◆ remove_element()

template<class T >
virtual void r_Collection< T >::remove_element ( const T &  element)
virtual

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. removes an element

◆ remove_node()

template<class T >
bool r_Collection< T >::remove_node ( CNode *&  root,
const T &  element 
)
protected

◆ update_obj_in_db()

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

The method has no functionality in this class.

It supposed to be removed in future. update myself

Reimplemented from r_Object.

Member Data Documentation

◆ allowsDuplicates

template<class T >
int r_Collection< T >::allowsDuplicates
protected

◆ card

template<class T >
unsigned long r_Collection< T >::card
protected

◆ coll

template<class T >
CNode* r_Collection< T >::coll
protected

pointer to collection elements

◆ isOrdered

template<class T >
int r_Collection< T >::isOrdered
protected

◆ removed_objects

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

pointer to list of removed elements


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