00001 /* -*- Mode: C++ -*- 00002 * Base.h 00003 * Copyright © 2002-03 Laboratoire de Biologie Informatique et Théorique 00004 * Université de Montréal. 00005 * Author : Patrick Charbonneau 00006 * Created On : Wed Sep 12 16:48:15 2003 00007 * $Revision: 1.7 $ 00008 * $Id: Base.h,v 1.7 2003/10/18 00:20:28 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 00028 #ifndef _rnaml_Base_h_ 00029 #define _rnaml_Base_h_ 00030 00031 extern "C"{ 00032 #include "base.h" 00033 #include "object.h" 00034 } 00035 00036 #include <vector> 00037 00038 #include "Object.h" 00039 00040 00041 00042 namespace rnaml 00043 { 00044 class Atom; 00045 00046 00047 00048 class Base : public Object 00049 { 00053 std::vector< Atom* > atoms; 00054 00055 public: 00056 00057 // LIFECYCLE ------------------------------------------------------------ 00058 00062 Base () : Object ((rnamlObject*) rnamlnewBase ()) { } 00063 00068 Base (const Base &right); 00069 00074 Base* clone () const { return new Base (*this); } 00075 00079 virtual ~Base (); 00080 00081 // OPERATORS ------------------------------------------------------------ 00082 00088 Base& operator= (const Base &right); 00089 00090 // ACCESS --------------------------------------------------------------- 00091 00096 const char* getStrand () const { return rnamlgetBaseStrand ((const rnamlBase*) getCStructure ()); } 00097 00102 void setStrand (const char *strand) { rnamlsetBaseStrand ((rnamlBase*) getCStructure (), strand); } 00103 00108 int getPosition () const { return rnamlgetBasePosition ((const rnamlBase*) getCStructure ()); } 00109 00114 void setPosition (int position) { rnamlsetBasePosition ((rnamlBase*) getCStructure (), position); } 00115 00120 const char* getBaseType () const { return rnamlgetBaseBaseType ((const rnamlBase*) getCStructure ()); } 00121 00126 void setBaseType (const char *baseType) { rnamlsetBaseBaseType ((rnamlBase*) getCStructure (), baseType); } 00127 00132 char getAltLoc () const { return rnamlgetBaseAltLoc ((const rnamlBase*) getCStructure ()); } 00133 00138 void setAltLoc (char altLoc) { rnamlsetBaseAltLoc ((rnamlBase*) getCStructure (), altLoc); } 00139 00144 char getInsertion () const { return rnamlgetBaseInsertion ((const rnamlBase*) getCStructure ()); } 00145 00150 void setInsertion (char insertion) { rnamlsetBaseInsertion ((rnamlBase*) getCStructure (), insertion); } 00151 00156 std::vector< Atom* >& getAtoms () { return atoms; } 00157 00162 void addAtom (Atom* atom); 00163 00168 virtual void setCStructure (rnamlObject *obj); 00169 00170 // METHODS -------------------------------------------------------------- 00171 00172 // I/O ----------------------------------------------------------------- 00173 00174 }; 00175 } 00176 00177 #endif