| IOLink 1.11.0

Loading...
Searching...
No Matches
Public Member Functions | List of all members
iolink::DataStorage Class Referenceabstract

Describes a data source, that manages and opens DataAccess instances. More...

`#include <iolink/storage/DataStorage.h>`

## Public Member Functions
virtual std::shared_ptr< StreamAccess > | openStreamAccess (const std::string &resourceId, AccessCapabilities capabilities)=0
| Open a stream-like accessor to a given resource.
virtual std::shared_ptr< RandomAccess > | openRandomAccess (const std::string &resourceId, AccessCapabilities capabilities)=0
| Open an array-like accessor to a given resource.
virtual const std::string & | source () const =0
| Return a string that describe the storage's source of data.

## Detailed Description

Describes a data source, that manages and opens DataAccess instances.

## Member Function Documentation

## ◆ openRandomAccess()

virtual std::shared_ptr< RandomAccess > iolink::DataStorage::openRandomAccess | ( | const std::string & | resourceId,
|  | AccessCapabilities | capabilities
| ) |  |
| pure virtual

Open an array-like accessor to a given resource.

Parameters

  resourceId | The resource name
  capabilities | The capabilities you want the accessor to support

Returns
  The opened random-access accessor.

Exceptions

  Error | if the storage can not access to the resource.
  Error | if the resource does not support the request capabilities.

See also
  DataAccess::resourceId for more info on this identifier.

## ◆ openStreamAccess()

virtual std::shared_ptr< StreamAccess > iolink::DataStorage::openStreamAccess | ( | const std::string & | resourceId,
|  | AccessCapabilities | capabilities
| ) |  |
| pure virtual

Open a stream-like accessor to a given resource.

Parameters

  resourceId | The resource name
  capabilities | The capabilities you want the accessor to support

Returns
  The opened stream accessor.

Exceptions

  Error | if the storage can not access to the resource.
  Error | if the resource does not support the requested capabilities.

See also
  DataAccess::resourceId for more info on this identifier.

## ◆ source()

virtual const std::string & iolink::DataStorage::source | ( |  | ) | const
| pure virtual

Return a string that describe the storage's source of data.

Usually has the form of an URI, for example:

- "file:/home/user/folder" for a filesystem storage
- "http://amazing.website.net" for an HTTP storage

The documentation for this class was generated from the following file:

- iolink/public/include/iolink/storage/DataStorage.h