Some system-supplied interface functions are not members of any class but are global C++ functions. These functions are
Functions
When a persistent object is deleted using ::operator delete(), the database in which it is to be stored must be opened by the process performing the deletion, and this process must have a transaction in progress.
Required header file
All ObjectStore programs must include the header file <ostore/ostore.hh>. void ::operator delete()
Deletes the specified object from storage. The argument must point to the beginning of an object's storage. If it points to the middle of an object, the exception err_invalid_deletion is signaled. This might happen, for example, if the argument points to the fifth element of a persistent array, or if the argument has been cast from a D* to a B*, where class D is derived directly from class B and another class. ::operator new()
ObjectStore provides overloadings of ::operator new() for allocating persistent or transient storage, using the following syntax: Syntax
void* ::operator new(size_t, clustering_info, typespec, elements)The arguments have the following meanings:
void *::operator new(size_t, os_database*,
os_typespec*[, os_int32])
If this form is used, a newly created object of the type specified by the os_typespec is stored in the specified database. If the transient database (see os_database::get_transient_database()) is specified, the new object is transiently allocated. If you specify the transient database, you can supply 0 for the os_typespec* argument. If you are allocating for an array objects, use the argument os_int32 (a signed 32-bit integer type) to specify the number of elements.
void *::operator new(size_t, os_segment*, os_typespec*[, os_int32])If this form is used, a newly created object of the type specified by the os_typespec is stored in the specified segment unless that segment is the schema segment, in which case err_misc is signaled. If the transient segment (see os_segment::get_transient_segment()) is specified, the new object is transiently allocated. If you specify the transient segment, you can supply 0 for the os_typespec* argument. If you are allocating for an array of objects, use the argument os_int32 (a signed 32-bit integer type) to specify the number of elements.
void *::operator new(size_t, os_cluster*, os_typespec*[, os_int32])If this form is used, a newly created object of the type specified by the os_typespec is stored in the specified cluster unless the new object does not fit in the cluster, in which case err_cluster_full is signaled. If this argument is the address of transient memory, the new object is transiently allocated. If you are allocating transient storage, you can supply 0 for the os_typespec* argument. If you are allocating for an array objects, use the argument os_int32 (a signed 32-bit integer type) to specify the number of elements.
void *::operator new(size_t, os_cluster::with(),
os_typespec* [, os_int32])
If this form is used, a newly created object of the type specified by the os_typespec is stored as close as possible to the object specified as the argument to os_cluster::with(); see os_cluster::with(). If the transient segment (see os_cluster::get_transient_cluster()) is specified, the new object is transiently allocated. If you specify the transient cluster, you can supply 0 for the os_typespec* argument. If you are allocating for an array objects, use the argument os_int32 (a signed 32-bit integer type) to specify the number of elements.a_class *obj2 = new(os_cluster::with(obj1), a_typespec) a_class;
template < class T >
void* operator new (
size_t,
const os_Allocator<T>&,
void *hint = 0
);
For use with the ObjectStore allocator framework. Calls os_Allocator<T>::allocate(1, hint).
template < class T >
void* operator new (
size_t,
const os_Allocator<T>&,
size_t number_of_elements,
void *hint = 0
);
For use with the ObjectStore allocator framework. Calls os_Allocator<T>::allocate(number_of_elements, hint).
template < class T >
os_boolean operator==(
const os_Allocator<T>&,
const os_Allocator<T>&
);
Returns nonzero if the extended allocators associated with the specified allocators can safely be used to allocate objects of the same type; returns 0 otherwise. If the corresponding comparison operator for extended allocators is not implemented by the allocator implementer, this function always returns 0.
os_boolean operator==(
const os_extended_allocator&,
const os_extended_allocator&
)
Returns nonzero if the specified extended allocators can safely be used to allocate objects of the same type; returns 0 otherwise. If not defined by the derived type, this function always returns 0.
os_boolean operator==(
const os_string& str_left,
const os_string& str_right
) ;
Returns nonzero if the strings encapsulate character arrays for which strcmp() returns 0; returns 0 otherwise.
os_boolean operator==(
const char* ch_str_left,
const os_string& str_right
) ;
Returns nonzero if strcmp() returns 0 for str_left and the character-array value of str_right; returns 0 otherwise.
os_boolean operator==(
const os_string& str_left,
const char* ch_str_right
) ;
Returns nonzero if strcmp() returns 0 for str_left and the character-array value of str_left; returns 0 otherwise.
template < class T >
os_boolean operator!=(
const os_Allocator<T>&,
const os_Allocator<T>&
);
Returns nonzero if the extended allocators associated with the specified allocators cannot safely be used to allocate objects of the same type; returns 0 otherwise. If the corresponding comparison operator for extended allocators is not implemented by the allocator implementer, this function always returns 1.
os_boolean operator!=(
const os_extended_allocator&,
const os_extended_allocator&
)
Returns nonzero if the specified extended allocators cannot safely be used to allocate objects of the same type; returns 0 otherwise. If not defined for the derived type, this function always returns 0.
os_boolean operator!=(
const os_string& str_left,
const os_string& str_right
) ;
Returns nonzero if the strings encapsulate character arrays for which strcmp() returns nonzero; returns 0 otherwise.
os_boolean operator!=(
const char* ch_str_left,
const os_string& str_right
) ;
Returns nonzero if strcmp() returns nonzero for str_left and the character-array value of str_right; returns 0 otherwise.
os_boolean operator!=(
const os_string& str_left,
const char* ch_str_right
) ;
Returns nonzero if strcmp() returns 0 for str_left and the character-array value of str_left; returns 0 otherwise.
void *os_fetch(
const void* obj,
const os_member_variable& mem,
void *&val
);
Retrieves the value of the member represented by mem for the object obj by setting val to a reference to the value. err_mop is signaled if the value type of the specified member is not compatible with val.
unsigned long os_fetch(
const void* obj,
const os_member_variable& mem,
unsigned long &val
);
Retrieves the value of the member represented by mem for the object obj by setting val to a reference to the value. err_mop is signaled if the value type of the specified member is not compatible with val.
long os_fetch(
const void* obj,
const os_member_variable& mem,
long &val
);
Retrieves the value of the member represented by mem for the object obj by setting val to a reference to the value. err_mop is signaled if the value type of the specified member is not compatible with val.
unsigned int os_fetch(
const void* obj,
const os_member_variable& mem,
unsigned int &val
);
Retrieves the value of the member represented by mem for the object obj by setting val to a reference to the value. err_mop is signaled if the value type of the specified member is not compatible with val.
int os_fetch(
const void* obj,
const os_member_variable& mem,
int &val
);
Retrieves the value of the member represented by mem for the object obj by setting val to a reference to the value. err_mop is signaled if the value type of the specified member is not compatible with val.
unsigned short os_fetch(
const void* obj,
const os_member_variable& mem,
unsigned short &val
);
Retrieves the value of the member represented by mem for the object obj by setting val to a reference to the value. err_mop is signaled if the value type of the specified member is not compatible with val.
short os_fetch(
const void* obj,
const os_member_variable& mem,
short &val
);
Retrieves the value of the member represented by mem for the object obj by setting val to a reference to the value. err_mop is signaled if the value type of the specified member is not compatible with val.
unsigned char os_fetch(
const void* obj,
const os_member_variable& mem,
unsigned char &val
);
Retrieves the value of the member represented by mem for the object obj by setting val to a reference to the value. err_mop is signaled if the value type of the specified member is not compatible with val.
char os_fetch(
const void* obj,
const os_member_variable& mem,
char &val
);
Retrieves the value of the member represented by mem for the object obj by setting val to a reference to the value. err_mop is signaled if the value type of the specified member is not compatible with val.
float os_fetch(
const void* obj,
const os_member_variable& mem,
float &val
);
Retrieves the value of the member represented by mem for the object obj by setting val to a reference to the value. err_mop is signaled if the value type of the specified member is not compatible with val.
double os_fetch(
const void* obj,
const os_member_variable& mem,
double &val
);
Retrieves the value of the member represented by mem for the object obj by setting val to a reference to the value. err_mop is signaled if the value type of the specified member is not compatible with val.
long double os_fetch(
const void* obj,
const os_member_variable& mem,
long double &val
);
Retrieves the value of the member represented by mem for the object obj by setting val to a reference to the value. err_mop is signaled if the value type of the specified member is not compatible with val.
void *os_fetch_address(
void *obj,
const os_member_variable& mem
);
Retrieves the address of the data member mem for the object pointed to by obj. err_mop is signaled if mem is an os_field_member_variable.
void *os_fetch_address(
void *obj,
const os_base_class &b
);
Retrieves the address of the subobject corresponding to base class b for the object pointed to by obj.
void os_store(
void* obj,
const os_member_variable& mem,
const void *val
);
Establishes val as the value of the member represented by mem for the object obj. err_mop is signaled if the value type of the specified member is not compatible with val.
void os_store(
void* obj,
const os_member_variable& mem,
const unsigned long val
);
Establishes val as the value of the member represented by mem for the object obj. err_mop is signaled if the value type of the specified member is not compatible with val.
void os_store(
void* obj,
const os_member_variable& mem,
const long val
);
Establishes val as the value of the member represented by mem for the object obj. err_mop is signaled if the value type of the specified member is not compatible with val.
void os_store(
void* obj,
const os_member_variable& mem,
const unsigned int val
);
Establishes val as the value of the member represented by mem for the object obj. err_mop is signaled if the value type of the specified member is not compatible with val.
void os_store(
void* obj,
const os_member_variable& mem,
const int val
);
Establishes val as the value of the member represented by mem for the object obj. err_mop is signaled if the value type of the specified member is not compatible with val.
void os_store(
void* obj,
const os_member_variable& mem,
const unsigned short val
);
Establishes val as the value of the member represented by mem for the object obj. err_mop is signaled if the value type of the specified member is not compatible with val.
void os_store(
void* obj,
const os_member_variable& mem,
const short val
);
Establishes val as the value of the member represented by mem for the object obj. err_mop is signaled if the value type of the specified member is not compatible with val.
void os_store(
void* obj,
const os_member_variable& mem,
const unsigned char val
);
Establishes val as the value of the member represented by mem for the object obj. err_mop is signaled if the value type of the specified member is not compatible with val.
void os_store(
void* obj,
const os_member_variable& mem,
const char val
);
Establishes val as the value of the member represented by mem for the object obj. err_mop is signaled if the value type of the specified member is not compatible with val.
void os_store(
void* obj,
const os_member_variable& mem,
const float val
);
Establishes val as the value of the member represented by mem for the object obj. err_mop is signaled if the value type of the specified member is not compatible with val.
void os_store(
void* obj,
const os_member_variable& mem,
const double val
);
Establishes val as the value of the member represented by mem for the object obj. err_mop is signaled if the value type of the specified member is not compatible with val.
void os_store(
void* obj,
const os_member_variable& mem,
const long double val
);
Establishes val as the value of the member represented by mem for the object obj. err_mop is signaled if the value type of the specified member is not compatible with val.
Updated: 03/15/99 16:44:18