Loading services/inputflinger/reader/mapper/gestures/PropertyProvider.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -68,11 +68,11 @@ const GesturesPropProvider gesturePropProvider = { .free_fn = freeProperty, }; bool PropertyProvider::hasProperty(const std::string name) const { bool PropertyProvider::hasProperty(const std::string& name) const { return mProperties.find(name) != mProperties.end(); } GesturesProp& PropertyProvider::getProperty(const std::string name) { GesturesProp& PropertyProvider::getProperty(const std::string& name) { return mProperties.at(name); } Loading @@ -84,7 +84,7 @@ std::string PropertyProvider::dump() const { return dump; } GesturesProp* PropertyProvider::createIntArrayProperty(const std::string name, int* loc, GesturesProp* PropertyProvider::createIntArrayProperty(const std::string& name, int* loc, size_t count, const int* init) { const auto [it, inserted] = mProperties.insert(std::pair{name, GesturesProp(name, loc, count, init)}); Loading @@ -92,7 +92,7 @@ GesturesProp* PropertyProvider::createIntArrayProperty(const std::string name, i return &it->second; } GesturesProp* PropertyProvider::createBoolArrayProperty(const std::string name, GesturesProp* PropertyProvider::createBoolArrayProperty(const std::string& name, GesturesPropBool* loc, size_t count, const GesturesPropBool* init) { const auto [it, inserted] = Loading @@ -101,7 +101,7 @@ GesturesProp* PropertyProvider::createBoolArrayProperty(const std::string name, return &it->second; } GesturesProp* PropertyProvider::createRealArrayProperty(const std::string name, double* loc, GesturesProp* PropertyProvider::createRealArrayProperty(const std::string& name, double* loc, size_t count, const double* init) { const auto [it, inserted] = mProperties.insert(std::pair{name, GesturesProp(name, loc, count, init)}); Loading @@ -109,7 +109,7 @@ GesturesProp* PropertyProvider::createRealArrayProperty(const std::string name, return &it->second; } GesturesProp* PropertyProvider::createStringProperty(const std::string name, const char** loc, GesturesProp* PropertyProvider::createStringProperty(const std::string& name, const char** loc, const char* const init) { const auto [it, inserted] = mProperties.insert(std::pair{name, GesturesProp(name, loc, init)}); LOG_ALWAYS_FATAL_IF(!inserted, "Gesture property \"%s\" already exists.", name.c_str()); Loading services/inputflinger/reader/mapper/gestures/PropertyProvider.h +6 −6 Original line number Diff line number Diff line Loading @@ -31,18 +31,18 @@ extern const GesturesPropProvider gesturePropProvider; // Implementation of a gestures library property provider, which provides configuration parameters. class PropertyProvider { public: bool hasProperty(const std::string name) const; GesturesProp& getProperty(const std::string name); bool hasProperty(const std::string& name) const; GesturesProp& getProperty(const std::string& name); std::string dump() const; // Methods to be called by the gestures library: GesturesProp* createIntArrayProperty(const std::string name, int* loc, size_t count, GesturesProp* createIntArrayProperty(const std::string& name, int* loc, size_t count, const int* init); GesturesProp* createBoolArrayProperty(const std::string name, GesturesPropBool* loc, GesturesProp* createBoolArrayProperty(const std::string& name, GesturesPropBool* loc, size_t count, const GesturesPropBool* init); GesturesProp* createRealArrayProperty(const std::string name, double* loc, size_t count, GesturesProp* createRealArrayProperty(const std::string& name, double* loc, size_t count, const double* init); GesturesProp* createStringProperty(const std::string name, const char** loc, GesturesProp* createStringProperty(const std::string& name, const char** loc, const char* const init); void freeProperty(GesturesProp* prop); Loading Loading
services/inputflinger/reader/mapper/gestures/PropertyProvider.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -68,11 +68,11 @@ const GesturesPropProvider gesturePropProvider = { .free_fn = freeProperty, }; bool PropertyProvider::hasProperty(const std::string name) const { bool PropertyProvider::hasProperty(const std::string& name) const { return mProperties.find(name) != mProperties.end(); } GesturesProp& PropertyProvider::getProperty(const std::string name) { GesturesProp& PropertyProvider::getProperty(const std::string& name) { return mProperties.at(name); } Loading @@ -84,7 +84,7 @@ std::string PropertyProvider::dump() const { return dump; } GesturesProp* PropertyProvider::createIntArrayProperty(const std::string name, int* loc, GesturesProp* PropertyProvider::createIntArrayProperty(const std::string& name, int* loc, size_t count, const int* init) { const auto [it, inserted] = mProperties.insert(std::pair{name, GesturesProp(name, loc, count, init)}); Loading @@ -92,7 +92,7 @@ GesturesProp* PropertyProvider::createIntArrayProperty(const std::string name, i return &it->second; } GesturesProp* PropertyProvider::createBoolArrayProperty(const std::string name, GesturesProp* PropertyProvider::createBoolArrayProperty(const std::string& name, GesturesPropBool* loc, size_t count, const GesturesPropBool* init) { const auto [it, inserted] = Loading @@ -101,7 +101,7 @@ GesturesProp* PropertyProvider::createBoolArrayProperty(const std::string name, return &it->second; } GesturesProp* PropertyProvider::createRealArrayProperty(const std::string name, double* loc, GesturesProp* PropertyProvider::createRealArrayProperty(const std::string& name, double* loc, size_t count, const double* init) { const auto [it, inserted] = mProperties.insert(std::pair{name, GesturesProp(name, loc, count, init)}); Loading @@ -109,7 +109,7 @@ GesturesProp* PropertyProvider::createRealArrayProperty(const std::string name, return &it->second; } GesturesProp* PropertyProvider::createStringProperty(const std::string name, const char** loc, GesturesProp* PropertyProvider::createStringProperty(const std::string& name, const char** loc, const char* const init) { const auto [it, inserted] = mProperties.insert(std::pair{name, GesturesProp(name, loc, init)}); LOG_ALWAYS_FATAL_IF(!inserted, "Gesture property \"%s\" already exists.", name.c_str()); Loading
services/inputflinger/reader/mapper/gestures/PropertyProvider.h +6 −6 Original line number Diff line number Diff line Loading @@ -31,18 +31,18 @@ extern const GesturesPropProvider gesturePropProvider; // Implementation of a gestures library property provider, which provides configuration parameters. class PropertyProvider { public: bool hasProperty(const std::string name) const; GesturesProp& getProperty(const std::string name); bool hasProperty(const std::string& name) const; GesturesProp& getProperty(const std::string& name); std::string dump() const; // Methods to be called by the gestures library: GesturesProp* createIntArrayProperty(const std::string name, int* loc, size_t count, GesturesProp* createIntArrayProperty(const std::string& name, int* loc, size_t count, const int* init); GesturesProp* createBoolArrayProperty(const std::string name, GesturesPropBool* loc, GesturesProp* createBoolArrayProperty(const std::string& name, GesturesPropBool* loc, size_t count, const GesturesPropBool* init); GesturesProp* createRealArrayProperty(const std::string name, double* loc, size_t count, GesturesProp* createRealArrayProperty(const std::string& name, double* loc, size_t count, const double* init); GesturesProp* createStringProperty(const std::string name, const char** loc, GesturesProp* createStringProperty(const std::string& name, const char** loc, const char* const init); void freeProperty(GesturesProp* prop); Loading