eolian-cxx: Add helper method to get all parts

Line get_all_methods, gets everything from the inherits too.
This commit is contained in:
Lauro Moura 2018-03-19 20:33:43 -03:00 committed by Felipe Magno de Almeida
parent 7fc20c08ee
commit 38bf8cc923
1 changed files with 16 additions and 0 deletions

View File

@ -1047,6 +1047,22 @@ struct klass_def
return ret;
}
std::vector<part_def> get_all_parts() const
{
std::vector<part_def> ret;
std::copy(parts.cbegin(), parts.cend(), std::back_inserter(ret));
for (auto inherit : inherits)
{
klass_def klass(get_klass(inherit, unit), unit);
std::copy(klass.parts.cbegin(), klass.parts.cend(),
std::back_inserter(ret));
}
return ret;
}
};
struct value_def