Move alphabet type into SeqString
[mussa.git] / alg / seq.hpp
index b102a00767b7356849abebbe2d235812cad03186..5ac42a2bb220ec58630ec4c1138ca6c9ee8c422b 100644 (file)
 
 #include <boost/shared_ptr.hpp>
 
+#include "alphabet.hpp"
 //! These classes provide for the internal implementation for the Sequence class
 
 /** the only purpose of this class is that the shared_ptr template 
  * functions need the serialization support to be in-class.
  */
+
 class SeqString : public std::string
 {
 public:
@@ -34,17 +36,29 @@ public:
   typedef std::string::value_type value_type;
   static const size_type npos = std::string::npos;
   
-  SeqString() : std::string() {};
-  SeqString(const std::string &s) : std::string(s) {};
+  SeqString(AlphabetRef a=reduced_nucleic_alphabet) : 
+    std::string(),
+    alphabet(a) 
+  {}
+  SeqString(const std::string &s, AlphabetRef a=reduced_nucleic_alphabet) : 
+    std::string(s),
+    alphabet(a)
+  {}
+
+  AlphabetRef get_alphabet_ref() { return alphabet; }
+  const Alphabet& get_alphabet() const;
   
+  std::string create_reverse_complement_map() const;
 private:
+  AlphabetRef alphabet;
   friend class boost::serialization::access;
   template<class Archive>
   void serialize(Archive& ar, const unsigned int /*version*/) {
     //ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(std::string);
     ar & boost::serialization::make_nvp("bases",
-     boost::serialization::base_object<std::string>(*this)
+      boost::serialization::base_object<std::string>(*this)
     );
+    ar & BOOST_SERIALIZATION_NVP(alphabet);
   }
 };
 typedef boost::shared_ptr<SeqString> SeqStringRef;