| IOLink 1.11.0

Loading...
Searching...
No Matches
View.h
1#pragma once
2
3#include <memory>
4
5#include <iolink/IOLinkAPI.h>
6#include <iolink/view/Extension.h>
7#include <iolink/view/ViewOriginExtension.h>
8
9 namespace iolink
10{
11
15 class IOLINK_API View
16{
17 public:
18 virtual ~View() = default;
19
29 virtual std::shared_ptr<Extension> extension(size_t id);
30
36 template <typename T>
37 inline std::shared_ptr<T> extension()
38 {
39 return T::cast(this->extension(T::EXTENSION_ID));
40 }
41
45 std::shared_ptr<ViewOriginExtension> viewOrigin();
46};
47
48} // namespace iolink
iolink::View
Interface representing a generic view on data.
Definition View.h:16
iolink::View::extension
virtual std::shared_ptr< Extension > extension(size_t id)
Get an extension of the view, corresponding to the given identifier.
iolink::View::extension
std::shared_ptr< T > extension()
Get an extension of the view, corresponding to the given type.
Definition View.h:37
iolink::View::viewOrigin
std::shared_ptr< ViewOriginExtension > viewOrigin()
Shortcut to access to ViewOrigin extension.
iolink
All IOLink symbols are enclosed in this namespace.
Definition ArrayX.h:8