diff options
author | Andrew Geissler <geissonator@yahoo.com> | 2019-02-27 09:57:37 -0600 |
---|---|---|
committer | Matt Spinler <spinler@us.ibm.com> | 2019-04-05 15:05:32 +0000 |
commit | 70461896775208bbe400cc23786ce4d17a0c07f7 (patch) | |
tree | 68af45f3182e1839787a077a9fada3fe05dfa45b /src/processing.hpp | |
parent | 0a560a5c4f6447e2c8b4ba7216abebebe9aea0dd (diff) | |
download | phosphor-objmgr-70461896775208bbe400cc23786ce4d17a0c07f7.tar.gz phosphor-objmgr-70461896775208bbe400cc23786ce4d17a0c07f7.zip |
unit-test: Move processing of interfaces added
Make it easier to unit test and continue reduction of main.cpp
Change-Id: Id360255e1546eda026e5e6ef9f15d29dcc82caaa
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Diffstat (limited to 'src/processing.hpp')
-rw-r--r-- | src/processing.hpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/processing.hpp b/src/processing.hpp index 8ef6e48..d5ed2b4 100644 --- a/src/processing.hpp +++ b/src/processing.hpp @@ -23,6 +23,17 @@ using interface_map_type = boost::container::flat_map< std::string, boost::container::flat_map< std::string, boost::container::flat_set<std::string>>>; +/** @brief InterfacesAdded represents the dbus data from the signal + * + * There are 2 pairs + * pair1: D-bus Interface,vector[pair2] + * pair2: D-bus Method,vector[Associations] + */ +using InterfacesAdded = std::vector<std::pair< + std::string, + std::vector<std::pair< + std::string, sdbusplus::message::variant<std::vector<Association>>>>>>; + /** @brief Get well known name of input unique name * * If user passes in well known name then that will be returned. @@ -70,3 +81,22 @@ void processNameChangeDelete( interface_map_type& interfaceMap, AssociationOwnersType& assocOwners, AssociationInterfaces& assocInterfaces, sdbusplus::asio::object_server& server); + +/** @brief Handle an interfaces added signal + * + * @param[in,out] interfaceMap - Global map of interfaces + * @param[in] objPath - New path to process + * @param[in] interfacesAdded - New interfaces to process + * @param[in] wellKnown - Well known name that has new owner + * @param[in,out] assocOwners - Owners of associations + * @param[in,out] assocInterfaces - Associations endpoints + * @param[in,out] server - sdbus system object + * + */ +void processInterfaceAdded(interface_map_type& interfaceMap, + const sdbusplus::message::object_path& objPath, + const InterfacesAdded& intfAdded, + const std::string& wellKnown, + AssociationOwnersType& assocOwners, + AssociationInterfaces& assocInterfaces, + sdbusplus::asio::object_server& server); |