Zserio C++17 runtime library 1.3.0
Built for Zserio 2.20.0
Loading...
Searching...
No Matches
IIntrospectableView.h
Go to the documentation of this file.
1#ifndef ZSERIO_I_INTROSPECTABLE_VIEW_INC
2#define ZSERIO_I_INTROSPECTABLE_VIEW_INC
3
4#include <memory>
5#include <string_view>
6
7#include "zserio/BitSize.h"
9#include "zserio/View.h"
10
11namespace zserio
12{
13
20template <typename ALLOC = std::allocator<uint8_t>>
21class IBasicIntrospectableView : public IIntrospectableData<IBasicIntrospectableView<ALLOC>, ALLOC>
22{
23public:
26
30 ~IBasicIntrospectableView() override = default;
31
44 virtual ConstPtr getParameter(std::string_view name) const = 0;
45
58 virtual ConstPtr callFunction(std::string_view name) const = 0;
59
71 virtual BasicBitBuffer<ALLOC> serialize() const = 0;
73};
74
76template <typename ALLOC = std::allocator<uint8_t>>
78
85namespace detail
86{
87
88template <typename T, typename ALLOC>
89struct Introspectable;
90
91} // namespace detail
92
102template <typename T, typename ALLOC = typename T::allocator_type>
104{
105 return detail::Introspectable<T, ALLOC>::create(view, allocator);
106}
107
108template <typename T, typename ALLOC = std::allocator<uint8_t>,
109 std::enable_if_t<std::is_enum_v<T> || is_bitmask_v<T>, int> = 0>
111{
112 return detail::Introspectable<T, ALLOC>::create(value, allocator);
113}
116} // namespace zserio
117
118#endif // ZSERIO_I_INTROSPECTABLE_VIEW_INC
virtual BasicBitBuffer< ALLOC > serialize() const =0
~IBasicIntrospectableView() override=default
virtual ConstPtr getParameter(std::string_view name) const =0
virtual BasicBitBuffer< ALLOC > serialize(const ALLOC &allocator) const =0
virtual ConstPtr callFunction(std::string_view name) const =0
typename IIntrospectableData< IBasicIntrospectableView< ALLOC >, ALLOC >::ConstPtr ConstPtr
typename IBasicIntrospectableView< ALLOC >::ConstPtr IBasicIntrospectableViewConstPtr
IBasicIntrospectableViewConstPtr< ALLOC > introspectable(const View< T > &view, const ALLOC &allocator=ALLOC())