summaryrefslogtreecommitdiffstats
path: root/types.hpp
blob: 1526ce96df873fa77d768438268c51b4befd495f (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
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once

#include <cstdint>
#include <functional>
#include <map>
#include <sdbusplus/message/types.hpp>
#include <string>

namespace sdbusplus
{
namespace message
{
class message;
}
namespace bus
{
class bus;
}
} // namespace sdbusplus

namespace phosphor
{
namespace inventory
{
namespace manager
{

class Manager;

/** @brief Inventory manager supported property types. */
using InterfaceVariantType =
    sdbusplus::message::variant_ns::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&)>;
template <typename T>
using GetProperty = std::function<T(Manager&)>;
} // namespace manager
} // namespace inventory
} // namespace phosphor

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