6 #include <boost/serialization/base_object.hpp>
7 #include <boost/serialization/export.hpp>
8 #include <boost/serialization/list.hpp>
9 #include <boost/serialization/nvp.hpp>
10 #include <boost/serialization/string.hpp>
11 #include <boost/serialization/shared_ptr.hpp>
12 #include <boost/serialization/utility.hpp>
13 #include <boost/serialization/version.hpp>
14 #include <boost/serialization/vector.hpp>
16 #include <boost/shared_ptr.hpp>
18 #include "alphabet.hpp"
19 //! These classes provide for the internal implementation for the Sequence class
21 /** the only purpose of this class is that the shared_ptr template
22 * functions need the serialization support to be in-class.
25 class SeqString : public std::string
28 typedef std::string::difference_type difference_type;
29 typedef std::string::iterator iterator;
30 typedef std::string::reverse_iterator reverse_iterator;
31 typedef std::string::const_iterator const_iterator;
32 typedef std::string::const_reverse_iterator const_reverse_iterator;
33 typedef std::string::reference reference;
34 typedef std::string::const_reference const_reference;
35 typedef std::string::size_type size_type;
36 typedef std::string::value_type value_type;
37 static const size_type npos = std::string::npos;
39 SeqString(AlphabetRef a=reduced_nucleic_alphabet) :
42 rc_map(Alphabet::get_alphabet(a).get_complement_map())
44 SeqString(const std::string &s, AlphabetRef a=reduced_nucleic_alphabet) :
47 rc_map(Alphabet::get_alphabet(a).get_complement_map())
50 AlphabetRef get_alphabet_ref() { return alphabet; }
51 const Alphabet& get_alphabet() const;
53 std::string create_reverse_complement_map() const;
55 const std::string rc_map;
58 friend class boost::serialization::access;
59 template<class Archive>
60 void serialize(Archive& ar, const unsigned int /*version*/) {
61 //ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(std::string);
62 ar & boost::serialization::make_nvp("bases",
63 boost::serialization::base_object<std::string>(*this)
65 ar & BOOST_SERIALIZATION_NVP(alphabet);
68 typedef boost::shared_ptr<SeqString> SeqStringRef;