|
gnMultiSpec.hGo to the documentation of this file.00001 00002 // File: gnMultiSpec.h 00003 // Purpose: abstract multiple spec class 00004 // Description: For specs which can contain multiple data sources 00005 // Changes: 00006 // Version: libGenome 0.1.0 00007 // Author: Aaron Darling 00008 // Last Edited: April 15, 2001, 10:34:50pm 00009 // Modified by: 00010 // Copyright: (c) Aaron Darling 00011 // Licenses: Proprietary 00013 #ifndef _gnMultiSpec_h_ 00014 #define _gnMultiSpec_h_ 00015 00016 #include "gn/gnDefs.h" 00017 00018 #include <vector> 00019 #include <string> 00020 00021 #include "gn/gnClone.h" 00022 #include "gn/gnBaseFeature.h" 00023 #include "gn/gnBaseHeader.h" 00024 #include "gn/gnBaseSpec.h" 00025 00030 class GNDLLEXPORT gnMultiSpec : public gnBaseSpec 00031 { 00032 public: 00033 gnMultiSpec(){} 00037 virtual ~gnMultiSpec(){} 00038 virtual gnMultiSpec* Clone() const = 0; 00039 00040 // Base Spec stuff 00041 virtual gnSeqI GetLength() const; 00042 virtual void CropStart( gnSeqI cropLen ); 00043 virtual void CropEnd( gnSeqI cropLen ); 00044 00045 virtual string GetSourceName() const; 00046 virtual void SetSourceName(const string& sourceName); 00047 virtual void Clear(); 00048 00049 virtual boolean SeqRead(const gnSeqI start, gnSeqC* buf, uint32& bufLen, const uint32 contigI ) const; 00050 00051 //Multispec stuff 00056 virtual uint32 GetSpecListLength() const = 0; 00062 virtual gnBaseSpec* GetSpec( const uint32 i ) const = 0; 00068 virtual gnBaseSpec* GetSpecByBase( const gnSeqI baseI ) const = 0; 00074 virtual uint32 GetSpecIndexByBase( const gnSeqI baseI ) const; 00080 virtual uint32 GetSpecIndexByName( const string& name ) const; 00086 virtual gnSeqI GetSpecStartBase( const uint32 specI ) const; 00092 virtual gnSeqI GetSpecEndBase( const uint32 specI ) const; 00100 virtual void AddSpec( gnBaseSpec* spec, const uint32 i = UINT32_MAX ) = 0; 00105 virtual void RemoveSpec( uint32 i ) = 0; 00106 00111 virtual uint32 GetHeaderListLength() const; 00118 virtual void AddHeader( gnBaseHeader *head, const uint32 i = UINT32_MAX); 00125 virtual gnBaseHeader* GetHeader( const uint32 i ) const; 00132 virtual gnBaseHeader* GetHeader( const string& name, uint32& i) const; 00138 virtual void RemoveHeader( uint32 i ); 00139 00146 uint32 AddFeature( gnBaseFeature* feat ); 00151 virtual uint32 GetFeatureListLength() const = 0; 00157 virtual gnBaseFeature* GetFeature( const uint32 i ) const = 0; 00164 virtual void GetContainedFeatures(const gnLocation& lt, vector<gnBaseFeature*>& feature_vector, vector<uint32>& index_vector) const = 0; 00171 virtual void GetIntersectingFeatures(const gnLocation& lt, vector<gnBaseFeature*>& feature_vector, vector<uint32>& index_vector) const = 0; 00177 virtual void GetBrokenFeatures(const gnLocation& lt, vector<gnBaseFeature*>& feature_vector) const = 0; 00183 virtual void RemoveFeature( const uint32 i ) = 0; 00184 00185 protected: 00186 string m_sourceName; 00187 00188 vector <gnBaseHeader*> m_headerList; 00189 private: 00190 00191 }; // class gnMultiSpec 00192 00193 inline 00194 uint32 gnMultiSpec::GetHeaderListLength() const 00195 { 00196 return m_headerList.size(); 00197 } 00198 inline 00199 gnBaseHeader* gnMultiSpec::GetHeader(const uint32 i) const 00200 { 00201 if(i < m_headerList.size()){ 00202 return m_headerList[i]; 00203 } 00204 return 0; 00205 } 00206 00207 inline 00208 string gnMultiSpec::GetSourceName() const{ 00209 return m_sourceName; 00210 } 00211 00212 inline 00213 void gnMultiSpec::SetSourceName(const string& sourceName){ 00214 m_sourceName = sourceName; 00215 } 00216 00217 #endif 00218 // _gnMultiSpec_h_ Generated at Fri Nov 30 15:36:51 2001 for libGenome by 1.2.8.1 written by Dimitri van Heesch, © 1997-2001 |