cpp-common/bt2c/fmt.hpp: use `wise_enum::string_type` in `EnableIfIsWiseEnum` definition
[babeltrace.git] / src / cpp-common / bt2 / raw-value-proxy.hpp
1 /*
2 * Copyright (c) 2023 Philippe Proulx <pproulx@efficios.com>
3 *
4 * SPDX-License-Identifier: MIT
5 */
6
7 #ifndef BABELTRACE_CPP_COMMON_BT2_RAW_VALUE_PROXY_HPP
8 #define BABELTRACE_CPP_COMMON_BT2_RAW_VALUE_PROXY_HPP
9
10 namespace bt2 {
11
12 template <typename ObjT>
13 class RawValueProxy
14 {
15 private:
16 using _RawVal = typename ObjT::Value;
17
18 public:
19 explicit RawValueProxy(const ObjT obj) : _mObj {obj}
20 {
21 }
22
23 RawValueProxy& operator=(const _RawVal& rawVal)
24 {
25 _mObj.value(rawVal);
26 return *this;
27 }
28
29 operator _RawVal() const noexcept
30 {
31 return _mObj.value();
32 }
33
34 private:
35 ObjT _mObj;
36 };
37
38 } /* namespace bt2 */
39
40 #endif /* BABELTRACE_CPP_COMMON_BT2_RAW_VALUE_PROXY_HPP */
This page took 0.030204 seconds and 4 git commands to generate.