summaryrefslogtreecommitdiffstats
path: root/org
diff options
context:
space:
mode:
authorDeepak Kodihalli <dkodihal@in.ibm.com>2017-02-27 00:22:50 -0600
committerDeepak Kodihalli <dkodihal@in.ibm.com>2017-03-15 09:20:14 -0500
commit867f7aa7098ebcc3f62fec7faa6121390d1bd055 (patch)
tree95b893fb018a14db974d22431e60cec2858aa13c /org
parent98a1834c461836302bd3c0bc66cc4f6e1e55cd57 (diff)
downloadphosphor-logging-867f7aa7098ebcc3f62fec7faa6121390d1bd055.tar.gz
phosphor-logging-867f7aa7098ebcc3f62fec7faa6121390d1bd055.zip
Generate sdbusplus bindings
Generate sdbusplus server bindings for the org.openbmc.Associations interface. Add YAML file that describes the org.openbmc.Associations interface. Change-Id: Ic72e372ec817a49f4e6f5305b693173d90ee5e24 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
Diffstat (limited to 'org')
-rw-r--r--org/openbmc/Associations.interface.yaml13
-rw-r--r--org/openbmc/Associations/server.hpp101
2 files changed, 114 insertions, 0 deletions
diff --git a/org/openbmc/Associations.interface.yaml b/org/openbmc/Associations.interface.yaml
new file mode 100644
index 0000000..9be60ce
--- /dev/null
+++ b/org/openbmc/Associations.interface.yaml
@@ -0,0 +1,13 @@
+description: >
+ Implement to delegate org.openbmc.Association interface management
+ responsibilities to another application.
+properties:
+ - name: associations
+ type: array[struct[string,string,string]]
+ description: >
+ An array of forward, reverse, endpoint tuples where:
+ forward - The type of the association.
+ reverse - The type of the association to create for the endpoint.
+ endpoint - The association endpoint.
+
+# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
diff --git a/org/openbmc/Associations/server.hpp b/org/openbmc/Associations/server.hpp
new file mode 100644
index 0000000..7a597ce
--- /dev/null
+++ b/org/openbmc/Associations/server.hpp
@@ -0,0 +1,101 @@
+#pragma once
+#include <tuple>
+#include <systemd/sd-bus.h>
+#include <sdbusplus/server.hpp>
+
+namespace sdbusplus
+{
+namespace org
+{
+namespace openbmc
+{
+namespace server
+{
+
+class Associations
+{
+ public:
+ /* Define all of the basic class operations:
+ * Not allowed:
+ * - Default constructor to avoid nullptrs.
+ * - Copy operations due to internal unique_ptr.
+ * - Move operations due to 'this' being registered as the
+ * 'context' with sdbus.
+ * Allowed:
+ * - Destructor.
+ */
+ Associations() = delete;
+ Associations(const Associations&) = delete;
+ Associations& operator=(const Associations&) = delete;
+ Associations(Associations&&) = delete;
+ Associations& operator=(Associations&&) = delete;
+ virtual ~Associations() = default;
+
+ /** @brief Constructor to put object onto bus at a dbus path.
+ * @param[in] bus - Bus to attach to.
+ * @param[in] path - Path to attach at.
+ */
+ Associations(bus::bus& bus, const char* path);
+
+
+ using PropertiesVariant = sdbusplus::message::variant<
+ std::vector<std::tuple<std::string, std::string, std::string>>>;
+
+ /** @brief Constructor to initialize the object from a map of
+ * properties.
+ *
+ * @param[in] bus - Bus to attach to.
+ * @param[in] path - Path to attach at.
+ * @param[in] vals - Map of property name to value for initalization.
+ */
+ Associations(bus::bus& bus, const char* path,
+ const std::map<std::string, PropertiesVariant>& vals);
+
+
+
+ /** Get value of associations */
+ virtual std::vector<std::tuple<std::string, std::string, std::string>> associations() const;
+ /** Set value of associations */
+ virtual std::vector<std::tuple<std::string, std::string, std::string>> associations(std::vector<std::tuple<std::string, std::string, std::string>> value);
+
+ /** @brief Sets a property by name.
+ * @param[in] name - A string representation of the property name.
+ * @param[in] val - A variant containing the value to set.
+ */
+ void setPropertyByName(const std::string& name,
+ const PropertiesVariant& val);
+
+ /** @brief Gets a property by name.
+ * @param[in] name - A string representation of the property name.
+ * @return - A variant containing the value of the property.
+ */
+ PropertiesVariant getPropertyByName(const std::string& name);
+
+
+ private:
+
+ /** @brief sd-bus callback for get-property 'associations' */
+ static int _callback_get_associations(
+ sd_bus*, const char*, const char*, const char*,
+ sd_bus_message*, void*, sd_bus_error*);
+ /** @brief sd-bus callback for set-property 'associations' */
+ static int _callback_set_associations(
+ sd_bus*, const char*, const char*, const char*,
+ sd_bus_message*, void*, sd_bus_error*);
+
+
+ static constexpr auto _interface = "org.openbmc.Associations";
+ static const vtable::vtable_t _vtable[];
+ sdbusplus::server::interface::interface
+ _org_openbmc_Associations_interface;
+
+ std::vector<std::tuple<std::string, std::string, std::string>> _associations{};
+
+};
+
+
+} // namespace server
+} // namespace openbmc
+} // namespace org
+} // namespace sdbusplus
+
OpenPOWER on IntegriCloud