Improved Refish subroutes
- getSubroutes() is now a method of the Node class
- getSubroutes() is called only once per node at construction time,
not at each GET request
- template parameter removed from the Node class
Change-Id: Ie4eb8766717aae566c13c295458fe0dba8ab84c0
Signed-off-by: Borawski.Lukasz <lukasz.borawski@intel.com>
diff --git a/redfish-core/include/redfish.hpp b/redfish-core/include/redfish.hpp
index 0e059b8..fc8c080 100644
--- a/redfish-core/include/redfish.hpp
+++ b/redfish-core/include/redfish.hpp
@@ -19,6 +19,7 @@
#include "../lib/redfish_sessions.hpp"
#include "../lib/roles.hpp"
#include "../lib/service_root.hpp"
+#include "webserver_common.hpp"
namespace redfish {
/*
@@ -33,13 +34,16 @@
*
* @param[in] app Crow app on which Redfish will initialize
*/
- template <typename CrowApp>
RedfishService(CrowApp& app) {
nodes.emplace_back(std::make_unique<AccountService>(app));
nodes.emplace_back(std::make_unique<SessionCollection>(app));
nodes.emplace_back(std::make_unique<Roles>(app));
nodes.emplace_back(std::make_unique<RoleCollection>(app));
nodes.emplace_back(std::make_unique<ServiceRoot>(app));
+
+ for (auto& node : nodes) {
+ node->getSubRoutes(nodes);
+ }
}
private: