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 
8 using namespace bpp;
9 using namespace std;
10 
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 }
31 
35 {
37  length_ = branch.length_;
38 
39  for (map<string, Clonable*>::iterator i = branch.properties_.begin(); i != branch.properties_.end(); i++)
40  {
41  Clonable* p = properties_[i->first];
42  if (p)
43  delete p;
44  properties_[i->first] = i->second->clone();
45  }
46  return *this;
47 }
PhyloBranch()
Constructors.
Definition: PhyloBranch.h:35
PhyloBranch & operator=(const PhyloBranch &branch)
Assignation operator.
Definition: PhyloBranch.cpp:34
std::map< std::string, Clonable * > properties_
Definition: PhyloBranch.h:25
Defines the basic types of data flow nodes.