![]() |
rasdaman client API 10.6.3
The Array Analytics Engine: Datacubes at Your Fingertips
|
A database object must be instantiated and opened before starting any transaction which uses the database, and closed after ending these transactions. More...
#include <database.hh>
Public Types | |
| enum | access_status { not_open , read_write , read_only , exclusive } |
| possible database states More... | |
| enum | type_schema { CELL = 3 , MARRAY = 2 , COLLECTION = 1 } |
| possible types define by symbolic names More... | |
Public Member Functions | |
| r_Database () | |
| default constructor | |
| r_Database (const char *name) | |
| constructor getting the rasmgr name | |
| ~r_Database () | |
| One error situations can occur which raise an exception of type r_Error with one of the following kinds: r_Error_NameInvalid && Name is NULL. | |
| void | open (const char *database_name, access_status status=read_write) |
| open a database | |
| void | close () |
The method opens the database specified with database_name. | |
| void | create (const char *name) |
| create a database with fixed schema RasDaSchema | |
| void | destroy (const char *name) |
This method works only if a server host name has been specified with set_servername(). | |
| void | set_servername (const char *name, int port=DEFAULT_PORT) |
This method works only if a server host name has been specified with set_servername(). | |
| void | set_useridentification (const char *name, const char *plain_pass) |
| One of error situations can occur will raise an exception of type r_Error with one of the following kinds: r_Error_NameInvalid && Name is NULL. | |
| access_status | get_status () const |
| One of error situations can occur will raise an exception of type r_Error with one of the following kinds: r_Error_NameInvalid && Name is NULL. | |
| void | set_object_name (r_Object &obj, const char *name) |
| give a name to an object (signature is not ODMG conformant because of compiler bug) | |
| r_Ref_Any | lookup_object (const char *name) const |
The method gives the name to the object obj. | |
| r_Ref_Any | lookup_object (const r_OId &oid) const |
The method looks up an object with name. | |
| r_Type * | get_type_schema (const char *typeName, type_schema typetype) |
The method looks up an object with oid. | |
| void | set_transfer_format (r_Data_Format format, const char *formatParams=NULL) |
The method looks up the type structure with typeName as its name. | |
| void | set_storage_format (r_Data_Format format, const char *formatParams=NULL) |
| The method sets the transfer compression used for the communications of this client with the server. | |
| const r_OId | get_new_oid (unsigned short objType) const |
| void | insertColl (const char *collName, const char *typeName, const r_OId &oid) |
| void | removeObjFromColl (const char *name, const r_OId &oid) |
| removes an object from a collection | |
| ClientComm * | getComm () |
Static Public Attributes | |
| static r_Database * | actual_database |
| This method sets the storage format to use for MDD created by this client in the RasDaMan database. | |
A database object must be instantiated and opened before starting any transaction which uses the database, and closed after ending these transactions.
| r_Database::r_Database | ( | ) |
default constructor
|
explicit |
constructor getting the rasmgr name
| r_Database::~r_Database | ( | ) |
One error situations can occur which raise an exception of type r_Error with one of the following kinds: r_Error_NameInvalid && Name is NULL.
\ destructor
| void r_Database::close | ( | ) |
The method opens the database specified with database_name.
Several error situations can occur which raise an exception of type r_Error with one of the following kinds:
close a database
| void r_Database::create | ( | const char * | name | ) |
create a database with fixed schema RasDaSchema
| void r_Database::destroy | ( | const char * | name | ) |
This method works only if a server host name has been specified with set_servername().
One of error situations can occur will raise an exception of type r_Error with one of the following kinds: r_Error_NameInvalid && Name is NULL.\ destroy a database
| const r_OId r_Database::get_new_oid | ( | unsigned short | objType | ) | const |
| access_status r_Database::get_status | ( | ) | const |
One of error situations can occur will raise an exception of type r_Error with one of the following kinds: r_Error_NameInvalid && Name is NULL.
\ get the actual status
| r_Type * r_Database::get_type_schema | ( | const char * | typeName, |
| type_schema | typetype | ||
| ) |
| ClientComm * r_Database::getComm | ( | ) |
| void r_Database::insertColl | ( | const char * | collName, |
| const char * | typeName, | ||
| const r_OId & | oid | ||
| ) |
| r_Ref_Any r_Database::lookup_object | ( | const char * | name | ) | const |
The method gives the name to the object obj.
The name is used for further retrieval of the object. Right now, names can just be given to sets of type r_Set. One of error situations can occur will raise an exception of type r_Error with one of the following kinds: r_Error_NameInvalid && Name is NULL.\ lookup named objects in a database (must be called within open database and running transaction)
The method looks up an object with name.
Right now, just objects of type r_Set are allowed. Error kinds:
lookup objects by oids in a database (must be called within open database and running transaction)
| void r_Database::open | ( | const char * | database_name, |
| access_status | status = read_write |
||
| ) |
open a database
| void r_Database::removeObjFromColl | ( | const char * | name, |
| const r_OId & | oid | ||
| ) |
removes an object from a collection
| void r_Database::set_object_name | ( | r_Object & | obj, |
| const char * | name | ||
| ) |
give a name to an object (signature is not ODMG conformant because of compiler bug)
| void r_Database::set_servername | ( | const char * | name, |
| int | port = DEFAULT_PORT |
||
| ) |
This method works only if a server host name has been specified with set_servername().
One of error situations can occur will raise an exception of type r_Error with one of the following kinds: r_Error_NameInvalid && Name is NULL.\ set the server name
| void r_Database::set_storage_format | ( | r_Data_Format | format, |
| const char * | formatParams = NULL |
||
| ) |
The method sets the transfer compression used for the communications of this client with the server.
Error kinds: set the storage format for newly created MDD for this client
| void r_Database::set_transfer_format | ( | r_Data_Format | format, |
| const char * | formatParams = NULL |
||
| ) |
The method looks up the type structure with typeName as its name.
typetype is 1 for marray and 2 for collection.
Error kinds: set the transfer compression format, both for data sent from the server to the client and the other way around.
| void r_Database::set_useridentification | ( | const char * | name, |
| const char * | plain_pass | ||
| ) |
One of error situations can occur will raise an exception of type r_Error with one of the following kinds: r_Error_NameInvalid && Name is NULL.
\ set the user name and password
|
static |
This method sets the storage format to use for MDD created by this client in the RasDaMan database.
The return values are identical to set_transfer_format() stores a pointer to the actually opened database