PropertyRegistry use string ref args
Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
parent
e9ecb6cefb
commit
b431135550
|
|
@ -46,17 +46,16 @@ template<class TYPE>
|
||||||
class PropertyRegistry
|
class PropertyRegistry
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void defineProperty(const std::string property,
|
typedef std::function<PropertyValue (TYPE object, Sta *sta)> PropertyHandler;
|
||||||
std::function<PropertyValue (TYPE object,
|
void defineProperty(const std::string &property,
|
||||||
Sta *sta)> handler);
|
PropertyHandler handler);
|
||||||
PropertyValue getProperty(TYPE object,
|
PropertyValue getProperty(TYPE object,
|
||||||
const std::string property,
|
const std::string &property,
|
||||||
const char *type_name,
|
const char *type_name,
|
||||||
Sta *sta);
|
Sta *sta);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::map<const std::string, std::function<PropertyValue (TYPE object,
|
std::map<std::string, PropertyHandler> registry_;
|
||||||
Sta *sta)>> registry_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class Properties
|
class Properties
|
||||||
|
|
|
||||||
|
|
@ -1384,7 +1384,7 @@ Properties::defineProperty(std::string property,
|
||||||
template<class TYPE>
|
template<class TYPE>
|
||||||
PropertyValue
|
PropertyValue
|
||||||
PropertyRegistry<TYPE>::getProperty(TYPE object,
|
PropertyRegistry<TYPE>::getProperty(TYPE object,
|
||||||
const std::string property,
|
const std::string &property,
|
||||||
const char *type_name,
|
const char *type_name,
|
||||||
Sta *sta)
|
Sta *sta)
|
||||||
|
|
||||||
|
|
@ -1398,9 +1398,8 @@ PropertyRegistry<TYPE>::getProperty(TYPE object,
|
||||||
|
|
||||||
template<class TYPE>
|
template<class TYPE>
|
||||||
void
|
void
|
||||||
PropertyRegistry<TYPE>::defineProperty(const std::string property,
|
PropertyRegistry<TYPE>::defineProperty(const std::string &property,
|
||||||
std::function<PropertyValue (TYPE object,
|
PropertyHandler handler)
|
||||||
Sta *sta)> handler)
|
|
||||||
{
|
{
|
||||||
registry_[property] = handler;
|
registry_[property] = handler;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue