IOLink IOL_v1.8.0_release
Loading...
Searching...
No Matches
StreamAccessProvider.h
1#pragma once
2
3#include <iolink/IOLinkAPI.h>
4#include <iolink/storage/StreamAccess.h>
5
6#include <memory>
7
8namespace iolink
9{
10
14class IOLINK_INTERFACE_API StreamAccessProvider
15{
16public:
20 inline static bool isStreamAccess(std::shared_ptr<DataAccess> accessor) noexcept
21 {
22 return (dynamic_cast<const StreamAccess*>(accessor.get()) != nullptr);
23 }
24
30 inline static std::shared_ptr<StreamAccess> toStream(std::shared_ptr<DataAccess> storage) noexcept
31 {
32 return std::dynamic_pointer_cast<StreamAccess>(storage);
33 }
34};
35
36} // end namespace iolink