1 #ifndef GENESIS_TREE_TREE_NODE_DATA_H_
2 #define GENESIS_TREE_TREE_NODE_DATA_H_
117 static std::unique_ptr< BaseNodeData >
create()
119 return std::unique_ptr< BaseNodeData >(
new BaseNodeData() );
126 virtual std::unique_ptr< BaseNodeData >
recreate()
const
128 return std::unique_ptr< BaseNodeData >(
new BaseNodeData() );
134 virtual std::unique_ptr< BaseNodeData >
clone()
const
136 return std::unique_ptr< BaseNodeData >(
new BaseNodeData( *
this ));
144 #endif // include guard
virtual std::unique_ptr< BaseNodeData > clone() const
Polymorphically copy an instance of this class. Use instead of copy constructor.
static std::unique_ptr< BaseNodeData > create()
Create a new instance of this class. Use instead of default constructor.
Base class for storing data on Nodes of a Tree.
BaseNodeData & operator=(BaseNodeData &&)=delete
Deleted move assignment.
virtual std::unique_ptr< BaseNodeData > recreate() const
Polymorphically create a default-constructed instance of this class with the same derived type as it ...
BaseNodeData()=default
Protected default constructor. Called from the create() function.
virtual ~BaseNodeData()=default
Virtual destructor. Needed for polymorphism.