bpp-phyl3 3.0.0
PhyloNode.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 <iostream>
6
7#include "PhyloNode.h"
8
9using namespace bpp;
10using namespace std;
11
12const NodeEvent NodeEvent::speciationEvent(NodeEvent::NodeType::Speciation);
13const NodeEvent NodeEvent::mixtureEvent(NodeEvent::NodeType::Mixture);
14const NodeEvent NodeEvent::hybridizationEvent(NodeEvent::NodeType::Hybridization);
15
18PhyloNode::PhyloNode(const PhyloNode& node) :
19 name_(node.name_),
20 properties_()
21{
22 for (map<string, Clonable*>::iterator i = node.properties_.begin(); i != node.properties_.end(); i++)
23 {
24 properties_[i->first] = i->second->clone();
25 }
26}
27
31{
32 name_ = node.name_;
33 for (map<string, Clonable*>::iterator i = node.properties_.begin(); i != node.properties_.end(); i++)
34 {
35 Clonable* p = properties_[i->first];
36 if (p)
37 delete p;
38 properties_[i->first] = i->second->clone();
39 }
40
41 return *this;
42}
43
44/******************************************************************************/
std::string name_
Definition: PhyloNode.h:69
std::map< std::string, Clonable * > properties_
Definition: PhyloNode.h:72
PhyloNode & operator=(const PhyloNode &node)
Assignation operator.
Definition: PhyloNode.cpp:30
Defines the basic types of data flow nodes.