bpp-phyl3 3.0.0
PhyloBranch.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: The Bio++ Development Group
2//
3// SPDX-License-Identifier: CECILL-2.1
4
5#include "PhyloBranch.h"
6#include "PhyloBranchParam.h"
7
8using namespace bpp;
9using namespace std;
10
13PhyloBranch::PhyloBranch(const PhyloBranch& branch) :
14 isLengthDefined_(branch.isLengthDefined_),
15 length_(branch.length_),
16 properties_()
17{
18 for (map<string, Clonable*>::iterator i = branch.properties_.begin(); i != branch.properties_.end(); i++)
19 {
20 properties_[i->first] = i->second->clone();
21 }
22}
23
24
26 isLengthDefined_(true),
27 length_(branch.getLength()),
28 properties_()
29{}
30
34{
36 length_ = branch.length_;
37
38 for (map<string, Clonable*>::iterator i = branch.properties_.begin(); i != branch.properties_.end(); i++)
39 {
40 Clonable* p = properties_[i->first];
41 if (p)
42 delete p;
43 properties_[i->first] = i->second->clone();
44 }
45 return *this;
46}
PhyloBranch()
Constructors.
Definition: PhyloBranch.h:35
PhyloBranch & operator=(const PhyloBranch &branch)
Assignation operator.
Definition: PhyloBranch.cpp:33
std::map< std::string, Clonable * > properties_
Definition: PhyloBranch.h:25
Defines the basic types of data flow nodes.