90 void *
operator new(
size_t size);
96 void *
operator new(
size_t size,
const char *
type_name);
99 void operator delete(
void *obj_ptr);
251 static char *next_object_type_name;
254 static r_OId next_object_oid;
A database object must be instantiated and opened before starting any transaction which uses the data...
Definition: database.hh:60
Class r_OId represents an object identifier.
Definition: oid.hh:39
Through inheritance of this class, the type definer specifies that the subclass is capable of having ...
Definition: object.hh:62
r_Type * type_schema
pointer to type schema (built on request)
Definition: object.hh:225
virtual void insert_obj_into_db(const char *)=0
inserts an object into a specific collection in the database
const char * get_type_structure() const
get object type structure
void update_transaction()
resets to the global r_Transaction::actual_transaction if necessary
ObjectStatus
object life status
Definition: object.hh:136
@ no_status
Definition: object.hh:137
@ modified
Definition: object.hh:140
@ read
Definition: object.hh:141
@ created
Definition: object.hh:139
@ deleted
Definition: object.hh:138
const char * get_object_name() const
get object name
void set_object_name(const char *name)
set object name. object name should contain only [a-zA-Z0-9_]
void delete_obj_from_db()
deletes an object from the database
ObjectType
created - The object was created in the current transaction and has to be stored in the database.
Definition: object.hh:156
@ persistent_object
Definition: object.hh:158
@ no_object
Definition: object.hh:157
@ transient_object
Definition: object.hh:159
virtual ~r_Object()
objType specifies the type of the object (1=Marray, 2=Collection).
char * type_structure
store type structure as string if it has one
Definition: object.hh:222
char * object_name
stores object name if it has one
Definition: object.hh:216
unsigned short internal_obj_type
internal object type (1 marray, 2 collection)
Definition: object.hh:228
char * type_name
stores object type name if it has one
Definition: object.hh:219
void set_type_schema(const r_Type *type)
r_Object(const r_Object &, unsigned short objType=0, r_Transaction *transaction=NULL)
objType specifies the type of the object (1=Marray, 2=Collection).
void mark_modified()
mark the object as modified
virtual void update_obj_in_db()
updates an object in database
ObjectStatus get_status() const
gets the status of the object
void set_type_by_name(const char *name)
set object type by name
virtual void insert_obj_into_db()=0
inserts an object into the database
bool test_type(ObjectType type)
test object type returns 1 if it matches
virtual void r_activate()
it is called when an object comes into transient memory
Definition: object.hh:180
virtual void r_deactivate()
it is called when an object leaves transient memory
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 persi...
const r_OId & get_oid() const
get oid
r_Transaction * transaction
pointer to the transaction this object belongs to.
Definition: object.hh:232
r_Transaction * get_transaction() const
void initialize_oid(const r_OId &initOId)
initialize oid of the object
virtual void load_obj_from_db()
load an object from the database
r_Object(unsigned short objType, r_Transaction *transaction=NULL)
constructor getting objType
const r_Type * get_type_schema()
get type schema. returns NULL in case of error
bool test_status(ObjectStatus status)
test object status returns 1 if it matches
r_Object(r_Transaction *transaction=NULL)
default constructor
const char * get_type_name() const
get object type name
Transactions can be started, committed, aborted, and checkpointed.
Definition: transaction.hh:50
This class the superclass for all types in the ODMG conformant representation of the RasDaMan type sy...
Definition: type.hh:51