rasdaman client API  10.6.3
The Array Analytics Engine: Datacubes at Your Fingertips
database.hh
Go to the documentation of this file.
1 /*
2 * This file is part of rasdaman community.
3 *
4 * Rasdaman community is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * Rasdaman community is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
18 rasdaman GmbH.
19 *
20 * For more information please see <http://www.rasdaman.org>
21 * or contact Peter Baumann via <baumann@rasdaman.com>.
22 */
33 #ifndef _D_DATABASE_
34 #define _D_DATABASE_
35 
36 #include "raslib/mddtypes.hh"
37 #include "globals.hh"
38 #include <string>
39 
40 // forward declarations
41 class r_Object;
42 class r_OId;
43 class r_Type;
44 class r_Ref_Any;
45 class ClientComm;
46 
47 //@ManMemo: Module: {\bf rasodmg}
48 
60 {
61 public:
64  {
69  };
70 
73  {
74  CELL = 3,
75  MARRAY = 2,
77  };
78 
80  r_Database();
81 
83  explicit r_Database(const char *name);
90  ~r_Database();
92 
94  void open(const char *database_name, access_status status = read_write);
113  void close();
115 
117  void create(const char *name);
126  void destroy(const char *name);
136  void set_servername(const char *name, int port = DEFAULT_PORT);
143  void set_useridentification(const char *name, const char *plain_pass);
151  access_status get_status() const;
153 
155  void set_object_name(r_Object &obj, const char *name);
165  r_Ref_Any lookup_object(const char *name) const;
183  r_Ref_Any lookup_object(const r_OId &oid) const;
201  r_Type *get_type_schema(const char *typeName, type_schema typetype);
219  void set_transfer_format(r_Data_Format format, const char *formatParams = NULL);
236  void set_storage_format(r_Data_Format format, const char *formatParams = NULL);
243  static r_Database *actual_database;
245 
246  //@Man: Methods for internal use only:
248  const r_OId get_new_oid(unsigned short objType) const;
251 
252 
253  // creates an empty MDD collection on the server
254  void insertColl(const char *collName, const char *typeName, const r_OId &oid);
255 
257  void removeObjFromColl(const char *name, const r_OId &oid);
258 
259  ClientComm *getComm();
260 
261 private:
263  ClientComm *communication{NULL};
264 
266  access_status db_status{not_open};
267 
269  std::string rasmgrName;
270 
272  int rasmgrPort;
273 
275  std::string userName;
276 
278  std::string plainPass;
279 };
280 
281 #endif
r_Database::get_type_schema
r_Type * get_type_schema(const char *typeName, type_schema typetype)
The method looks up an object with oid.
mddtypes.hh
ClientComm
The class ClientComm represents one connection between one client entity (for example an object of cl...
Definition: clientcomm.hh:50
r_Database::lookup_object
r_Ref_Any lookup_object(const char *name) const
The method gives the name to the object obj.
r_Database::set_transfer_format
void set_transfer_format(r_Data_Format format, const char *formatParams=NULL)
The method looks up the type structure with typeName as its name.
r_Database::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().
r_Database::open
void open(const char *database_name, access_status status=read_write)
open a database
r_Database::removeObjFromColl
void removeObjFromColl(const char *name, const r_OId &oid)
removes an object from a collection
r_Database::COLLECTION
@ COLLECTION
Definition: database.hh:76
r_Database::set_useridentification
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 k...
r_Database::MARRAY
@ MARRAY
Definition: database.hh:75
r_Ref_Any
The class r_Ref_Any is defined to support a reference to any type.
Definition: ref.hh:64
r_Database::close
void close()
The method opens the database specified with database_name.
r_Database::actual_database
static r_Database * actual_database
This method sets the storage format to use for MDD created by this client in the RasDaMan database.
Definition: database.hh:244
r_Database::insertColl
void insertColl(const char *collName, const char *typeName, const r_OId &oid)
r_Data_Format
r_Data_Format
\begin{tabular}{ll} <tt>r_Array</tt> && no compression, row-major memory representation\...
Definition: mddtypes.hh:93
r_Database::access_status
access_status
possible database states
Definition: database.hh:63
r_Database::set_storage_format
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.
r_Database::exclusive
@ exclusive
Definition: database.hh:68
r_Database::get_status
access_status get_status() const
One of error situations can occur will raise an exception of type r_Error with one of the following k...
r_Type
This class the superclass for all types in the ODMG conformant representation of the RasDaMan type sy...
Definition: type.hh:50
r_Database::getComm
ClientComm * getComm()
r_Database::~r_Database
~r_Database()
One error situations can occur which raise an exception of type r_Error with one of the following kin...
r_Database::read_only
@ read_only
Definition: database.hh:67
r_Object
Through inheritance of this class, the type definer specifies that the subclass is capable of having ...
Definition: object.hh:61
r_Database::type_schema
type_schema
possible types define by symbolic names
Definition: database.hh:72
r_Database::set_object_name
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_Database::create
void create(const char *name)
create a database with fixed schema RasDaSchema
r_Database
A database object must be instantiated and opened before starting any transaction which uses the data...
Definition: database.hh:59
r_Database::CELL
@ CELL
Definition: database.hh:74
r_Database::destroy
void destroy(const char *name)
This method works only if a server host name has been specified with set_servername().
r_Database::r_Database
r_Database()
default constructor
r_OId
Class r_OId represents an object identifier.
Definition: oid.hh:38
r_Database::get_new_oid
const r_OId get_new_oid(unsigned short objType) const
r_Database::read_write
@ read_write
Definition: database.hh:66
r_Database::not_open
@ not_open
Definition: database.hh:65