refactoring: move makeDecisionItem, and use new interface 58/246358/2
authorAdrian Szyndela <adrian.s@samsung.com>
Wed, 28 Oct 2020 08:02:06 +0000 (09:02 +0100)
committerAdrian Szyndela <adrian.s@samsung.com>
Fri, 30 Oct 2020 11:37:28 +0000 (12:37 +0100)
Change-Id: Ibb64103c318ff1cf404dd23bdf837c28da06a120

src/internal/serialized_convert.hpp
src/internal/storage_backend_flatbuffers.cpp
src/internal/storage_backend_flatbuffers.hpp

index de00f2f..5d0b8af 100644 (file)
@@ -24,11 +24,6 @@ ldp_xml_parser::Decision makeDecision(D d) {
        return static_cast<ldp_xml_parser::Decision>(d);
 }
 
-template <typename DI>
-inline ldp_xml_parser::DecisionItem makeDecisionItem(const DI *di) {
-       return ldp_xml_parser::DecisionItem(makeDecision(di->decision()), di->privilege()->c_str());
-}
-
 template <typename T>
 ldp_xml_parser::BusAccessType makeBusAccessType(T type) {
        return static_cast<ldp_xml_parser::BusAccessType>(type);
index 1b0b84e..6aedb60 100644 (file)
@@ -35,6 +35,11 @@ const unsigned int FB_ID_SIZE = 4;
 template <typename T>
 struct type_helper;
 
+ldp_xml_parser::DecisionItem StorageBackendFlatbuffers::makeDecisionItem(const DecisionItem *item) const {
+       return ldp_xml_parser::DecisionItem(makeDecision(decisionItemGetDecision(item)),
+                                                        stringGetCStr(decisionItemGetPrivilege(item)));
+}
+
 boost::string_ref StorageBackendFlatbuffers::toStringRef(const flatbuffers::String *str) const {
        return boost::string_ref(str->c_str(), str->size());
 }
index f5181ff..f831282 100644 (file)
@@ -230,6 +230,8 @@ private:
 
        bool match(const ldp_xml_parser::MatchItemAccess &match, const FB::ItemAccess *item) const;
 
+       ldp_xml_parser::DecisionItem makeDecisionItem(const FB::DecisionItem *item) const;
+
        boost::string_ref toStringRef(const flatbuffers::String *str) const;
 };