b102a00767b7356849abebbe2d235812cad03186
[mussa.git] / alg / seq.hpp
1 #ifndef SEQ_HPP_
2 #define SEQ_HPP_
3
4 #include <string>
5
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>
15
16 #include <boost/shared_ptr.hpp>
17
18 //! These classes provide for the internal implementation for the Sequence class
19
20 /** the only purpose of this class is that the shared_ptr template 
21  * functions need the serialization support to be in-class.
22  */
23 class SeqString : public std::string
24 {
25 public:
26   typedef std::string::difference_type difference_type;
27   typedef std::string::iterator iterator;
28   typedef std::string::reverse_iterator reverse_iterator;
29   typedef std::string::const_iterator const_iterator;
30   typedef std::string::const_reverse_iterator const_reverse_iterator;
31   typedef std::string::reference reference;
32   typedef std::string::const_reference const_reference;
33   typedef std::string::size_type size_type;
34   typedef std::string::value_type value_type;
35   static const size_type npos = std::string::npos;
36   
37   SeqString() : std::string() {};
38   SeqString(const std::string &s) : std::string(s) {};
39   
40 private:
41   friend class boost::serialization::access;
42   template<class Archive>
43   void serialize(Archive& ar, const unsigned int /*version*/) {
44     //ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(std::string);
45     ar & boost::serialization::make_nvp("bases",
46      boost::serialization::base_object<std::string>(*this)
47     );
48   }
49 };
50 typedef boost::shared_ptr<SeqString> SeqStringRef;
51  
52 #endif /*SEQ_HPP_*/