yat  0.21pre
DNA.h
1 #ifndef theplu_yat_omic_dna
2 #define theplu_yat_omic_dna
3 
4 // $Id: DNA.h 4245 2022-09-21 05:41:41Z peter $
5 
6 /*
7  Copyright (C) 2010, 2011, 2012, 2013, 2016 Peter Johansson
8 
9  This file is part of the yat library, http://dev.thep.lu.se/yat
10 
11  The yat library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU General Public License as
13  published by the Free Software Foundation; either version 3 of the
14  License, or (at your option) any later version.
15 
16  The yat library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with yat. If not, see <http://www.gnu.org/licenses/>.
23 */
24 
25 #include <boost/operators.hpp>
26 
27 #include <iosfwd>
28 #include <string>
29 #include <vector>
30 
31 namespace theplu {
32 namespace yat {
33 namespace omic {
34 
61  class DNA : boost::operators<DNA>
62  {
63  public:
69  DNA(void);
70 
78  explicit DNA(char c);
79 
87  DNA complement(void) const;
88 
92  char get(void) const;
93 
102  DNA& operator&=(const DNA& rhs);
103 
112  DNA& operator|=(const DNA& rhs);
113 
122  DNA& operator^=(const DNA& rhs);
123 
131  DNA& operator=(char c);
132 
133  private:
134  unsigned short code_;
135 
136  unsigned short char2code(char) const;
137  char code2char(unsigned short) const;
138  friend bool operator==(const DNA&, const DNA&);
139 };
140 
148  std::string expand(const DNA&);
149 
161  bool operator==(const DNA& lhs, const DNA& rhs);
162 
170  std::ostream& operator<<(std::ostream& os, const DNA& dna);
171 }}}
172 #endif
The Department of Theoretical Physics namespace as we define it.
DNA & operator &=(const DNA &rhs)
DNA & operator=(char c)
assign from a char
DNA complement(void) const
DNA & operator|=(const DNA &rhs)
DNA(void)
Default Constructor.
DNA & operator^=(const DNA &rhs)
Definition: DNA.h:61

Generated on Wed Jan 25 2023 03:34:29 for yat by  doxygen 1.8.14