Added flags parameter to register_property method
- flags parameter is set by default to vtable::property_::emits_change
- with this change user can set parameter to vtable::property_::none
to avoid sending property change signal for greater performance
- added example/register-property.cpp with example application
which uses new functions
Tested:
- run openbmc tests with this change, no regression detected
- tested that default behaviour (property_::emits_change) is working as intended
- tested that properties still signal change when emit_change flag is used
- tested that properties doesn't signal change when no emit_change flag is used
- tested that const flag is passed and handled corretly
- verified that performance of application increases when emit_change flag turned off
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Change-Id: If6187cf076b8e05a5211c83797374a3be94da0c9
diff --git a/example/meson.build b/example/meson.build
index 957c01d..aed2a33 100644
--- a/example/meson.build
+++ b/example/meson.build
@@ -22,6 +22,19 @@
dependencies: [ boost_dep, sdbusplus_dep ],
)
+executable(
+ 'register-property',
+ 'register-property.cpp',
+ cpp_args: [
+ '-DBOOST_ASIO_DISABLE_THREADS',
+ '-DBOOST_ALL_NO_LIB',
+ '-DBOOST_SYSTEM_NO_DEPRECATED',
+ '-DBOOST_ERROR_CODE_HEADER_ONLY',
+ '-DBOOST_COROUTINES_NO_DEPRECATION_WARNING',
+ ],
+ dependencies: [ boost_dep, sdbusplus_dep ],
+)
+
calc_buildroot = meson.current_build_dir()
calc_files = files(
run_command(