From 8f27e65bddd7d4b8515ce620fb485fdd78fcdf89 Mon Sep 17 00:00:00 2001 From: Constantin Jucovschi Date: Fri, 24 Apr 2009 07:20:22 -0400 Subject: Initial commit --- include/basictypes.hh | 207 +++++++++++++++++++++++++++++++++++++++++++++++++ include/basictypes.odl | 112 ++++++++++++++++++++++++++ include/bool.h | 23 ++++++ include/globals.hh | 77 ++++++++++++++++++ include/rasdaman.hh | 70 +++++++++++++++++ include/stdexcept.h | 144 ++++++++++++++++++++++++++++++++++ 6 files changed, 633 insertions(+) create mode 100644 include/basictypes.hh create mode 100644 include/basictypes.odl create mode 100644 include/bool.h create mode 100644 include/globals.hh create mode 100644 include/rasdaman.hh create mode 100644 include/stdexcept.h (limited to 'include') diff --git a/include/basictypes.hh b/include/basictypes.hh new file mode 100644 index 0000000..8148208 --- /dev/null +++ b/include/basictypes.hh @@ -0,0 +1,207 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see . +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see +* or contact Peter Baumann via . +*/ + +//------------------------------------------------------------ +// This file is created automatically by the rasdl processor. +// +// DO NOT EDIT +//------------------------------------------------------------ + +#ifndef __BASICTYPES_HH_ +#define __BASICTYPES_HH_ + +//------------------------------------------------------------ +// Includes +//------------------------------------------------------------ + +#include "rasdaman.hh" + +/*[2,25]*//* TYPEDEF ------------------------- GreyImage */ +typedef r_Marray GreyImage; + +/*[3,24]*//* TYPEDEF ------------------------- GreySet */ +typedef r_Set > GreySet; + +/*[6,28]*//* TYPEDEF ------------------------- BoolImage */ +typedef r_Marray BoolImage; + +/*[7,24]*//* TYPEDEF ------------------------- BoolSet */ +typedef r_Set > BoolSet; + +/*[10,1]*//* STRUCT -------------------------- RGBPixel */ +struct RGBPixel { + r_Char red; + r_Char green; + r_Char blue; +}; +/*[11,29]*//* TYPEDEF ------------------------- RGBImage */ +typedef r_Marray RGBImage; + +/*[12,23]*//* TYPEDEF ------------------------- RGBSet */ +typedef r_Set > RGBSet; + +/*[15,35]*//* TYPEDEF ------------------------- ULongImage */ +typedef r_Marray ULongImage; + +/*[16,25]*//* TYPEDEF ------------------------- ULongSet */ +typedef r_Set > ULongSet; + +/*[19,26]*//* TYPEDEF ------------------------- GreyCube */ +typedef r_Marray GreyCube; + +/*[20,23]*//* TYPEDEF ------------------------- GreySet3 */ +typedef r_Set > GreySet3; + +/*[24,29]*//* TYPEDEF ------------------------- BoolString */ +typedef r_Marray BoolString; + +/*[25,25]*//* TYPEDEF ------------------------- BoolSet1 */ +typedef r_Set > BoolSet1; + +/*[27,29]*//* TYPEDEF ------------------------- BoolCube */ +typedef r_Marray BoolCube; + +/*[28,23]*//* TYPEDEF ------------------------- BoolSet3 */ +typedef r_Set > BoolSet3; + +/*[30,26]*//* TYPEDEF ------------------------- GreyString */ +typedef r_Marray GreyString; + +/*[31,25]*//* TYPEDEF ------------------------- GreySet1 */ +typedef r_Set > GreySet1; + +/*[33,27]*//* TYPEDEF ------------------------- ShortString */ +typedef r_Marray ShortString; + +/*[34,26]*//* TYPEDEF ------------------------- ShortSet1 */ +typedef r_Set > ShortSet1; + +/*[36,27]*//* TYPEDEF ------------------------- ShortImage */ +typedef r_Marray ShortImage; + +/*[37,25]*//* TYPEDEF ------------------------- ShortSet */ +typedef r_Set > ShortSet; + +/*[39,27]*//* TYPEDEF ------------------------- ShortCube */ +typedef r_Marray ShortCube; + +/*[40,24]*//* TYPEDEF ------------------------- ShortSet3 */ +typedef r_Set > ShortSet3; + +/*[42,36]*//* TYPEDEF ------------------------- UShortString */ +typedef r_Marray UShortString; + +/*[43,27]*//* TYPEDEF ------------------------- UShortSet1 */ +typedef r_Set > UShortSet1; + +/*[45,36]*//* TYPEDEF ------------------------- UShortImage */ +typedef r_Marray UShortImage; + +/*[46,26]*//* TYPEDEF ------------------------- UShortSet */ +typedef r_Set > UShortSet; + +/*[48,36]*//* TYPEDEF ------------------------- UShortCube */ +typedef r_Marray UShortCube; + +/*[49,25]*//* TYPEDEF ------------------------- UShortSet3 */ +typedef r_Set > UShortSet3; + +/*[51,26]*//* TYPEDEF ------------------------- LongString */ +typedef r_Marray LongString; + +/*[52,25]*//* TYPEDEF ------------------------- LongSet1 */ +typedef r_Set > LongSet1; + +/*[54,26]*//* TYPEDEF ------------------------- LongImage */ +typedef r_Marray LongImage; + +/*[55,24]*//* TYPEDEF ------------------------- LongSet */ +typedef r_Set > LongSet; + +/*[57,26]*//* TYPEDEF ------------------------- LongCube */ +typedef r_Marray LongCube; + +/*[58,23]*//* TYPEDEF ------------------------- LongSet3 */ +typedef r_Set > LongSet3; + +/*[60,35]*//* TYPEDEF ------------------------- ULongString */ +typedef r_Marray ULongString; + +/*[61,26]*//* TYPEDEF ------------------------- ULongSet1 */ +typedef r_Set > ULongSet1; + +/*[63,35]*//* TYPEDEF ------------------------- ULongCube */ +typedef r_Marray ULongCube; + +/*[64,24]*//* TYPEDEF ------------------------- ULongSet3 */ +typedef r_Set > ULongSet3; + +/*[66,30]*//* TYPEDEF ------------------------- RGBString */ +typedef r_Marray RGBString; + +/*[67,24]*//* TYPEDEF ------------------------- RGBSet1 */ +typedef r_Set > RGBSet1; + +/*[69,30]*//* TYPEDEF ------------------------- RGBCube */ +typedef r_Marray RGBCube; + +/*[70,22]*//* TYPEDEF ------------------------- RGBSet3 */ +typedef r_Set > RGBSet3; + +/*[72,27]*//* TYPEDEF ------------------------- FloatString */ +typedef r_Marray FloatString; + +/*[73,26]*//* TYPEDEF ------------------------- FloatSet1 */ +typedef r_Set > FloatSet1; + +/*[75,27]*//* TYPEDEF ------------------------- FloatImage */ +typedef r_Marray FloatImage; + +/*[76,25]*//* TYPEDEF ------------------------- FloatSet */ +typedef r_Set > FloatSet; + +/*[78,27]*//* TYPEDEF ------------------------- FloatCube */ +typedef r_Marray FloatCube; + +/*[79,24]*//* TYPEDEF ------------------------- FloatSet3 */ +typedef r_Set > FloatSet3; + +/*[81,28]*//* TYPEDEF ------------------------- DoubleString */ +typedef r_Marray DoubleString; + +/*[82,27]*//* TYPEDEF ------------------------- DoubleSet1 */ +typedef r_Set > DoubleSet1; + +/*[84,28]*//* TYPEDEF ------------------------- DoubleImage */ +typedef r_Marray DoubleImage; + +/*[85,26]*//* TYPEDEF ------------------------- DoubleSet */ +typedef r_Set > DoubleSet; + +/*[87,28]*//* TYPEDEF ------------------------- DoubleCube */ +typedef r_Marray DoubleCube; + +/*[88,25]*//* TYPEDEF ------------------------- DoubleSet3 */ +typedef r_Set > DoubleSet3; + +#endif diff --git a/include/basictypes.odl b/include/basictypes.odl new file mode 100644 index 0000000..ec1884c --- /dev/null +++ b/include/basictypes.odl @@ -0,0 +1,112 @@ +// example 1 +typedef marray GreyImage; +typedef set GreySet; + +// example 2 +typedef marray BoolImage; +typedef set BoolSet; + +// example 3 +struct RGBPixel { char red, green, blue; }; +typedef marray RGBImage; +typedef set RGBSet; + +// example 4 +typedef marray ULongImage; +typedef set ULongSet; + +// example 5 +typedef marray GreyCube; +typedef set GreySet3; + + +// heavily expanded types (Andreas) +typedef marray BoolString; +typedef set BoolSet1; + +typedef marray BoolCube; +typedef set BoolSet3; + +typedef marray GreyString; +typedef set GreySet1; + +typedef marray OctetString; +typedef set OctetSet1; + +typedef marray OctetImage; +typedef set OctetSet; + +typedef marray OctetCube; +typedef set OctetSet3; + +typedef marray ShortString; +typedef set ShortSet1; + +typedef marray ShortImage; +typedef set ShortSet; + +typedef marray ShortCube; +typedef set ShortSet3; + +typedef marray UShortString; +typedef set UShortSet1; + +typedef marray UShortImage; +typedef set UShortSet; + +typedef marray UShortCube; +typedef set UShortSet3; + +typedef marray LongString; +typedef set LongSet1; + +typedef marray LongImage; +typedef set LongSet; + +typedef marray LongCube; +typedef set LongSet3; + +typedef marray ULongString; +typedef set ULongSet1; + +typedef marray ULongCube; +typedef set ULongSet3; + +typedef marray RGBString; +typedef set RGBSet1; + +typedef marray RGBCube; +typedef set RGBSet3; + +typedef marray FloatString; +typedef set FloatSet1; + +typedef marray FloatImage; +typedef set FloatSet; + +typedef marray FloatCube; +typedef set FloatSet3; + +typedef marray FloatCube4; +typedef set FloatSet4; + +typedef marray DoubleString; +typedef set DoubleSet1; + +typedef marray DoubleImage; +typedef set DoubleSet; + +typedef marray DoubleCube; +typedef set DoubleSet3; + +typedef marray Gauss1; +typedef set GaussSet1; + +typedef marray Gauss2; +typedef set GaussSet2; + +typedef marray Gauss1Image; +typedef set Gauss1Set; + +typedef marray Gauss2Image; +typedef set Gauss2Set; diff --git a/include/bool.h b/include/bool.h new file mode 100644 index 0000000..c8cf406 --- /dev/null +++ b/include/bool.h @@ -0,0 +1,23 @@ +/* + * + * Copyright (c) 1994 + * Hewlett-Packard Company + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Hewlett-Packard Company makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + */ + +// most systems should have bool defined now (Sun CC 5.0, g++), it is in the +// ANSI standard. + +#ifdef OS_HPUX_10 +#define bool int +#endif +#define true 1 +#define false 0 diff --git a/include/globals.hh b/include/globals.hh new file mode 100644 index 0000000..e64392b --- /dev/null +++ b/include/globals.hh @@ -0,0 +1,77 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see . +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see +* or contact Peter Baumann via . +/ +/** + * SOURCE: globals.hh + * + * MODULE: rasdaman + * CLASS: Globals + * + * PURPOSE: + * This class provides basic constants used across rasdaman. + * Any value that is of external importance (default names, timeouts, ...) + * but are NOT TO BE DELIVERED should be defined here. + * + * COMMENTS: + * - make this a real class + * - successively collect all important values here + * +*/ + +#ifndef GLOBALS_HH +#define GLOBALS_HH + +/// default rasmgr listen port +#define DEFAULT_PORT 7001 + +/// name of env var pointing to rasdaman home dir (ex: "/opt/rasdaman") +#define RMANHOME_VAR "RMANHOME" + +/// default name of server machine, if gethostname() fails +#define DEFAULT_HOSTNAME "localhost" + +/// default database name +#define DEFAULT_DBNAME "RASBASE" + +/// name of rasmgr configuration file +#define RASMGR_CONF_FILE "rasmgr.conf" + +/// default r/o login name for client tools +#define DEFAULT_USER "rasguest" +/// default password for this user +#define DEFAULT_PASSWD "rasguest" + +/// server log directory +#define LOGDIR "/log" +/// server alternative log directory, if RMANHOME not specified, defined via autoconf/automake +#define ALT_LOGDIR ABSOLUTE_LOG_DIR +/// log file suffix +#define LOG_SUFFIX "log" + +/// max transfer buffer size (import clients) +#define MAX_BUFFER_SIZE 4194304L + +/// client timeout [secs] +#define CLIENT_TIMEOUT 300 + +#endif // GLOBALS_HH + diff --git a/include/rasdaman.hh b/include/rasdaman.hh new file mode 100644 index 0000000..8c983c9 --- /dev/null +++ b/include/rasdaman.hh @@ -0,0 +1,70 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see . +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see +* or contact Peter Baumann via . +*/ + +//------------------------------------------------------------ +// RasDaMan Standard Include +// +// DO NOT EDIT +//------------------------------------------------------------ + +#ifndef __RASDAMAN_HH_ +#define __RASDAMAN_HH_ + +//------------------------------------------------------------ +// Includes +//------------------------------------------------------------ + +#include "rasodmg/ref.hh" +#include "rasodmg/transaction.hh" +#include "rasodmg/database.hh" +#include "rasodmg/set.hh" +#include "rasodmg/iterator.hh" +#include "rasodmg/marray.hh" +#include "rasodmg/oqlquery.hh" +#include "rasodmg/storagelayout.hh" +#include "rasodmg/alignedtiling.hh" +#include "rasodmg/interesttiling.hh" +#include "rasodmg/dirtiling.hh" +#include "rasodmg/stattiling.hh" + +#include "raslib/endian.hh" +#include "raslib/odmgtypes.hh" +#include "raslib/mddtypes.hh" +#include "raslib/oid.hh" +#include "raslib/type.hh" +#include "raslib/minterval.hh" +#include "raslib/primitive.hh" +#include "raslib/complex.hh" +#include "raslib/structure.hh" +#include "raslib/primitivetype.hh" +#include "raslib/complextype.hh" +#include "raslib/structuretype.hh" +#include "raslib/rmdebug.hh" +#include "raslib/parseparams.hh" + +#include "conversion/convertor.hh" +#include "conversion/convfactory.hh" + +#include "compression/tilecompression.hh" + +#endif diff --git a/include/stdexcept.h b/include/stdexcept.h new file mode 100644 index 0000000..0c0a3af --- /dev/null +++ b/include/stdexcept.h @@ -0,0 +1,144 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with rasdaman community. If not, see . +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see +* or contact Peter Baumann via . +/ +/** + * INCLUDE: stdexcept.h + * + * CLASSES: exception + * logic_error + * domain_error + * invalid_argument + * length_error + * out_of_range + * runtime_error + * range_error + * overflow_error + * + * PURPOSE: + * This file implements the exception class hierarchy of + * Standard C++. It is thought to be substituted by a + * compiler package implementation in future. + * + * COMMENTS: + * +*/ + +#ifndef _D_EXCEPTION_ +#define _D_EXCEPTION_ + +class exception +{ + public: + exception() throw() : errorString(0) {}; + + exception( const char* s ) throw() + { + errorString = new char[strlen(s)+1]; + strcpy( errorString, s ); + }; + + exception( const exception& ex ) throw() + { + errorString = new char[strlen(ex.what())+1]; + strcpy( errorString, ex.what() ); + }; + + ~exception() throw() + { + if( errorString ) delete[] errorString; + }; + + exception& operator=( const exception& ex ) throw() + { + if( this != &ex ) + { + if( errorString ) delete[] errorString; + + errorString = new char[strlen(ex.what())+1]; + strcpy( errorString, ex.what() ); + } + return *this; + }; + + inline virtual const char* what() const throw() { return errorString; }; + + private: + char* errorString; +}; + + +class logic_error : public exception +{ + public: + logic_error( const char* what_arg ) throw() : exception( what_arg ) {}; +}; + + +class domain_error : public logic_error +{ + public: + domain_error( const char* what_arg ) throw() : logic_error( what_arg ) {}; +}; + + +class invalid_argument : public logic_error +{ + public: + invalid_argument( const char* what_arg ) throw() : logic_error( what_arg ) {}; +}; + + +class length_error : public logic_error +{ + public: + length_error( const char* what_arg ) throw() : logic_error( what_arg ) {}; +}; + + +class out_of_range : public logic_error +{ + public: + out_of_range( const char* what_arg ) throw() : logic_error( what_arg ) {}; +}; + + +class runtime_error : public exception +{ + public: + runtime_error( const char* what_arg ) throw() : exception( what_arg ) {}; +}; + + +class range_error : public runtime_error +{ + public: + range_error( const char* what_arg ) throw() : runtime_error( what_arg ) {}; +}; + + +class overflow_error : public runtime_error +{ + public: + overflow_error( const char* what_arg ) throw() : runtime_error( what_arg ) {}; +}; + +#endif -- cgit