1 // $Id: gc_locus.h,v 1.21 2011/03/08 19:22:00 bobgian Exp $
2 
3 /*
4   Copyright 2002  Mary Kuhner, Jon Yamato, and Joseph Felsenstein
5 
6   This software is distributed free of charge for non-commercial use
7   and is copyrighted.  Of course, we do not guarantee that the software
8   works, and are not responsible for any damage you may cause or have.
9 */
10 
11 #ifndef GC_LOCUS_H
12 #define GC_LOCUS_H
13 
14 #include "wx/string.h"
15 #include "gc_creation_info.h"
16 #include "gc_phase.h"
17 #include "gc_quantum.h"
18 #include "gc_types.h"
19 
20 class GCStructures;
21 
22 class gcLocus : public GCQuantum
23 {
24     friend class GCStructures;
25 
26   private:
27 
28     bool                        m_blessed;
29 
30     bool                        m_hasRegion;
31     size_t                      m_regionId;
32 
33     bool                        m_inducedByFile;
34     size_t                      m_fileId;
35 
36     gcSpecificDataType          m_dataType;
37 
38     bool                        m_hasNumMarkers;
39     size_t                      m_numMarkers;
40 
41     bool                        m_hasTotalLength;
42     size_t                      m_totalLength;
43 
44     bool                        m_hasLinkedUserValue;
45     bool                        m_linkedUserValue;
46 
47     bool                        m_hasOffset;
48     long                        m_offset;
49 
50     bool                        m_hasMapPosition;
51     long                        m_mapPosition;
52 
53     bool                        m_hasUnphasedMarkers;
54     gcUnphasedMarkers           m_unphasedMarkers;
55 
56     gcCreationInfo              m_creationInfo;
57 
58     std::vector<long>           m_locations;
59 
60     void    SetBlessed(bool blessed);
61     void    SetCreationInfo(const gcCreationInfo &);
62     void    SetFileId(size_t id);
63     void    UnsetFileId();
64     void    SetRegionId(size_t id);
65     void    UnsetRegionId();
66 
67   protected:
68     void    LocusMergeLogic(bool doSettings, gcLocus & locus);
69 
70   public:
71     gcLocus();
72     ~gcLocus();
73 
74     bool                GetBlessed()            const;
75     gcSpecificDataType  GetDataType()           const;
76     wxString            GetDataTypeString()     const;
77     size_t              GetLength()             const;
78     wxString            GetLengthString()       const;
79     bool                GetLinked()             const;
80     wxString            GetLinkedString()       const;
81     bool                GetLinkedUserValue()    const;
82     wxString            GetLinkedUserValueString()const;
83     std::vector<long>   GetLocations()          const;
84     wxString            GetLocationsAsString()  const;
85     wxString            GetLongName()           const;
86     long                GetMapPosition()        const;
87     wxString            GetMapPositionString()  const;
88     size_t              GetNumMarkers()         const;
89     wxString            GetNumMarkersString()   const;
90     long                GetOffset()             const;
91     wxString            GetOffsetString()       const;
92     size_t              GetRegionId()           const;
93     size_t              GetTotalLength()        const;
94     wxString            GetTotalLengthString()  const;
95     const gcUnphasedMarkers * GetUnphasedMarkers()    const;
96     wxString            GetUnphasedMarkersAsString()    const;
97 
98     bool        HasLength()         const ;
99     bool        HasLocations()      const ;
100     bool        HasLocationZero()   const ;
101     bool        HasLinkedUserValue()const ;
102     bool        HasMapPosition()    const ;
103     bool        HasNumMarkers()     const ;
104     bool        HasOffset()         const ;
105     bool        HasRegion()         const ;
106     bool        HasTotalLength()    const ;
107     bool        HasUnphasedMarkers()const ;
108 
109     void    SetDataType(gcSpecificDataType type);
110     void    SetLinkedUserValue(bool linked);
111     void    SetLocations(wxString locationString);
112     void    SetMapPosition(long position);
113     void    SetNumMarkers(size_t numMarkers);
114     void    SetOffset(long offset);
115     void    SetTotalLength(size_t length);
116     void    SetUnphasedMarkers(gcUnphasedMarkers);
117 
118     void    UnsetNumMarkers();
119     void    UnsetMapPosition();
120     void    UnsetTotalLength();
121 
122     void    DebugDump(wxString prefix=wxEmptyString) const;
123 
124     bool    CanMergeWith(gcLocus & locus) ;
125     void       MergeWith(gcLocus & locus) ;
126 };
127 
128 #endif  // GC_LOCUS_H
129 
130 //____________________________________________________________________________________
131