rasdaman client API  10.6.3
The Array Analytics Engine: Datacubes at Your Fingertips
clientcomm.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 */
23 
24 #ifndef CLIENTCOMM_HH_
25 #define CLIENTCOMM_HH_
26 
27 #include "raslib/mddtypes.hh"
28 
29 class r_Database;
30 class r_Transaction;
31 class r_OId;
32 class r_OQL_Query;
33 class r_GMarray;
34 template <class T>
35 class r_Set;
36 class r_Ref_Any;
37 class r_Base_Type;
38 class r_Parse_Params;
39 
51 {
52 public:
54  virtual ~ClientComm() = default;
55 
59 
61  virtual int openDB(const char *database) = 0;
63  virtual int closeDB() = 0;
65  virtual int createDB(const char *name) = 0;
67  virtual int destroyDB(const char *name) = 0;
68 
71 
75 
77  virtual int openTA(unsigned short readOnly = 0) = 0;
79  virtual int commitTA() = 0;
81  virtual int abortTA() = 0;
82 
85 
89 
91  virtual void insertMDD(const char *collName, r_GMarray *mar) = 0;
93  virtual r_Ref_Any getMDDByOId(const r_OId &oid) = 0;
94 
97 
101 
103  virtual void insertColl(const char *collName, const char *typeName, const r_OId &oid) = 0;
105  virtual void deleteCollByName(const char *collName) = 0;
107  virtual void deleteObjByOId(const r_OId &oid) = 0;
109  virtual void removeObjFromColl(const char *name, const r_OId &oid) = 0;
111  virtual r_Ref_Any getCollByName(const char *name) = 0;
113  virtual r_Ref_Any getCollByOId(const r_OId &oid) = 0;
115  virtual r_Ref_Any getCollOIdsByName(const char *name) = 0;
117  virtual r_Ref_Any getCollOIdsByOId(const r_OId &oid) = 0;
118 
121 
125 
129  virtual void executeQuery(const r_OQL_Query &query, r_Set<r_Ref_Any> &result) = 0;
130 
132  virtual void executeQuery(const r_OQL_Query &query) = 0;
133 
137  virtual void executeQuery(const r_OQL_Query &query, r_Set<r_Ref_Any> &result, int dummy) = 0;
138 
141 
145 
147  virtual r_OId getNewOId(unsigned short objType) = 0;
148 
150  virtual unsigned short getObjectType(const r_OId &oid) = 0;
151 
153  {
156  };
157 
160  virtual char *getTypeStructure(const char *typeName, r_Type_Type typeType) = 0;
161 
164 
167 
169  virtual int setTransferFormat(r_Data_Format format, const char *formatParams = NULL) = 0;
170 
172  virtual int setStorageFormat(r_Data_Format format, const char *formatParams = NULL) = 0;
173 
175  virtual void setUserIdentification(const char *userName, const char *plainTextPassword) = 0;
176 
178  virtual void setMaxRetry(unsigned int newMaxRetry) = 0;
180  virtual unsigned int getMaxRetry() = 0;
181 
183  virtual void setTimeoutInterval(int seconds) = 0;
185  virtual int getTimeoutInterval() = 0;
186 
192  virtual void updateTransaction();
193 
196 
197 protected:
199  ClientComm() = default;
200 
203 
206 };
207 
209 
210 #endif
mddtypes.hh
ClientComm
The class ClientComm represents one connection between one client entity (for example an object of cl...
Definition: clientcomm.hh:50
ClientComm::updateTransaction
virtual void updateTransaction()
resets to the global r_Transaction::actual_transaction if necessary
ClientComm::setTransferFormat
virtual int setTransferFormat(r_Data_Format format, const char *formatParams=NULL)=0
Configuration methods.
ClientComm::getTypeStructure
virtual char * getTypeStructure(const char *typeName, r_Type_Type typeType)=0
get type structure deallocate using delete []
ClientComm::setDatabase
void setDatabase(r_Database *database)
sets the database that is using this client communicator
ClientComm::getObjectType
virtual unsigned short getObjectType(const r_OId &oid)=0
get oid type
ClientComm::getMaxRetry
virtual unsigned int getMaxRetry()=0
get maximum retry to get a server
ClientComm::insertColl
virtual void insertColl(const char *collName, const char *typeName, const r_OId &oid)=0
Collection methods.
ClientComm::getCollOIdsByName
virtual r_Ref_Any getCollOIdsByName(const char *name)=0
gets collection references by name
ClientComm::executeQuery
virtual void executeQuery(const r_OQL_Query &query, r_Set< r_Ref_Any > &result)=0
Query methods.
ClientComm::getCollByName
virtual r_Ref_Any getCollByName(const char *name)=0
gets collection by name
r_Ref_Any
The class r_Ref_Any is defined to support a reference to any type.
Definition: ref.hh:64
ClientComm::getNewOId
virtual r_OId getNewOId(unsigned short objType)=0
System methods.
ClientComm::setUserIdentification
virtual void setUserIdentification(const char *userName, const char *plainTextPassword)=0
user identification for RasMGR
r_Base_Type
This class is the superclass of the types r_Structure_Type and r_Primitive_Type in the representation...
Definition: basetype.hh:39
ClientComm::closeDB
virtual int closeDB()=0
close current database
r_Data_Format
r_Data_Format
\begin{tabular}{ll} <tt>r_Array</tt> && no compression, row-major memory representation\...
Definition: mddtypes.hh:93
ClientComm::getMDDByOId
virtual r_Ref_Any getMDDByOId(const r_OId &oid)=0
gets MDD object by oid
ClientComm::deleteObjByOId
virtual void deleteObjByOId(const r_OId &oid)=0
deletes an object by oid (right now, objects are collection only)
ClientComm::createDB
virtual int createDB(const char *name)=0
create a database
ClientComm::~ClientComm
virtual ~ClientComm()=default
destructor (closes the connection and releases resources)
ClientComm::getCollOIdsByOId
virtual r_Ref_Any getCollOIdsByOId(const r_OId &oid)=0
gets collection references by oid
ClientComm::commitTA
virtual int commitTA()=0
commit current transaction
r_Set
The class implements a set container.
Definition: oqlquery.hh:31
ClientComm::deleteCollByName
virtual void deleteCollByName(const char *collName)=0
deletes an MDD collection by name
r_Transaction
Transactions can be started, committed, aborted, and checkpointed.
Definition: transaction.hh:49
ClientComm::r_Type_Type
r_Type_Type
Definition: clientcomm.hh:152
ClientComm::destroyDB
virtual int destroyDB(const char *name)=0
destroy a database
ClientComm::transaction
r_Transaction * transaction
reference to the transaction being used by this client communicator
Definition: clientcomm.hh:205
ClientComm::openDB
virtual int openDB(const char *database)=0
Database methods.
ClientComm::getCollByOId
virtual r_Ref_Any getCollByOId(const r_OId &oid)=0
gets collection by oid
ClientComm::getTimeoutInterval
virtual int getTimeoutInterval()=0
get communication timeout interval in seconds.
ClientComm::ClientComm
ClientComm()=default
constructor getting nothing
ClientComm::r_MDDType_Type
@ r_MDDType_Type
Definition: clientcomm.hh:155
ClientComm::removeObjFromColl
virtual void removeObjFromColl(const char *name, const r_OId &oid)=0
removes an object from a collection
r_GMarray
The class represents a generic MDD in the sense that it is independent of the cell base type.
Definition: gmarray.hh:65
ClientComm::setMaxRetry
virtual void setMaxRetry(unsigned int newMaxRetry)=0
set maximum retry to get a server
r_Database
A database object must be instantiated and opened before starting any transaction which uses the data...
Definition: database.hh:59
r_Parse_Params
Class for parsing a string consisting of key=value pairs separated by ",".
Definition: parseparams.hh:39
ClientComm::setTimeoutInterval
virtual void setTimeoutInterval(int seconds)=0
set communication timeout interval in seconds.
ClientComm::abortTA
virtual int abortTA()=0
abort current transaction
r_OId
Class r_OId represents an object identifier.
Definition: oid.hh:38
ClientComm::database
r_Database * database
reference to the database that created this client communicator
Definition: clientcomm.hh:202
ClientComm::openTA
virtual int openTA(unsigned short readOnly=0)=0
Transaction methods.
ClientComm::setTransaction
void setTransaction(r_Transaction *transaction)
sets the transaction that is using this client communicator
ClientComm::r_SetType_Type
@ r_SetType_Type
Definition: clientcomm.hh:154
ClientComm::setStorageFormat
virtual int setStorageFormat(r_Data_Format format, const char *formatParams=NULL)=0
set the preferred storage format
ClientComm::insertMDD
virtual void insertMDD(const char *collName, r_GMarray *mar)=0
MDD methods.
r_OQL_Query
The global function r_oql_execute() is used to invoke RasML queries.
Definition: oqlquery.hh:70