rasdaman complete source
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
r_Object Class Referenceabstract

#include <object.hh>

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

Public Member Functions

 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)
 

Protected Member Functions

int test_type (ObjectType type)
 test object type returns 1 if it matches More...
 

Protected Attributes

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...
 
enum  ObjectStatus {
  no_status, deleted, created, modified,
  read, transient
}
 object life status More...
 
enum  ObjectType { no_object, persistent_object, transient_object }
 object types More...
 
virtual void insert_obj_into_db ()=0
 inserts an object into the database More...
 
virtual void insert_obj_into_db (const char *)=0
 inserts an object into a specific collection in the database More...
 
virtual void update_obj_in_db ()
 updates an object in database More...
 
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...
 
virtual void r_deactivate ()
 it is called when an object leaves 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...
 

Constructor & Destructor Documentation

r_Object::r_Object ( )

default constructor

r_Object::r_Object ( unsigned short  objType)
throw (r_Error
)

constructor getting objType

r_Object::r_Object ( const r_Object ,
unsigned short  objType = 0 
)
throw (r_Error
)

copy constructor

{ objType} specifies the type of the object (1=Marray, 2=Collection). This is needed for oid allocation and propably dropped in future.

virtual r_Object::~r_Object ( )
virtual

virtual destructor

{ objType} specifies the type of the object (1=Marray, 2=Collection). This is needed for oid allocation and propably dropped in future.

Member Function Documentation

const r_OId& r_Object::get_oid ( ) const
inline

get oid

const char* r_Object::get_type_name ( ) const
inline

get object type name

const r_Type* r_Object::get_type_schema ( )

get type schema

const char* r_Object::get_type_structure ( ) const
inline

get object type structure

void r_Object::mark_modified ( )
inline

mark the object as modified

void r_Object::operator delete ( void *  obj_ptr)

delete operator

void* r_Object::operator new ( size_t  size)

new operator for transient objects

void* r_Object::operator new ( size_t  size,
r_Database database,
const char *  type_name = 0 
)

new operator for persistent objects

void* r_Object::operator new ( size_t  size,
const char *  type_name 
)

new operator for transient objects carrying type information

void r_Object::set_type_by_name ( const char *  name)
throw (r_Error
)
inline

set object type by name

void r_Object::set_type_schema ( const r_Type type)
throw (r_Error
)
void r_Object::set_type_structure ( const char *  name)
throw (r_Error
)
inline

set object type by name

With this method a type name has to be given by the user for each object which he wants to make persistent. The type name is the name introduced in the RasDL file. If an object without a valid type name is made persistent, an error occurs while committing the transaction.

NOTE: This method is updated. Use { void* operator new( size_t size, r_Database database, const char type_name )} instead.

int r_Object::test_type ( ObjectType  type)
protected

test object type returns 1 if it matches

Member Data Documentation

unsigned short r_Object::internal_obj_type
protected

internal object type (1 marray, 2 collection)

char* r_Object::object_name
protected

stores object name if it has one

char* r_Object::type_name
protected

stores object type name if it has one

r_Type* r_Object::type_schema
protected

pointer to type schema (built on request)

char* r_Object::type_structure
protected

store type structure as string if it has one


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