rasdaman client API  10.6.3
The Array Analytics Engine: Datacubes at Your Fingertips
Public Types | Public Member Functions | Static Public Attributes | List of all members
r_Database Class Reference

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 More...
 
 r_Database (const char *name)
 constructor getting the rasmgr name More...
 
 ~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. More...
 
void open (const char *database_name, access_status status=read_write)
 open a database More...
 
void close ()
 The method opens the database specified with database_name. More...
 
void create (const char *name)
 create a database with fixed schema RasDaSchema More...
 
void destroy (const char *name)
 This method works only if a server host name has been specified with set_servername(). More...
 
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(). More...
 
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. More...
 
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. More...
 
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) More...
 
r_Ref_Any lookup_object (const char *name) const
 The method gives the name to the object obj. More...
 
r_Ref_Any lookup_object (const r_OId &oid) const
 The method looks up an object with name. More...
 
r_Typeget_type_schema (const char *typeName, type_schema typetype)
 The method looks up an object with oid. More...
 
void set_transfer_format (r_Data_Format format, const char *formatParams=NULL)
 The method looks up the type structure with typeName as its name. More...
 
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. More...
 
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 More...
 
ClientCommgetComm ()
 

Static Public Attributes

static r_Databaseactual_database
 This method sets the storage format to use for MDD created by this client in the RasDaMan database. More...
 

Detailed Description

A database object must be instantiated and opened before starting any transaction which uses the database, and closed after ending these transactions.

Member Enumeration Documentation

◆ access_status

possible database states

Enumerator
not_open 
read_write 
read_only 
exclusive 

◆ type_schema

possible types define by symbolic names

Enumerator
CELL 
MARRAY 
COLLECTION 

Constructor & Destructor Documentation

◆ r_Database() [1/2]

r_Database::r_Database ( )

default constructor

◆ r_Database() [2/2]

r_Database::r_Database ( const char *  name)
explicit

constructor getting the rasmgr name

◆ ~r_Database()

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

Member Function Documentation

◆ close()

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

◆ create()

void r_Database::create ( const char *  name)

create a database with fixed schema RasDaSchema

◆ destroy()

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

◆ get_new_oid()

const r_OId r_Database::get_new_oid ( unsigned short  objType) const

◆ get_status()

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

◆ get_type_schema()

r_Type* r_Database::get_type_schema ( const char *  typeName,
type_schema  typetype 
)

The method looks up an object with oid.

Right now, just objects of type r_Set and r_GMarray are allowed.

Error kinds:

◆ getComm()

ClientComm* r_Database::getComm ( )

◆ insertColl()

void r_Database::insertColl ( const char *  collName,
const char *  typeName,
const r_OId oid 
)

◆ lookup_object() [1/2]

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)

◆ lookup_object() [2/2]

r_Ref_Any r_Database::lookup_object ( const r_OId oid) const

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)

◆ open()

void r_Database::open ( const char *  database_name,
access_status  status = read_write 
)

open a database

◆ removeObjFromColl()

void r_Database::removeObjFromColl ( const char *  name,
const r_OId oid 
)

removes an object from a collection

◆ set_object_name()

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)

◆ set_servername()

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

◆ set_storage_format()

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

◆ set_transfer_format()

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.

◆ set_useridentification()

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

Member Data Documentation

◆ actual_database

r_Database* r_Database::actual_database
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


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