bpp-popgen3  3.0.0
MonoAlleleMonolocusGenotype.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 _MONOALLELEMONOLOCUSGENOTYPE_H_
6 #define _MONOALLELEMONOLOCUSGENOTYPE_H_
7 
8 #include <Bpp/Exceptions.h>
9 
10 // From local
11 #include "MonolocusGenotype.h"
12 
13 namespace bpp
14 {
21  public virtual MonolocusGenotypeInterface
22 {
23 private:
24  size_t alleleIndex_;
25 
26 public:
30  MonoAlleleMonolocusGenotype(size_t alleleIndex);
31 
35  MonoAlleleMonolocusGenotype(std::vector<size_t> alleleIndex);
36 
41 
45  virtual ~MonoAlleleMonolocusGenotype() = default;
46 
47 public:
52 
56  virtual bool operator==(const MonoAlleleMonolocusGenotype& mmg) const;
57 
63  std::vector<size_t> getAlleleIndex() const override;
72  {
73  return new MonoAlleleMonolocusGenotype(*this);
74  }
76 };
77 } // end of namespace bpp;
78 
79 #endif // _MONOALLELEMONOLOCUSGENOTYPE_H_
The MonoAlleleMonolocusGenotype class.
MonoAlleleMonolocusGenotype & operator=(const MonoAlleleMonolocusGenotype &mmg)
The affectation operator.
virtual ~MonoAlleleMonolocusGenotype()=default
Destroy the MonoAlleleMonolocusGenotype.
virtual bool operator==(const MonoAlleleMonolocusGenotype &mmg) const
The == operator.
std::vector< size_t > getAlleleIndex() const override
Get the alleles' index.
MonoAlleleMonolocusGenotype * clone() const override
MonoAlleleMonolocusGenotype(size_t alleleIndex)
Build a monolocus genotype containing one allele.
The MonolocusGenotype virtual class.