Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

d_Extent< T > Class Template Reference

#include <d_Extent.h>

List of all members.

Public Methods

 d_Extent (const d_Database *iDb, d_Boolean iSubClasses=d_True)
 ~d_Extent ()
unsigned long cardinality () const
d_Boolean is_empty () const
d_Boolean allows_duplicates () const
d_Boolean is_ordered () const
d_Iterator< d_Ref< T > > create_iterator ()
d_Iterator< d_Ref< T > > begin ()
d_Iterator< d_Ref< T > > end ()
d_Ref< T > select_element (const char *iTextQuery) const
d_Iterator< d_Ref< T > > select (const char *iTextQuery)
void deleteObjects (const char *iTextQuery)
unsigned long count (const char *iTextQuery)
int query (d_Collection< d_Ref< T > > &iColl, const char *iTextQuery) const
d_Boolean exists_element (const char *iTextQuery) const
void setQueryEngine (const char *iQueryEngineName)

Protected Methods

 d_Extent (const d_Extent< T > &iSource)
d_Extent< T > & operator= (const d_Extent< T > &iSource)


Detailed Description

template<class T>
class d_Extent< T >

The class Extent is a virtual collection of all objects of a class updated automatically by the Orient engine.

QUERIES: Making a query on an Extent means to query all the objects of a class.

LOCATION: d_Extent.h

USAGE: d_Extent< <pers-class-name> > <variable-name>;

Where:

<pers-class-name>: persistent class to use <variable-name>: is the name of d_Extent object

EXAMPLES: d_Ref<Customer> objCustomer; d_Iterator< d_Ref<Customer> > itCustomer; d_Extent<Customer> customers( &db );

itCustomer = customers.select( "Customer.code = 1" );

while( itCustomer.next( objCustomer ) ) { * DISPLAY OBJECT printf( "......: d", objCustomer->code ); printf( "......: s", objCustomer->name.c_str() ); printf( "...: s", objCustomer->surname.c_str() ); printf( ".......: d", objCustomer->age ); printf( ".....: s", objCustomer->notes.c_str() ); }

SEE ALSO: d_Iterator

ODMG: Compliant


Constructor & Destructor Documentation

template<class T>
d_Extent< T >::d_Extent const d_Database   iDb,
d_Boolean    iSubClasses = d_True
 

Create an d_Extent object.

Creates an extent for class specified as template argument (<> bracets) of database . Parameter is not used but available for ODMG compatibility.

ODMG : Compliant

template<class T>
d_Extent< T >::~d_Extent  
 

Destructor.

ODMG : Compliant

template<class T>
d_Extent< T >::d_Extent const d_Extent< T > &    iSource [protected]
 


Member Function Documentation

template<class T>
d_Boolean d_Extent< T >::allows_duplicates   const [inline]
 

Returns always false. It's maintained for compatibility with collection classes.

ODMG : Compliant

template<class T>
d_Iterator< d_Ref<T> > d_Extent< T >::begin  
 

Creates an iterator that points to the first element of extent and returns it.

It works like create_iterator() member and is maintained for compatibility with C++ STL containers.

SEE ALSO: d_Iterator, create_iterator() ODMG : Compliant

template<class T>
unsigned long d_Extent< T >::cardinality   const
 

Returns total number of object in the extent.

This is equal to the total of objects present in the database for that class.

ODMG : Compliant

template<class T>
unsigned long d_Extent< T >::count const char *    iTextQuery
 

Counts the number of objects that matches the query predicate.

SEE ALSO: select(), cardinality() ODMG : Compliant

template<class T>
d_Iterator< d_Ref<T> > d_Extent< T >::create_iterator  
 

Creates an iterator that points to the first element of extent and returns it.

SEE ALSO: d_Iterator, begin() ODMG : Compliant

template<class T>
void d_Extent< T >::deleteObjects const char *    iTextQuery
 

Delete objects that satisfy query predicate.

is the text of query to execute.

SEE ALSO: select() ODMG : Extension

template<class T>
d_Iterator< d_Ref<T> > d_Extent< T >::end  
 

Creates an iterator that points to the last element of extent and returns it.

Is maintained for compatibility with C++ STL containers.

SEE ALSO: d_Iterator, begin() ODMG : Compliant

template<class T>
d_Boolean d_Extent< T >::exists_element const char *    iTextQuery const
 

Returns true if there is at least one object that matches the query predicate.

SEE ALSO: select_element(), select() ODMG : Compliant

template<class T>
d_Boolean d_Extent< T >::is_empty   const [inline]
 

Returns true if the extent doesn't contain objects.

ODMG : Compliant

template<class T>
d_Boolean d_Extent< T >::is_ordered   const [inline]
 

Returns always false. It's maintained for compatibility with collection classes.

ODMG : Compliant

template<class T>
d_Extent<T>& d_Extent< T >::operator= const d_Extent< T > &    iSource [protected]
 

template<class T>
int d_Extent< T >::query d_Collection< d_Ref< T > > &    iColl,
const char *    iTextQuery
const
 

SEE ALSO: d_Iterator, d_Ref, select_element() ODMG : Compliant

template<class T>
d_Iterator< d_Ref<T> > d_Extent< T >::select const char *    iTextQuery
 

Makes a query on the extent.

is the text of query to execute.

It returns an iterator that point to the first object that matches the query predicate. To browse the result set use d_Iterator object.

SEE ALSO: d_Iterator, d_Ref, select_element() ODMG : Compliant

template<class T>
d_Ref<T> d_Extent< T >::select_element const char *    iTextQuery const
 

Makes a query on the extent.

is the text of query to execute. It returns a reference to the object that matches the query predicate.

If more than one object matches the query, then only the first one object scanned is returned.

For best performance use this method instead of general select() method when the field of research is unique and doesn't contain duplicates. In this way the research will stop after the first, and unique, match.

SEE ALSO: d_Ref, select() ODMG : Compliant

template<class T>
void d_Extent< T >::setQueryEngine const char *    iQueryEngineName
 

Set query language engine. This allow the user to change the language for query at run-time just calling this method.

Query engine must be previously registered in the oQueryEngineManager object taken by oQueryEngineManager::getInstance() method.

SEE ALSO: oQueryEngineManager ODMG : Extension


The documentation for this class was generated from the following file:
Generated on Fri Nov 29 17:12:14 2002 for Orient ODBMS Just Edition v. 2.0e by doxygen1.3-rc1