rasdaman complete source
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
MDDColl Class Reference

#include <mddcoll.hh>

Public Member Functions

 MDDColl (const CollectionType *newType, const char *name=0)
 transient collection More...
 
void printStatus (unsigned int level=0, ostream &stream=cout) const
 
const CollectionTypegetCollectionType () const
 
unsigned long getCardinality () const
 
bool getOId (OId &pOId) const
 
bool getEOId (EOId &pEOId) const
 
void insert (const MDDObj *newObj)
 
MDDCollItercreateIterator () const
 
void remove (const MDDObj *obj)
 
void removeAll ()
 
void releaseAll ()
 
bool isPersistent () const
 
const char * getName () const
 
 ~MDDColl ()
 

Static Public Member Functions

static MDDCollgetMDDCollection (const char *collName) throw (r_Error)
 
static MDDCollgetMDDCollection (const OId &collOId) throw (r_Error)
 
static MDDCollcreateMDDCollection (const char *name, const CollectionType *ct) throw (r_Error)
 
static MDDCollcreateMDDCollection (const char *name, const OId &o, const CollectionType *ct) throw (r_Error)
 
static bool dropMDDCollection (const char *name)
 
static bool dropMDDCollection (const OId &id)
 
static bool removeMDDObject (const OId &coll, const OId &id)
 

Static Public Attributes

static const char * AllCollectionnamesName
 

Protected Types

typedef std::map< DBMDDObj
*, MDDObj *, std::less
< DBMDDObj * > > 
MDDObjMap
 

Protected Member Functions

MDDObjgetMDDObj (const DBMDDObj *) const
 
 MDDColl (const DBMDDSetId &coll)
 
DBMDDSetId getDBMDDSet () const
 
void insertIntoCache (const MDDObj *objToInsert) const
 

Protected Attributes

DBMDDSetId dbColl
 
MDDObjMap mddCache
 

Member Typedef Documentation

typedef std::map<DBMDDObj*, MDDObj*, std::less<DBMDDObj*> > MDDColl::MDDObjMap
protected

Pointer to the actual class stored in the base DBMS. Based on the Base DBMS DBMDDSet class from relmddif.

Constructor & Destructor Documentation

MDDColl::MDDColl ( const CollectionType newType,
const char *  name = 0 
)

transient collection

MDDColl::~MDDColl ( )
MDDColl::MDDColl ( const DBMDDSetId coll)
protected

Will get from cache/instantiate and return an MDDObj. Instantiation: it will just create a new one if isPersistent() == true -> passing it a oid that does not belong to the collection -> problem.

Member Function Documentation

MDDCollIter* MDDColl::createIterator ( ) const

Inserts reference to MDD object into the collection. If the type of the object (transient/persistent) does not fit the collection an exception is thrown.

static MDDColl* MDDColl::createMDDCollection ( const char *  name,
const CollectionType ct 
)
throw (r_Error
)
static

Retrieve a mdd collection from database. Throws r_Error::r_Error_ObjectUnknown if the oid is unknown.

static MDDColl* MDDColl::createMDDCollection ( const char *  name,
const OId o,
const CollectionType ct 
)
throw (r_Error
)
static

Throws r_Error::r_Error_NameNotUnique if the name exists already or is NULL.

static bool MDDColl::dropMDDCollection ( const char *  name)
static

Throws r_Error::r_Error_NameNotUnique if the name exists already or is NULL. Throws r_Error::r_Error_OIdNotUnique if the oid exists already.

static bool MDDColl::dropMDDCollection ( const OId id)
static

Delete a mdd collection from database. Returns false if the name is unknown.

unsigned long MDDColl::getCardinality ( ) const

Returns the type of this MDD collection.

const CollectionType* MDDColl::getCollectionType ( ) const

Prints current status of the MDD Collection.

DBMDDSetId MDDColl::getDBMDDSet ( ) const
protected
bool MDDColl::getEOId ( EOId pEOId) const

Returns true if collection has an OId.

static MDDColl* MDDColl::getMDDCollection ( const char *  collName)
throw (r_Error
)
static
static MDDColl* MDDColl::getMDDCollection ( const OId collOId)
throw (r_Error
)
static

Retrieve a mdd collection from database. Throws r_Error::r_Error_ObjectUnknown if the name is unknown.

MDDObj* MDDColl::getMDDObj ( const DBMDDObj ) const
protected
const char* MDDColl::getName ( ) const

Tells if collection is persistent.

bool MDDColl::getOId ( OId pOId) const

Returns the cardinality of the collection.

void MDDColl::insert ( const MDDObj newObj)

Returns true0 if collection has an EOId.

void MDDColl::insertIntoCache ( const MDDObj objToInsert) const
protected

Return the reference to the actual persistent object in the base DBMS. returned reference must be const -> impossible

bool MDDColl::isPersistent ( ) const

Releases all dynamic memory allocated for the current collection. This method has to be called explicitely, since the destructor doesn't deallocate memory for the elements of the collection. The reason for this is to allow the user to use MDDObjs from this collection, even after the collection itself is no longer in main memory. This is only true for transient collections.

void MDDColl::printStatus ( unsigned int  level = 0,
ostream &  stream = cout 
) const

Remove an mdd object from the collection. Returns always true.

void MDDColl::releaseAll ( )

Empties the current collection by removing all references to MDD objects from it. The objects are not obligatorily destroyed from the storage domain where they exist.

void MDDColl::remove ( const MDDObj obj)

Creates a new iterator for this collection. Returns a pointer to the new allocated iterator object. Returned pointer must be freed afterwards.

void MDDColl::removeAll ( )

Remove reference to MDD object from the current collection. The object itself is not obligatorily destroyed from the storage domain where it exists. If the object does not live in the collection nothing is done.

static bool MDDColl::removeMDDObject ( const OId coll,
const OId id 
)
static

Delete a mdd collection from database. Returns false if the oid is unknown.

Member Data Documentation

const char* MDDColl::AllCollectionnamesName
static
DBMDDSetId MDDColl::dbColl
protected

Insert persistent MDD object in the internal cache.

MDDObjMap MDDColl::mddCache
mutableprotected

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