00001 /* 00002 EyeDB Object Database Management System 00003 Copyright (C) 1994-2008 SYSRA 00004 00005 EyeDB is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 00010 EyeDB is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 00018 */ 00019 00020 /* 00021 Author: Eric Viara <viara@sysra.com> 00022 */ 00023 00024 00025 #ifndef _EYEDB_BASIC_H 00026 #define _EYEDB_BASIC_H 00027 00028 namespace eyedb { 00029 00038 class Basic : public Instance { 00039 00040 // ---------------------------------------------------------------------- 00041 // Basic Interface 00042 // ---------------------------------------------------------------------- 00043 public: 00049 Basic(Database *db = 0, const Dataspace *dataspace = 0); 00050 00055 Basic(const Basic *o); 00056 00061 Basic(const Basic &o); 00062 00068 Status remove(const RecMode* recmode = RecMode::NoRecurs); 00069 00074 virtual Basic *asBasic() {return this;} 00075 00080 virtual const Basic *asBasic() const {return this;} 00081 00082 // ---------------------------------------------------------------------- 00083 // Basic Restricted Access (conceptually private) 00084 // ---------------------------------------------------------------------- 00085 public: 00086 static void init(void); 00087 static void _release(void); 00088 virtual Status create(); 00089 virtual Status update(); 00090 }; 00091 00092 class BasicPtr : public InstancePtr { 00093 00094 public: 00095 BasicPtr(Basic *o = 0) : InstancePtr(o) { } 00096 00097 Basic *getBasic() {return dynamic_cast<Basic *>(o);} 00098 const Basic *getBasic() const {return dynamic_cast<Basic *>(o);} 00099 00100 Basic *operator->() {return dynamic_cast<Basic *>(o);} 00101 const Basic *operator->() const {return dynamic_cast<Basic *>(o);} 00102 }; 00103 00104 typedef std::vector<BasicPtr> BasicPtrVector; 00105 00110 } 00111 00112 #endif