00001 // -*- Mode: C++ -*- 00002 // Object.h 00003 // Copyright © 2003 Laboratoire de Biologie Informatique et Théorique 00004 // Université de Montréal. 00005 // Author : Martin Larose 00006 // Created On : Thu Jun 5 15:02:13 2003 00007 // $Revision: 1.6 $ 00008 // $Id: Object.h,v 1.6 2003/10/18 00:23:59 larosem Exp $ 00009 // 00010 // This file is part of xmlcpg. 00011 // 00012 // xmlcpg is free software; you can redistribute it and/or modify it under 00013 // the terms of the GNU Lesser General Public License as published by the Free 00014 // Software Foundation; either version 2 of the License, or (at your option) 00015 // any later version. 00016 // 00017 // xmlcpg is distributed in the hope that it will be useful, but WITHOUT ANY 00018 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00019 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 00020 // more details. 00021 // 00022 // You should have received a copy of the GNU Lesser General Public License 00023 // along with xmlcpg; if not, write to the Free Software Foundation, Inc., 00024 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00025 00026 00027 #ifndef _rnaml_Object_h_ 00028 #define _rnaml_Object_h_ 00029 00030 #include <vector> 00031 00032 extern "C" { 00033 #include "object.h" 00034 } 00035 00036 00037 00038 namespace rnaml 00039 { 00040 class Object 00041 { 00045 rnamlObject *cStruct; 00046 00050 std::vector< const char* > referenceIds; 00051 00055 std::vector< const char* > analysisIds; 00056 00060 std::vector< const char* > databaseIds; 00061 00062 public: 00063 00064 // LIFECYCLE ------------------------------------------------------------ 00065 00069 Object (rnamlObject *obj = 0); 00070 00075 Object (const Object &right); 00076 00080 virtual ~Object (); 00081 00082 // OPERATORS ------------------------------------------------------------ 00083 00089 virtual Object& operator= (const Object &right); 00090 00096 virtual bool operator== (const Object &right) const; 00097 00098 // ACCESS --------------------------------------------------------------- 00099 00104 const char* getComment () const { return rnamlgetObjectComment (cStruct); } 00105 00110 void setComment (const char *comment) { rnamlsetObjectComment (cStruct, comment); } 00111 00116 void addReferenceId (const char *referenceId); 00117 00122 std::vector< const char* >& getReferenceIds () { return referenceIds; } 00123 00129 char* getReferenceIdsString () const { return rnamlgetObjectReferenceIdsString (cStruct); } 00130 00135 void addAnalysisId (const char *analysisId); 00136 00141 std::vector< const char* >& getAnalysisIds () { return analysisIds; } 00142 00148 char* getAnalysisIdsString () const { return rnamlgetObjectAnalysisIdsString (cStruct); } 00149 00154 void addDatabaseId (const char *databaseId); 00155 00160 std::vector< const char* >& getDatabaseIds () { return databaseIds; } 00161 00167 char* getDatabaseIdsString () const { return rnamlgetObjectDatabaseIdsString (cStruct); } 00168 00173 virtual const rnamlObject* getCStructure () const { return cStruct; } 00174 00179 virtual void setCStructure (rnamlObject *obj); 00180 00181 // METHODS -------------------------------------------------------------- 00182 00183 protected: 00184 00190 static Object* pack (rnamlObject *obj); 00191 00192 public: 00193 00199 virtual xmlcpgObject* toXML () const { return (xmlcpgObject*) rnamltoXML (cStruct); } 00200 00201 // I/O ----------------------------------------------------------------- 00202 00203 }; 00204 } 00205 00206 #endif