|
gnStringSpec.hGo to the documentation of this file.00001 00002 // File: gnStringSpec.h 00003 // Purpose: implements gnContigSpec for strings 00004 // Description: 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 _gnStringSpec_h_ 00014 #define _gnStringSpec_h_ 00015 00016 #include "gn/gnDefs.h" 00017 00018 #include <string> 00019 #include "gn/gnContigSpec.h" 00020 #include "gn/gnBaseSource.h" 00021 00026 class GNDLLEXPORT gnStringSpec : public gnContigSpec 00027 { 00028 public: 00032 gnStringSpec(); 00041 gnStringSpec( const string& m_string, const gnSeqI start=0, const gnSeqI endI=GNSEQI_END, const boolean revComp = false); 00046 gnStringSpec( const gnStringSpec& s ); 00047 ~gnStringSpec(); 00048 // Clone 00049 gnStringSpec* Clone() const; 00050 virtual void Clear(); 00051 // Value Access methods 00052 00053 virtual gnSeqI GetSourceLength() const; 00054 00055 00056 // Source Spec Specific functions 00057 virtual gnBaseSource *GetSource() const; 00058 00067 virtual gnStringSpec* CloneRange( const gnSeqI startI, const gnSeqI len ) const; 00068 00069 protected: 00070 virtual boolean Read(const gnSeqI start, gnSeqC* buf, uint32& bufLen ) const; 00071 string m_seqString; 00072 00073 }; // class gnStringSpec 00074 00075 inline 00076 gnStringSpec* gnStringSpec::Clone() const 00077 { 00078 return new gnStringSpec( *this ); 00079 } 00080 inline 00081 gnSeqI gnStringSpec::GetSourceLength() const{ 00082 return m_seqString.length(); 00083 } 00084 inline 00085 gnBaseSource* gnStringSpec::GetSource() const 00086 { 00087 return NULL; 00088 } 00089 00090 inline 00091 boolean gnStringSpec::Read(const gnSeqI start, gnSeqC* buf, uint32& bufLen) const{ 00092 memcpy(buf, m_seqString.data() + start, bufLen); 00093 return true; 00094 } 00095 00096 #endif 00097 // _gnStringSpec_h_ Generated at Fri Nov 30 15:36:52 2001 for libGenome by 1.2.8.1 written by Dimitri van Heesch, © 1997-2001 |