bpp-seq3  3.0.0
CoreSite.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_CORESITE_H
6 #define BPP_SEQ_CORESITE_H
7 
8 #include <Bpp/Clonable.h>
9 #include "CoreSymbolList.h"
10 
11 namespace bpp
12 {
24  public virtual CruxSymbolListInterface
25 {
26 public:
32  CoreSiteInterface* clone() const override = 0;
33 
38  // class destructor
39  virtual ~CoreSiteInterface() {}
40 
52  virtual int getCoordinate() const = 0;
53 
59  virtual void setCoordinate(int coordinate) = 0;
60 
72  virtual double getStateValueAt(size_t sequencePosition, int state) const override = 0;
73 };
74 
79  public virtual CoreSiteInterface
80 {
81 private:
86 
87 public:
94  coordinate_(0) {}
95 
101  AbstractCoreSite(int coordinate) :
102  coordinate_(coordinate) {}
103 
110  coordinate_(site.getCoordinate()) {}
111 
113  coordinate_(site.coordinate_) {}
114 
125  {
126  coordinate_ = site.getCoordinate();
127  return *this;
128  }
129 
131  {
132  coordinate_ = site.coordinate_;
133  return *this;
134  }
135 
140  // class destructor
141  virtual ~AbstractCoreSite() {}
142 
143 public:
144  int getCoordinate() const override { return coordinate_; }
145 
146  void setCoordinate(int coordinate) override { coordinate_ = coordinate; }
147 };
148 } // end of namespace bpp.
149 #endif // BPP_SEQ_CORESITE_H
A partial implementation of the CoreSite interface.
Definition: CoreSite.h:80
int coordinate_
The position associated with this site.
Definition: CoreSite.h:85
AbstractCoreSite(const AbstractCoreSite &site)
Definition: CoreSite.h:112
AbstractCoreSite & operator=(const CoreSiteInterface &site)
Definition: CoreSite.h:124
AbstractCoreSite(const CoreSiteInterface &site)
Definition: CoreSite.h:109
AbstractCoreSite & operator=(const AbstractCoreSite &site)
Definition: CoreSite.h:130
virtual ~AbstractCoreSite()
Definition: CoreSite.h:141
AbstractCoreSite(int coordinate)
Constructor of the AbstractCoreSite object.
Definition: CoreSite.h:101
AbstractCoreSite()
Constructor of the AbstractCoreSite object.
Definition: CoreSite.h:93
void setCoordinate(int coordinate) override
Set the position of this site.
Definition: CoreSite.h:146
int getCoordinate() const override
Get the coordinate associated to this site.
Definition: CoreSite.h:144
The core site interface.
Definition: CoreSite.h:25
CoreSiteInterface * clone() const override=0
virtual ~CoreSiteInterface()
Definition: CoreSite.h:39
virtual int getCoordinate() const =0
Get the coordinate associated to this site.
virtual void setCoordinate(int coordinate)=0
Set the position of this site.
virtual double getStateValueAt(size_t sequencePosition, int state) const override=0
get value of a state at a position
The CruxSymbolList interface.
This alphabet is used to deal NumericAlphabet.