|
gnBaseFeature.hGo to the documentation of this file.00001 00002 // File: gnBaseFeature.h 00003 // Purpose: abstract Feature class 00004 // Description: Provides an interface for Features in memory and on disk. 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 _gnBaseFeature_h_ 00014 #define _gnBaseFeature_h_ 00015 00016 #include "gn/gnDefs.h" 00017 #include <string> 00018 #include <vector> 00019 #include "gn/gnClone.h" 00020 #include "gn/gnLocation.h" 00021 #include "gn/gnBaseQualifier.h" 00022 00023 class gnFragmentSpec; 00024 00031 class GNDLLEXPORT gnBaseFeature : public gnClone 00032 { 00033 public: 00034 gnBaseFeature(); 00035 gnBaseFeature( string& name, uint32 id = 0, gnFragmentSpec* spec = NULL, gnLocation::gnLocationType lt = gnLocation::LT_Nothing, boolean broken = false ); 00039 ~gnBaseFeature(); 00040 00041 virtual gnBaseFeature* Clone() const = 0; 00046 virtual string GetName() const; 00051 virtual void SetName( const string& name ); 00056 virtual uint32 GetID() const; 00061 virtual void SetID(uint32 id); 00067 virtual gnFragmentSpec* GetSpec() const; 00072 virtual void SetSpec(gnFragmentSpec* spec); 00078 virtual gnLocation::gnLocationType GetLocationType() const; 00085 virtual void SetLocationType( gnLocation::gnLocationType lType ); 00090 virtual uint32 GetLocationListLength() const; 00098 virtual boolean AddLocation( const gnLocation& l, uint32 listI = 0); 00104 virtual gnLocation GetLocation( uint32 listI ) const; 00110 virtual boolean RemoveLocation( uint32 listI ); 00117 virtual boolean SetLocation( const gnLocation& l, uint32 listI ); 00123 virtual boolean MovePositive( const gnSeqI i ); 00129 virtual boolean MoveNegative( const gnSeqI i ); 00135 virtual boolean CropStart( const gnSeqI i ); 00141 virtual boolean CropEnd( const gnSeqI i ); 00147 virtual boolean Crop( const gnLocation& l ); 00152 virtual boolean IsBroken() const; 00157 virtual void SetBroken(boolean broke); 00158 00164 virtual boolean Contains( gnSeqI i ) const; 00170 virtual boolean Contains( const gnLocation& l ) const; 00176 virtual boolean Contains( gnBaseFeature* feature ) const; 00182 virtual boolean IsContainedBy( const gnLocation& l ) const; 00188 virtual boolean Intersects( const gnLocation& l ) const; 00194 virtual boolean Intersects( gnBaseFeature* feature ) const; 00195 00200 virtual uint32 GetQualifierListLength() const; 00206 virtual boolean AddQualifier( gnBaseQualifier* qualifier ); 00212 virtual boolean HasQualifier( const string& name ) const; 00219 virtual uint32 FirstIndexOfQualifier( const string& name, uint32 listI ) const; 00226 virtual uint32 LastIndexOfQualifier( const string& name, uint32 listI ) const; 00232 virtual string GetQualifierName( uint32 listI ) const; 00238 virtual string GetQualifierValue( uint32 listI ) const; 00244 virtual gnBaseQualifier* GetQualifier( uint32 listI ); 00250 virtual boolean RemoveQualifier( uint32 listI ); 00258 virtual boolean SetQualifier( string& name, string& value, uint32 listI ); 00265 virtual boolean SetQualifierName( string& name, uint32 listI ); 00272 virtual boolean SetQualifierValue( string& value, uint32 listI ); 00273 protected: 00274 uint32 m_id; 00275 string m_name; 00276 boolean m_broken; 00277 gnLocation::gnLocationType m_locationType; 00278 vector< gnLocation > m_locationList; 00279 vector< gnBaseQualifier* > m_qualifierList; 00280 gnFragmentSpec* m_spec; 00281 };// class gnBaseFeature 00282 00283 inline 00284 string gnBaseFeature::GetName() const{ 00285 return m_name; 00286 } 00287 inline 00288 void gnBaseFeature::SetName( const string& name ){ 00289 m_name = name; 00290 } 00291 inline 00292 uint32 gnBaseFeature::GetID() const{ 00293 return m_id; 00294 } 00295 inline 00296 void gnBaseFeature::SetID(uint32 id){ 00297 m_id = id; 00298 } 00299 inline 00300 gnFragmentSpec* gnBaseFeature::GetSpec() const{ 00301 return m_spec; 00302 } 00303 inline 00304 void gnBaseFeature::SetSpec(gnFragmentSpec* spec){ 00305 m_spec = spec; 00306 } 00307 inline 00308 boolean gnBaseFeature::IsBroken() const{ 00309 return m_broken; 00310 } 00311 inline 00312 void gnBaseFeature::SetBroken(boolean broke){ 00313 m_broken = broke; 00314 } 00315 00316 inline 00317 gnLocation::gnLocationType gnBaseFeature::GetLocationType() const{ 00318 return m_locationType; 00319 } 00320 inline 00321 void gnBaseFeature::SetLocationType( gnLocation::gnLocationType lType ){ 00322 m_locationType = lType; 00323 } 00324 inline 00325 uint32 gnBaseFeature::GetLocationListLength() const{ 00326 return m_locationList.size(); 00327 } 00328 inline 00329 boolean gnBaseFeature::Crop( const gnLocation& l ){ 00330 return CropStart(l.GetStart()) && CropEnd(l.GetEnd()); 00331 } 00332 inline 00333 uint32 gnBaseFeature::GetQualifierListLength() const{ 00334 return m_qualifierList.size(); 00335 } 00336 00337 #endif 00338 // _gnBaseFeature_h_ Generated at Fri Nov 30 15:36:50 2001 for libGenome by 1.2.8.1 written by Dimitri van Heesch, © 1997-2001 |