bpp-seq3  3.0.0
CoreSequence.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_CORESEQUENCE_H
6 #define BPP_SEQ_CORESEQUENCE_H
7 
8 
9 // From the STL:
10 #include <string>
11 #include <vector>
12 
13 #include <Bpp/Clonable.h>
14 #include "CoreSymbolList.h"
15 #include "Commentable.h"
16 
17 namespace bpp
18 {
26  public virtual CruxSymbolListInterface,
27  public virtual Commentable
28 {
29 public:
30 
31 public:
33 
35 
36 public:
37  CoreSequenceInterface* clone() const override = 0;
38 
50  virtual const std::string& getName() const = 0;
51 
57  virtual void setName(const std::string& name) = 0;
76  virtual void setToSizeR(size_t newSize) = 0;
77 
86  virtual void setToSizeL(size_t newSize) = 0;
87 
89 };
90 
91 
96  public virtual CoreSequenceInterface,
97  public SimpleCommentable
98 {
99 private:
103  std::string name_;
104 
105 public:
111  AbstractCoreSequence(const std::string& name) :
113  name_(name) {}
114 
121  AbstractCoreSequence(const std::string& name, const Comments& comments) :
122  SimpleCommentable(comments),
123  name_(name) {}
124 
127  name_() {}
128 
130  Commentable(s),
131  name_(s.name_)
132  {}
133 
135  {
137  name_ = s.name_;
138  return *this;
139  }
140 
143  name_(s.getName())
144  {}
145 
147  {
149  name_ = s.getName();
150  return *this;
151  }
152 
154 
155 public:
161  virtual AbstractCoreSequence* clone() const override = 0;
170  const std::string& getName() const override { return name_; }
171 
172  void setName(const std::string& name) override { name_ = name; }
174 };
175 } // end of namespace bpp.
176 #endif // BPP_SEQ_CORESEQUENCE_H
A partial implementation of the CoreSequence interface.
Definition: CoreSequence.h:98
const std::string & getName() const override
Get the name of this sequence.
Definition: CoreSequence.h:170
void setName(const std::string &name) override
Set the name of this sequence.
Definition: CoreSequence.h:172
AbstractCoreSequence & operator=(const AbstractCoreSequence &s)
Definition: CoreSequence.h:134
AbstractCoreSequence(const AbstractCoreSequence &s)
Definition: CoreSequence.h:129
AbstractCoreSequence & operator=(const CoreSequenceInterface &s)
Definition: CoreSequence.h:146
std::string name_
The sequence name.
Definition: CoreSequence.h:103
AbstractCoreSequence(const CoreSequenceInterface &s)
Definition: CoreSequence.h:141
AbstractCoreSequence(const std::string &name, const Comments &comments)
Constructor of the AbstractCoreSequence object.
Definition: CoreSequence.h:121
AbstractCoreSequence(const std::string &name)
Constructor of the AbstractCoreSequence object.
Definition: CoreSequence.h:111
virtual AbstractCoreSequence * clone() const override=0
virtual const Comments & getComments() const =0
Get the comments.
The core sequence interface.
Definition: CoreSequence.h:28
virtual void setName(const std::string &name)=0
Set the name of this sequence.
virtual void setToSizeL(size_t newSize)=0
Set up the size of a sequence from the left side.
virtual const std::string & getName() const =0
Get the name of this sequence.
CoreSequenceInterface * clone() const override=0
virtual void setToSizeR(size_t newSize)=0
Set up the size of a sequence from the right side.
The CruxSymbolList interface.
const Comments & getComments() const override
Get the comments.
Definition: Commentable.h:79
SimpleCommentable & operator=(const SimpleCommentable &com)
Definition: Commentable.h:65
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