summaryrefslogtreecommitdiff
path: root/src/lib/eolian_cxx
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2018-03-19 20:33:43 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2018-03-20 16:50:30 -0300
commit38bf8cc92361b67c6d80296d4f335a0ce8ba30f3 (patch)
tree29054d0bf78da17162b68cc44e8ad3990d5cc8ec /src/lib/eolian_cxx
parent7fc20c08ee9c37376bd61bb185b17b379d490eab (diff)
eolian-cxx: Add helper method to get all parts
Line get_all_methods, gets everything from the inherits too.
Diffstat (limited to 'src/lib/eolian_cxx')
-rw-r--r--src/lib/eolian_cxx/grammar/klass_def.hpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp
index 124c99ba42..21a1d7b8d1 100644
--- a/src/lib/eolian_cxx/grammar/klass_def.hpp
+++ b/src/lib/eolian_cxx/grammar/klass_def.hpp
@@ -1047,6 +1047,22 @@ struct klass_def
1047 1047
1048 return ret; 1048 return ret;
1049 } 1049 }
1050
1051 std::vector<part_def> get_all_parts() const
1052 {
1053 std::vector<part_def> ret;
1054
1055 std::copy(parts.cbegin(), parts.cend(), std::back_inserter(ret));
1056
1057 for (auto inherit : inherits)
1058 {
1059 klass_def klass(get_klass(inherit, unit), unit);
1060 std::copy(klass.parts.cbegin(), klass.parts.cend(),
1061 std::back_inserter(ret));
1062 }
1063
1064 return ret;
1065 }
1050}; 1066};
1051 1067
1052struct value_def 1068struct value_def