Cleaned up register_*_property functions

Marked inline to fix unused function warnings
This commit is contained in:
Charles Dang 2017-04-12 07:32:05 +11:00
parent e9eb98743e
commit a9e499bb64

View file

@ -288,29 +288,30 @@ private:
};
template<typename X>
static void register_vector_property(std::map<std::string,property_handler_ptr> &property_handlers, const std::string &property, std::vector< std::shared_ptr<X> > &values, std::function<void(std::vector< std::shared_ptr<X> >&, const config&)> construction_factory)
static inline void register_vector_property(property_handler_map& property_handlers, const std::string& property,
std::vector<std::shared_ptr<X>>& values, std::function<void(std::vector<std::shared_ptr<X>>&, const config&)> construction_factory)
{
property_handler_ptr handler_ptr = property_handler_ptr(new vector_property_handler<X>(property,values,construction_factory));
property_handlers.insert(std::make_pair(property,handler_ptr));
property_handler_ptr handler_ptr(new vector_property_handler<X>(property, values, construction_factory));
property_handlers.emplace(property, handler_ptr);
}
template<typename X>
static void register_facets_property(std::map<std::string,property_handler_ptr> &property_handlers, const std::string &property, std::vector< std::shared_ptr<X> > &values, std::shared_ptr<X>& def, std::function<void(std::vector< std::shared_ptr<X> >&, const config&)> construction_factory)
static inline void register_facets_property(property_handler_map& property_handlers, const std::string& property,
std::vector<std::shared_ptr<X>>& values, std::shared_ptr<X>& def, std::function<void(std::vector<std::shared_ptr<X>>&, const config&)> construction_factory)
{
property_handler_ptr handler_ptr = property_handler_ptr(new facets_property_handler<X>(property,values,def,construction_factory));
property_handlers.insert(std::make_pair(property,handler_ptr));
property_handler_ptr handler_ptr(new facets_property_handler<X>(property, values, def, construction_factory));
property_handlers.emplace(property, handler_ptr);
}
template<typename X>
static void register_aspect_property(std::map<std::string,property_handler_ptr> &property_handlers, const std::string &property, std::map< std::string, std::shared_ptr<X> > &aspects, std::function<void(std::map< std::string, std::shared_ptr<X> >&, const config&, std::string)> construction_factory)
static inline void register_aspect_property(property_handler_map& property_handlers, const std::string& property,
std::map<std::string, std::shared_ptr<X>>& aspects, std::function<void(std::map<std::string, std::shared_ptr<X>>&, const config&, std::string)> construction_factory)
{
property_handler_ptr handler_ptr = property_handler_ptr(new aspect_property_handler<X>(property,aspects,construction_factory));
property_handlers.insert(std::make_pair(property,handler_ptr));
property_handler_ptr handler_ptr(new aspect_property_handler<X>(property, aspects, construction_factory));
property_handlers.emplace(property, handler_ptr);
}
} //of namespace ai
#endif