IOLink  IOL_v1.2.0_release
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< StreamAccessopenStreamAccess (const std::string &resourceId, AccessCapabilities capabilities)=0
 Open a stream-like accessor to a given resource. More...
 
virtual std::shared_ptr< RandomAccessopenRandomAccess (const std::string &resourceId, AccessCapabilities capabilities)=0
 Open an array-like accessor to a given resource. More...
 
virtual const std::string & source () const =0
 Return a string that describe the storage's source of data. More...
 

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
resourceIdThe resource name
capabilitiesThe capabilities you want the accessor to support
Returns
The opened random-access accessor.
Exceptions
Errorif the storage can not access to the resource.
Errorif 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
resourceIdThe resource name
capabilitiesThe capabilities you want the accessor to support
Returns
The opened stream accessor.
Exceptions
Errorif the storage can not access to the resource.
Errorif 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: