Seismic Drive Client API
Public Member Functions | Friends | List of all members
seismicdrive::SDReadOnlyGenericDatasetAccessor Class Reference

This class represents a generic cloud storage dataset in read only mode. More...

#include <SDReadOnlyGenericDatasetAccessor.h>

Public Member Functions

 SDReadOnlyGenericDatasetAccessor (const std::string &ss)
 Constructor. More...
 
 SDReadOnlyGenericDatasetAccessor (const std::string &ss, SDManager *sdManager)
 Constructor. More...
 
 ~SDReadOnlyGenericDatasetAccessor ()
 
 SDReadOnlyGenericDatasetAccessor (SDReadOnlyGenericDatasetAccessor &&rhs) noexcept
 Move Constructor. More...
 
SDReadOnlyGenericDatasetAccessoroperator= (SDReadOnlyGenericDatasetAccessor &&rhs) noexcept
 Move Assignment Operator. More...
 
 SDReadOnlyGenericDatasetAccessor (const SDReadOnlyGenericDatasetAccessor &rhs)=delete
 Copy Constructor. More...
 
SDReadOnlyGenericDatasetAccessoroperator= (const SDReadOnlyGenericDatasetAccessor &rhs)=delete
 Copy Assignment Operator. More...
 
void readBlock (int blocknum, char *data, size_t offset, size_t numBytes)
 Read a block of data from cloud storage. More...
 
void readBlock (int blocknum, char *data, size_t len)
 Read a block of data from cloud storage. More...
 
void readBlock (const std::string &blockName, char *data, size_t offset, size_t numBytes)
 Read a block of data from cloud storage. More...
 
void readBlock (const std::string &blockName, char *data, size_t len)
 Read a block of data from cloud storage. More...
 
long long getBlockSize (int blocknum)
 Gets the size of a block. More...
 
long long getBlockSize (const std::string &blockName)
 Gets the size of a block. More...
 

Friends

class SDReadOnlyGenericDatasetTest
 

Detailed Description

This class represents a generic cloud storage dataset in read only mode.

This class is a Generic ReadOnly Dataset class to read cloud storage objects as sequential(0...n-1) file blocks.

Constructor & Destructor Documentation

◆ SDReadOnlyGenericDatasetAccessor() [1/4]

seismicdrive::SDReadOnlyGenericDatasetAccessor::SDReadOnlyGenericDatasetAccessor ( const std::string &  ss)

Constructor.

Parameters
ssis the serialized SDReadOnlyGenericDataset object. The serialized object can be generated through the SDGeneriDataset class

◆ SDReadOnlyGenericDatasetAccessor() [2/4]

seismicdrive::SDReadOnlyGenericDatasetAccessor::SDReadOnlyGenericDatasetAccessor ( const std::string &  ss,
SDManager sdManager 
)

Constructor.

Parameters
ssis the serialized SDReadOnlyGenericDataset object. The serialized object can be generated through the SDGeneriDataset class
sdManageris the sdManager to use through the lifetime of this accessor

◆ ~SDReadOnlyGenericDatasetAccessor()

seismicdrive::SDReadOnlyGenericDatasetAccessor::~SDReadOnlyGenericDatasetAccessor ( )

Destructor.

If the file is opened for writing (not READ_ONLY), it will be closed.

◆ SDReadOnlyGenericDatasetAccessor() [3/4]

seismicdrive::SDReadOnlyGenericDatasetAccessor::SDReadOnlyGenericDatasetAccessor ( SDReadOnlyGenericDatasetAccessor &&  rhs)
noexcept

Move Constructor.

This contructor moves the SDReadOnlyGenericDatasetAccessor object from the source to the new object and destroy the source object.

◆ SDReadOnlyGenericDatasetAccessor() [4/4]

seismicdrive::SDReadOnlyGenericDatasetAccessor::SDReadOnlyGenericDatasetAccessor ( const SDReadOnlyGenericDatasetAccessor rhs)
delete

Copy Constructor.

This contructor makes a copy of the SDReadOnlyGenericDatasetAccessor object from the source to the new object without modifying the source object.

Member Function Documentation

◆ getBlockSize() [1/2]

long long seismicdrive::SDReadOnlyGenericDatasetAccessor::getBlockSize ( int  blocknum)

Gets the size of a block.

This method is an accessor used to get the size of a block in bytes given the block number.

Parameters
blocknumshould be in the range 0..getBlockNum()-1
Returns
the size of the block number blocknum -1 if the block doesn't exist

◆ getBlockSize() [2/2]

long long seismicdrive::SDReadOnlyGenericDatasetAccessor::getBlockSize ( const std::string &  blockName)

Gets the size of a block.

This method is an accessor used to get the size of a block in bytes given the block name.

Parameters
blockNameis the name of the block
Returns
the size of the block named blockName -1 if the block doesn't exist

◆ operator=() [1/2]

SDReadOnlyGenericDatasetAccessor& seismicdrive::SDReadOnlyGenericDatasetAccessor::operator= ( SDReadOnlyGenericDatasetAccessor &&  rhs)
noexcept

Move Assignment Operator.

Same functionality as the move constructor.

◆ operator=() [2/2]

SDReadOnlyGenericDatasetAccessor& seismicdrive::SDReadOnlyGenericDatasetAccessor::operator= ( const SDReadOnlyGenericDatasetAccessor rhs)
delete

Copy Assignment Operator.

Same functionality as the copy constructor.

◆ readBlock() [1/4]

void seismicdrive::SDReadOnlyGenericDatasetAccessor::readBlock ( int  blocknum,
char *  data,
size_t  offset,
size_t  numBytes 
)

Read a block of data from cloud storage.

This method reads a block of data specified by the block number. It expects the size of the data to read in bytes.

Parameters
blocknumshould be in the range 0..getBlockNum()-1
datais a buffer where read data will be saved (pre-allocated)
offsetis the starting reading offset
numBytesis the size in byte of the data to read

◆ readBlock() [2/4]

void seismicdrive::SDReadOnlyGenericDatasetAccessor::readBlock ( int  blocknum,
char *  data,
size_t  len 
)

Read a block of data from cloud storage.

This method reads a block of data specified by the block number.

Parameters
blocknumshould be in the range 0..getBlockNum()-1
datais a buffer where read data will be saved (pre-allocated)
lenis the param where the reading len will be stored

◆ readBlock() [3/4]

void seismicdrive::SDReadOnlyGenericDatasetAccessor::readBlock ( const std::string &  blockName,
char *  data,
size_t  offset,
size_t  numBytes 
)

Read a block of data from cloud storage.

This method reads a block of data specified by the block name. It expects the size of the data to read in bytes.

Parameters
blockNameis the name of the block to read
datais a buffer where read data will be saved (pre-allocated)
offsetis the starting reading offset
numBytesis the size in byte of the data to read

◆ readBlock() [4/4]

void seismicdrive::SDReadOnlyGenericDatasetAccessor::readBlock ( const std::string &  blockName,
char *  data,
size_t  len 
)

Read a block of data from cloud storage.

This method reads a block of data specified by the block name.

Parameters
blockNameis the name of the block to read
datais a buffer where read data will be saved (pre-allocated)
lenis the param where the reading len will be stored

Friends And Related Function Documentation

◆ SDReadOnlyGenericDatasetTest

friend class SDReadOnlyGenericDatasetTest
friend

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