00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef _gnSourceSpec_h_
00013 #define _gnSourceSpec_h_
00014
00015 #include "gn/gnDefs.h"
00016
00017 #include <string>
00018 #include "gn/gnContigSpec.h"
00019 #include "gn/gnBaseSource.h"
00020
00021
00022
00023
00024
00025
00026 class GNDLLEXPORT gnSourceSpec : public gnContigSpec
00027 {
00028 public:
00029
00030
00031
00032 gnSourceSpec();
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 gnSourceSpec( gnBaseSource* m_pSource, const uint32 m_ContigIndex=ALL_CONTIGS, const gnSeqI startI=0, const gnSeqI endI=GNSEQI_END, const boolean revComp = false);
00043
00044
00045
00046
00047 gnSourceSpec( const gnSourceSpec& s );
00048 ~gnSourceSpec();
00049
00050 gnSourceSpec* Clone() const;
00051
00052 virtual void Clear();
00053 virtual gnSeqI GetSourceLength() const;
00054 virtual gnBaseSource *GetSource() const;
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 virtual gnSourceSpec* CloneRange( const gnSeqI startI, const gnSeqI len ) const;
00065
00066 protected:
00067 virtual boolean Read(const gnSeqI start, gnSeqC* buf, uint32& bufLen ) const;
00068 gnBaseSource* m_pSource;
00069
00070 };
00071
00072 inline
00073 gnSourceSpec* gnSourceSpec::Clone() const
00074 {
00075 return new gnSourceSpec( *this );
00076 }
00077 inline
00078 gnSeqI gnSourceSpec::GetSourceLength() const{
00079 return m_pSource->GetContigSeqLength(m_SourceContigIndex);
00080 }
00081 inline
00082 gnBaseSource* gnSourceSpec::GetSource() const
00083 {
00084 return m_pSource;
00085 }
00086
00087 inline
00088 boolean gnSourceSpec::Read(const gnSeqI start, gnSeqC* buf, uint32& bufLen) const{
00089 return m_pSource->SeqRead(start, buf, bufLen, m_SourceContigIndex);
00090 }
00091
00092 #endif
00093