1 #ifndef GENESIS_UTILS_FORMATS_NEXUS_TREES_H_ 2 #define GENESIS_UTILS_FORMATS_NEXUS_TREES_H_ 99 swap( entries_, other.entries_ );
126 return entries_.empty();
131 return entries_.size();
136 return entries_.end() != std::find_if(
140 return entry.name ==
name;
160 return entries_.cbegin();
165 return entries_.cend();
177 throw std::invalid_argument(
178 "Tree with name '" + name +
"' already exists in this tree block." 187 entries_.push_back({
name, std::vector<std::string>{}, tree });
195 [&name] (
Entry const& entry) {
219 for(
auto& entry : entries_ ) {
220 os <<
" TREE " << entry.name <<
" = ";
221 for(
auto& prop : entry.properties ) {
222 os <<
"[" << prop <<
"] ";
224 os << entry.tree <<
"\n";
250 #endif // include guard container::const_iterator const_iterator
Provides some valuable algorithms that are not part of the C++ 11 STL.
void erase_if(Container &c, UnaryPredicate p)
Erases all elements from the container that satisfy a given predicate. An element is erased...
NexusTrees & operator=(NexusTrees const &)=default
void swap(NexusTrees &other)
Container namespace for all symbols of genesis in order to keep them separate when used as a library...
void swap(NexusTrees &lhs, NexusTrees &rhs)
virtual ~NexusTrees() override=default
void add_tree(std::string const &name, std::string const &tree)
const_iterator begin() const
std::vector< Entry > container
bool has_tree(std::string const &name) const
void erase_tree(std::string const &name)
std::vector< std::string > properties
const_iterator end() const
std::string block_name() const override
void to_stream(std::ostream &os) const override