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
|
||||
{
|
||||
public:
|
||||
void defineProperty(const std::string property,
|
||||
std::function<PropertyValue (TYPE object,
|
||||
Sta *sta)> handler);
|
||||
typedef std::function<PropertyValue (TYPE object, Sta *sta)> PropertyHandler;
|
||||
void defineProperty(const std::string &property,
|
||||
PropertyHandler handler);
|
||||
PropertyValue getProperty(TYPE object,
|
||||
const std::string property,
|
||||
const std::string &property,
|
||||
const char *type_name,
|
||||
Sta *sta);
|
||||
|
||||
private:
|
||||
std::map<const std::string, std::function<PropertyValue (TYPE object,
|
||||
Sta *sta)>> registry_;
|
||||
std::map<std::string, PropertyHandler> registry_;
|
||||
};
|
||||
|
||||
class Properties
|
||||
|
|
|
|||
|
|
@ -1384,7 +1384,7 @@ Properties::defineProperty(std::string property,
|
|||
template<class TYPE>
|
||||
PropertyValue
|
||||
PropertyRegistry<TYPE>::getProperty(TYPE object,
|
||||
const std::string property,
|
||||
const std::string &property,
|
||||
const char *type_name,
|
||||
Sta *sta)
|
||||
|
||||
|
|
@ -1398,9 +1398,8 @@ PropertyRegistry<TYPE>::getProperty(TYPE object,
|
|||
|
||||
template<class TYPE>
|
||||
void
|
||||
PropertyRegistry<TYPE>::defineProperty(const std::string property,
|
||||
std::function<PropertyValue (TYPE object,
|
||||
Sta *sta)> handler)
|
||||
PropertyRegistry<TYPE>::defineProperty(const std::string &property,
|
||||
PropertyHandler handler)
|
||||
{
|
||||
registry_[property] = handler;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue