rasdaman complete source
partinsert.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 _R_PARTIAL_INSERT_
34 #define _R_PARTIAL_INSERT_
35 
36 
37 #include "raslib/mddtypes.hh"
38 #include "raslib/oid.hh"
39 #include "rasodmg/transaction.hh"
40 
41 
42 class r_Minterval;
43 class r_Storage_Layout;
44 class r_GMarray;
45 class r_Database;
46 
47 
48 //@ManMemo: {\bf rasodmg}
49 
50 /*@Doc:
51  Class for inserting an MDD into the database stripwise, as in most of
52  our insert tools.
53 */
54 
59 {
60 public:
62  r_Partial_Insert( r_Database &usedb, const char *collname, const char *mddtype,
63  const char *settype, const r_Storage_Layout &stl );
65  r_Partial_Insert( r_Database &usedb, const char *collname, const char *mddtype,
66  const char *settype, const r_Minterval &dom, unsigned int tsize );
68  r_Partial_Insert( const r_Partial_Insert &src );
70  ~r_Partial_Insert( void );
71 
73  int update( r_GMarray *mddPtr,
74  r_Data_Format transferFormat = r_Array,
75  const char* transferFormatParams = NULL,
76  r_Data_Format storageFormat = r_Array,
77  const char* storageFormatParams = NULL
78  );
79  /*
80  The marray may be modified in small aspects such as base type name and storage layout.
81  The "transferFormat, transferFormatParams" are used to set the transfer compression used
82  for the communications of client with the server.
83  The "storageFormat, storageFormatParams" are used to set the storage format used for
84  MDD created by the client in the RasDaMan database.
85  */
86 
87 protected:
89  void init_share( const char *collname, const char *mddtype, const char *settype );
90 
94  char *collName;
96  char *mddType;
98  char *setType;
106  int doUpdate;
108  static const char *format_create;
109  static const char *format_update;
110 };
111 
112 #endif
static const char * format_update
Definition: partinsert.hh:109
Definition: transaction.hh:58
r_Partial_Insert(r_Database &usedb, const char *collname, const char *mddtype, const char *settype, const r_Storage_Layout &stl)
constructor receiving all necessary parameters. The storage layout is copied
int update(r_GMarray *mddPtr, r_Data_Format transferFormat=r_Array, const char *transferFormatParams=NULL, r_Data_Format storageFormat=r_Array, const char *storageFormatParams=NULL)
update the marray; no transaction should be activated, this is done internally.
r_Storage_Layout * mystl
the storage layout
Definition: partinsert.hh:102
r_Database & mydb
the database
Definition: partinsert.hh:100
char * setType
the set type name
Definition: partinsert.hh:98
void init_share(const char *collname, const char *mddtype, const char *settype)
shared init code
Definition: database.hh:60
r_Data_Format
Definition: mddtypes.hh:133
~r_Partial_Insert(void)
destructor
Definition: gmarray.hh:66
Definition: storagelayout.hh:70
Definition: mddtypes.hh:135
int doUpdate
do we have to do an insert or an update?
Definition: partinsert.hh:106
r_OId myOId
the marray's OId
Definition: partinsert.hh:92
r_Transaction myta
the transaction object
Definition: partinsert.hh:104
Definition: partinsert.hh:58
char * collName
the collection name
Definition: partinsert.hh:94
static const char * format_create
format strings for queries
Definition: partinsert.hh:108
char * mddType
the MDD type name
Definition: partinsert.hh:96
Definition: oid.hh:47
Definition: minterval.hh:249