24 for (
const auto& existingAllele : alleles_)
26 if (existingAllele->getId() == allele.
getId())
29 alleles_.push_back(unique_ptr<AlleleInfo>(allele.
clone()));
34 for (
unsigned int i = 0; i < alleles_.size(); i++)
36 if (alleles_[i]->getId() ==
id)
44 if (key >= alleles_.size())
46 return *(alleles_[key]);
51 for (
unsigned int i = 0; i < alleles_.size(); ++i)
53 if (alleles_[i]->getId() ==
id)
The AlleleInfo interface.
virtual const std::string & getId() const =0
Get the identitier of the allele.
AlleleInfo * clone() const =0
The AlleleNotFoundException class.
The BadIdentifierException class.
static unsigned int UNKNOWN
unsigned int getAlleleInfoKey(const std::string &id) const
Get the position of an AlleleInfo.
static unsigned int DIPLOID
const AlleleInfo & getAlleleInfoByKey(size_t key) const
Retrieve an AlleleInfo object of the LocusInfo.
static unsigned int HAPLOID
void addAlleleInfo(const AlleleInfo &allele)
Add an AlleleInfo to the LocusInfo.
static unsigned int HAPLODIPLOID
const AlleleInfo & getAlleleInfoById(const std::string &id) const
Retrieve an AlleleInfo object of the LocusInfo.