/** * (C) 2016 - 2024 Stanislav Angelovic * * @file VTableItems.h * * Created on: Dec 14, 2023 * Project: sdbus-c++ * Description: High-level D-Bus IPC C++ library based on sd-bus * * This file is part of sdbus-c++. * * sdbus-c++ is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 2.1 of the License, or * (at your option) any later version. * * sdbus-c++ is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with sdbus-c++. If not, see . */ #ifndef SDBUS_CXX_VTABLEITEMS_H_ #define SDBUS_CXX_VTABLEITEMS_H_ #include #include #include #include #include #include namespace sdbus { struct MethodVTableItem { template MethodVTableItem& implementedAs(_Function&& callback); MethodVTableItem& withInputParamNames(std::vector names); template MethodVTableItem& withInputParamNames(_String... names); MethodVTableItem& withOutputParamNames(std::vector names); template MethodVTableItem& withOutputParamNames(_String... names); MethodVTableItem& markAsDeprecated(); MethodVTableItem& markAsPrivileged(); MethodVTableItem& withNoReply(); MethodName name; Signature inputSignature; std::vector inputParamNames; Signature outputSignature; std::vector outputParamNames; method_callback callbackHandler; Flags flags; }; MethodVTableItem registerMethod(MethodName methodName); MethodVTableItem registerMethod(std::string methodName); struct SignalVTableItem { template SignalVTableItem& withParameters(); template SignalVTableItem& withParameters(std::vector names); template SignalVTableItem& withParameters(_String... names); SignalVTableItem& markAsDeprecated(); SignalName name; Signature signature; std::vector paramNames; Flags flags; }; SignalVTableItem registerSignal(SignalName signalName); SignalVTableItem registerSignal(std::string signalName); struct PropertyVTableItem { template PropertyVTableItem& withGetter(_Function&& callback); template PropertyVTableItem& withSetter(_Function&& callback); PropertyVTableItem& markAsDeprecated(); PropertyVTableItem& markAsPrivileged(); PropertyVTableItem& withUpdateBehavior(Flags::PropertyUpdateBehaviorFlags behavior); PropertyName name; Signature signature; property_get_callback getter; property_set_callback setter; Flags flags; }; PropertyVTableItem registerProperty(PropertyName propertyName); PropertyVTableItem registerProperty(std::string propertyName); struct InterfaceFlagsVTableItem { InterfaceFlagsVTableItem& markAsDeprecated(); InterfaceFlagsVTableItem& markAsPrivileged(); InterfaceFlagsVTableItem& withNoReplyMethods(); InterfaceFlagsVTableItem& withPropertyUpdateBehavior(Flags::PropertyUpdateBehaviorFlags behavior); Flags flags; }; InterfaceFlagsVTableItem setInterfaceFlags(); using VTableItem = std::variant; } // namespace sdbus #endif /* SDBUS_CXX_VTABLEITEMS_H_ */