| IOLink 1.11.0

Loading...
Searching...
No Matches
DataStorage.h
1#pragma once
2
3#include <memory>
4#include <string>
5
6#include <iolink/IOLinkAPI.h>
7#include <iolink/storage/RandomAccess.h>
8#include <iolink/storage/StreamAccess.h>
9
10 namespace iolink
11{
12
16 enum class AccessCapabilities
17{
18 READ_ONLY = 0x1, // 0001
19 WRITE_ONLY = 0x2, // 0010
20 READ_WRITE = 0x3, // 0011
21};
22
26 class IOLINK_INTERFACE_API DataStorage
27{
28 public:
42 virtual std::shared_ptr<StreamAccess> openStreamAccess(const std::string& resourceId,
43 AccessCapabilities capabilities) = 0;
44
58 virtual std::shared_ptr<RandomAccess> openRandomAccess(const std::string& resourceId,
59 AccessCapabilities capabilities) = 0;
60
68 virtual const std::string& source() const = 0;
69};
70
71} // namespace iolink
iolink::DataStorage
Describes a data source, that manages and opens DataAccess instances.
Definition DataStorage.h:27
iolink::DataStorage::openStreamAccess
virtual std::shared_ptr< StreamAccess > openStreamAccess(const std::string &resourceId, AccessCapabilities capabilities)=0
Open a stream-like accessor to a given resource.
iolink::DataStorage::openRandomAccess
virtual std::shared_ptr< RandomAccess > openRandomAccess(const std::string &resourceId, AccessCapabilities capabilities)=0
Open an array-like accessor to a given resource.
iolink::DataStorage::source
virtual const std::string & source() const =0
Return a string that describe the storage's source of data.
iolink
All IOLink symbols are enclosed in this namespace.
Definition ArrayX.h:8
iolink::AccessCapabilities
AccessCapabilities
Used to request capabilities for accessors.
Definition DataStorage.h:17