5 #ifndef CNOID_UTIL_POLYMORPHIC_FUNCTION_SET_H 6 #define CNOID_UTIL_POLYMORPHIC_FUNCTION_SET_H 8 #include <boost/bind.hpp> 14 typedef boost::function<void(Parameter p)> Function;
16 bool operator ()(
const std::type_info* a,
const std::type_info* b)
const {
20 typedef std::map<const std::type_info*, Function, compare> FunctionMap;
21 FunctionMap functions;
23 bool callFuntions(
const std::type_info& type, Object*
object, Parameter& param){
24 FunctionMap::iterator p = functions.find(&type);
25 if(p != functions.end()){
26 return p->second(param);
33 functions[&
typeid(Type)] = f;
37 object->forEachActualType(boost::bind(&callFunctions,
this, _1,
object, boost::ref(param)));
Definition: PolymorphicFunctionSet.h:12
bool operator()(Object *object, Paramter ¶m)
Definition: PolymorphicFunctionSet.h:36
Defines the minimum processing for performing pasing file for STL.
Definition: AbstractSceneLoader.h:9
void setFunction(FunctionType f)
Definition: PolymorphicFunctionSet.h:32