]> git.donarmstrong.com Git - bamtools.git/blobdiff - src/api/internal/BamRandomAccessController_p.h
Cleaned up intra-API includes & moved version numbers to 2.0.0
[bamtools.git] / src / api / internal / BamRandomAccessController_p.h
index 372ea4a5e9a300dfc24ff2e2f4ea7ccdac92f21a..43b6fb038c18c196e78b79928e3f4de35d65425b 100644 (file)
@@ -1,9 +1,8 @@
 // ***************************************************************************
 // BamRandomAccessController_p.h (c) 2011 Derek Barnett
 // Marth Lab, Department of Biology, Boston College
-// All rights reserved.
 // ---------------------------------------------------------------------------
-// Last modified: 24 February 2011(DB)
+// Last modified: 10 October 2011(DB)
 // ---------------------------------------------------------------------------
 // Manages random access operations in a BAM file
 // ***************************************************************************
@@ -21,8 +20,8 @@
 //
 // We mean it.
 
-#include <api/BamAux.h>
-#include <api/BamIndex.h>
+#include "api/BamAux.h"
+#include "api/BamIndex.h"
 
 namespace BamTools {
 
@@ -45,13 +44,10 @@ class BamRandomAccessController {
         BamRandomAccessController(void);
         ~BamRandomAccessController(void);
 
-    // general interface
+    // BamRandomAccessController interface
     public:
-        void Close(void);
 
-    // index operations
-    public:
-        //
+        // index methods
         void ClearIndex(void);
         bool CreateIndex(BamReaderPrivate* reader, const BamIndex::IndexType& type);
         bool HasIndex(void) const;
@@ -61,31 +57,37 @@ class BamRandomAccessController {
         void SetIndex(BamIndex* index);
         void SetIndexCacheMode(const BamIndex::IndexCacheMode& mode);
 
-    // region operations
-    public:
+        // region methods
         void ClearRegion(void);
         bool HasRegion(void) const;
         RegionState AlignmentState(const BamAlignment& alignment) const;
         bool RegionHasAlignments(void) const;
-        bool SetRegion(BamReaderPrivate* reader,
-                       const BamRegion& region,
-                       const int& referenceCount);
+        bool SetRegion(const BamRegion& region, const int& referenceCount);
 
-    // 'internal' methods
-    public:
+        // general methods
+        void Close(void);
+        std::string GetErrorString(void) const;
+
+    // internal methods
+    private:
         // adjusts requested region if necessary (depending on where data actually begins)
         void AdjustRegion(const int& referenceCount);
+        // error-string handling
+        void SetErrorString(const std::string& where, const std::string& what);
 
     // data members
     private:
 
         // index data
-        BamIndex* m_index;  // owns index, not a copy - responsible for deleting
+        BamIndex* m_index;  // owns the index, not a copy - responsible for deleting
         BamIndex::IndexCacheMode m_indexCacheMode;
 
         // region data
         BamRegion m_region;
         bool m_hasAlignmentsInRegion;
+
+        // general data
+        std::string m_errorString;
 };
 
 } // namespace Internal