summaryrefslogtreecommitdiffstats
path: root/types.hpp
blob: 52a00eeea26ee66ba312c773c5f90bdf21e1ac7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once

#include <map>
#include <string>
#include <sdbusplus/message.hpp>
#include <experimental/any>
#include <functional>

namespace phosphor
{
namespace inventory
{
namespace manager
{

class Manager;
namespace any_ns = std::experimental;

/** @brief Inventory manager supported property types. */
using InterfaceVariantType =
    sdbusplus::message::variant<bool, int64_t, std::string>;

template <typename T>
using InterfaceType = std::map<std::string, T>;

template <typename T>
using ObjectType = std::map<std::string, InterfaceType<T>>;

using Interface = InterfaceType<InterfaceVariantType>;
using Object = ObjectType<InterfaceVariantType>;

using Action = std::function<void (sdbusplus::bus::bus&, Manager&)>;
using Filter = std::function <
               bool (sdbusplus::bus::bus&, sdbusplus::message::message&, Manager&) >;
using PathCondition = std::function <
                      bool (const std::string&, sdbusplus::bus::bus&, Manager&) >;
} // namespace manager
} // namespace inventory
} // namespace phosphor

// vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
OpenPOWER on IntegriCloud