bpp-seq3  3.0.0
Commentable.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #ifndef BPP_SEQ_COMMENTABLE_H
6 #define BPP_SEQ_COMMENTABLE_H
7 
8 
9 // From the STL:
10 #include <string>
11 #include <iostream>
12 
13 namespace bpp
14 {
21 typedef std::vector<std::string> Comments;
22 
24 {
25 public:
27  virtual ~Commentable() {}
28 
34  virtual const Comments& getComments() const = 0;
35 
41  virtual void setComments(const Comments& comments) = 0;
42 
43  virtual void clearComments() = 0;
44 };
45 
47  public virtual Commentable
48 {
49 protected:
51 
52 public:
54  comments_()
55  {}
56 
57  SimpleCommentable(const Comments& comments) :
58  comments_(comments)
59  {}
60 
62  comments_(com.comments_)
63  {}
64 
66  {
67  comments_ = com.comments_;
68  return *this;
69  }
70 
72  {}
73 
79  const Comments& getComments() const override { return comments_; }
80 
86  void setComments(const Comments& comments) override { comments_ = comments; }
87 
88  void clearComments() override { comments_.clear(); }
89 };
90 } // end of namespace bpp.
91 #endif // BPP_SEQ_COMMENTABLE_H
virtual const Comments & getComments() const =0
Get the comments.
virtual void setComments(const Comments &comments)=0
Set the comments.
virtual ~Commentable()
Definition: Commentable.h:27
virtual void clearComments()=0
const Comments & getComments() const override
Get the comments.
Definition: Commentable.h:79
SimpleCommentable & operator=(const SimpleCommentable &com)
Definition: Commentable.h:65
virtual ~SimpleCommentable()
Definition: Commentable.h:71
SimpleCommentable(const Comments &comments)
Definition: Commentable.h:57
void clearComments() override
Definition: Commentable.h:88
SimpleCommentable(const SimpleCommentable &com)
Definition: Commentable.h:61
void setComments(const Comments &comments) override
Set the comments.
Definition: Commentable.h:86
This alphabet is used to deal NumericAlphabet.
std::vector< std::string > Comments
Declaration of Comments type.
Definition: Commentable.h:21