bpp-phyl3  3.0.0
SubstitutionDistance.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_PHYL_MAPPING_SUBSTITUTIONDISTANCE_H
6 #define BPP_PHYL_MAPPING_SUBSTITUTIONDISTANCE_H
7 
8 
9 #include "SubstitutionCount.h"
10 
11 // From bpp-seq:
14 
15 namespace bpp
16 {
28  public virtual SubstitutionCountInterface
29 {
30 public:
31  virtual void setDistances(std::shared_ptr<const AlphabetIndex2> index) = 0;
32  virtual bool hasDistances() const = 0;
33  virtual std::shared_ptr<const AlphabetIndex2> getDistances() const = 0;
34 };
35 
40  public virtual SubstitutionDistance
41 {
42 protected:
43  std::shared_ptr<const AlphabetIndex2> distances_;
44 
45 public:
46  AbstractSubstitutionDistance(std::shared_ptr<const AlphabetIndex2> distances) :
47  distances_(distances)
48  {}
49 
51  distances_(index.distances_)
52  {}
53 
55  {
56  distances_ = index.distances_;
57 
58  return *this;
59  }
60 
62  {}
63 
64 public:
65  void setDistances(std::shared_ptr<const AlphabetIndex2> distances);
66  bool hasDistances() const { return distances_.get() != 0; }
67  std::shared_ptr<const AlphabetIndex2> getDistances() const { return distances_; }
68 
69 protected:
70  virtual void distancesHaveChanged() = 0;
71 };
72 } // end of namespace bpp.
73 #endif // BPP_PHYL_MAPPING_SUBSTITUTIONDISTANCE_H
Partial implementation of the SubstitutionDistance interface.
AbstractSubstitutionDistance & operator=(const AbstractSubstitutionDistance &index)
std::shared_ptr< const AlphabetIndex2 > getDistances() const
void setDistances(std::shared_ptr< const AlphabetIndex2 > distances)
AbstractSubstitutionDistance(std::shared_ptr< const AlphabetIndex2 > distances)
AbstractSubstitutionDistance(const AbstractSubstitutionDistance &index)
virtual void distancesHaveChanged()=0
std::shared_ptr< const AlphabetIndex2 > distances_
The SubstitutionsCount interface.
Interface allowing for using distances between states in substitution counts.
virtual std::shared_ptr< const AlphabetIndex2 > getDistances() const =0
virtual void setDistances(std::shared_ptr< const AlphabetIndex2 > index)=0
virtual bool hasDistances() const =0
Defines the basic types of data flow nodes.