Gamgee
You miserable little maggot. I'll stove your head in!
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
base_quals.h
Go to the documentation of this file.
1 #ifndef gamgee__base_quals__guard
2 #define gamgee__base_quals__guard
3 
4 #include "htslib/sam.h"
5 
6 #include <memory>
7 
8 namespace gamgee {
9 
13 class BaseQuals {
14  public:
15  explicit BaseQuals(const std::shared_ptr<bam1_t>& sam_record);
16  BaseQuals(const BaseQuals& other);
17  BaseQuals(BaseQuals&& other) = default;
18  BaseQuals& operator=(const BaseQuals& other);
19  BaseQuals& operator=(BaseQuals&& other) = default;
20  ~BaseQuals() = default;
21 
22  uint8_t operator[](const uint32_t index) const;
23  uint8_t& operator[](const uint32_t index);
24  uint32_t size() const { return m_num_quals; }
25  bool operator==(const BaseQuals& other) const;
26  bool operator!=(const BaseQuals& other) const;
27  std::string to_string() const;
28 
29  private:
30  std::shared_ptr<bam1_t> m_sam_record;
31  uint8_t* m_quals;
32  uint32_t m_num_quals;
33 
34  friend class SamBuilder;
35 };
36 
37 }
38 
39 #endif /* gamgee__base_quals__guard */
~BaseQuals()=default
Default destruction is sufficient, since our shared_ptr will handle deallocation. ...
class to build Sam objects from existing data or from scratch
Definition: sam_builder.h:58
BaseQuals(const std::shared_ptr< bam1_t > &sam_record)
creates a BaseQuals object that points to htslib memory already allocated
Definition: base_quals.cpp:20
BaseQuals & operator=(const BaseQuals &other)
creates a deep copy of a BaseQuals object
Definition: base_quals.cpp:42
uint32_t size() const
number of base qualities in the container
Definition: base_quals.h:24
bool operator==(const BaseQuals &other) const
check for equality with another BaseQuals object
Definition: base_quals.cpp:74
Utility class to handle the memory management of the sam record object for a read base qualities...
Definition: base_quals.h:13
Definition: exceptions.h:9
std::string to_string() const
produce a string representation of the base qualities in this object
Definition: base_quals.cpp:96
bool operator!=(const BaseQuals &other) const
check for inequality with another BaseQuals object
Definition: base_quals.cpp:89
uint8_t operator[](const uint32_t index) const
use freely as you would an array.
Definition: base_quals.cpp:56