openPMD-api
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
openPMD::AbstractIOHandlerImplCommon< FilePositionType > Class Template Referenceabstract
Inheritance diagram for openPMD::AbstractIOHandlerImplCommon< FilePositionType >:
Inheritance graph
[legend]
Collaboration diagram for openPMD::AbstractIOHandlerImplCommon< FilePositionType >:
Collaboration graph
[legend]

Public Member Functions

 AbstractIOHandlerImplCommon (AbstractIOHandler *handler)
 
- Public Member Functions inherited from openPMD::AbstractIOHandlerImpl
 AbstractIOHandlerImpl (AbstractIOHandler *handler)
 
virtual std::future< void > flush ()
 
virtual void closeFile (Writable *, Parameter< Operation::CLOSE_FILE > const &)=0
 Close the file corresponding with the writable and release file handles. More...
 
virtual void advance (Writable *, Parameter< Operation::ADVANCE > &)
 Advance the file/stream that this writable belongs to. More...
 
virtual void closePath (Writable *, Parameter< Operation::CLOSE_PATH > const &)
 Close an openPMD group. More...
 
virtual void availableChunks (Writable *, Parameter< Operation::AVAILABLE_CHUNKS > &)=0
 Report chunks that are available for loading from the dataset represented by this writable. More...
 
virtual void createFile (Writable *, Parameter< Operation::CREATE_FILE > const &)=0
 Create a new file in physical storage, possibly overriding an existing file. More...
 
virtual void createPath (Writable *, Parameter< Operation::CREATE_PATH > const &)=0
 Create all necessary groups for a path, possibly recursively. More...
 
virtual void createDataset (Writable *, Parameter< Operation::CREATE_DATASET > const &)=0
 Create a new dataset of given type, extent and storage properties. More...
 
virtual void extendDataset (Writable *, Parameter< Operation::EXTEND_DATASET > const &)=0
 Increase the extent of an existing dataset. More...
 
virtual void openFile (Writable *, Parameter< Operation::OPEN_FILE > const &)=0
 Open an existing file assuming it conforms to openPMD. More...
 
virtual void openPath (Writable *, Parameter< Operation::OPEN_PATH > const &)=0
 Open all contained groups in a path, possibly recursively. More...
 
virtual void openDataset (Writable *, Parameter< Operation::OPEN_DATASET > &)=0
 Open an existing dataset and determine its datatype and extent. More...
 
virtual void deleteFile (Writable *, Parameter< Operation::DELETE_FILE > const &)=0
 Delete an existing file from physical storage. More...
 
virtual void deletePath (Writable *, Parameter< Operation::DELETE_PATH > const &)=0
 Delete all objects within an existing path. More...
 
virtual void deleteDataset (Writable *, Parameter< Operation::DELETE_DATASET > const &)=0
 Delete an existing dataset. More...
 
virtual void deleteAttribute (Writable *, Parameter< Operation::DELETE_ATT > const &)=0
 Delete an existing attribute. More...
 
virtual void writeDataset (Writable *, Parameter< Operation::WRITE_DATASET > const &)=0
 Write a chunk of data into an existing dataset. More...
 
virtual void writeAttribute (Writable *, Parameter< Operation::WRITE_ATT > const &)=0
 Create a single attribute and fill the value, possibly overwriting an existing attribute. More...
 
virtual void readDataset (Writable *, Parameter< Operation::READ_DATASET > &)=0
 Read a chunk of data from an existing dataset. More...
 
virtual void readAttribute (Writable *, Parameter< Operation::READ_ATT > &)=0
 Read the value of an existing attribute. More...
 
virtual void listPaths (Writable *, Parameter< Operation::LIST_PATHS > &)=0
 List all paths/sub-groups inside a group, non-recursively. More...
 
virtual void listDatasets (Writable *, Parameter< Operation::LIST_DATASETS > &)=0
 List all datasets inside a group, non-recursively. More...
 
virtual void listAttributes (Writable *, Parameter< Operation::LIST_ATTS > &)=0
 List all attributes associated with an object. More...
 

Protected Types

enum  PossiblyExisting { PE_InvalidatableFile = 0, PE_Iterator, PE_NewlyCreated }
 

Protected Member Functions

std::tuple< InvalidatableFile, std::unordered_map< Writable *, InvalidatableFile >::iterator, bool > getPossiblyExisting (std::string file)
 
void associateWithFile (Writable *writable, InvalidatableFile file)
 
std::string fullPath (InvalidatableFile)
 
std::string fullPath (std::string)
 
InvalidatableFile refreshFileFromParent (Writable *writable)
 Get the writable's containing file. More...
 
std::shared_ptr< FilePositionType > setAndGetFilePosition (Writable *writable, bool write=true)
 Figure out the file position of the writable. More...
 
virtual std::shared_ptr< FilePositionType > setAndGetFilePosition (Writable *writable, std::string extend)
 Figure out the file position of the writable and extend it. More...
 
virtual std::string filePositionToString (std::shared_ptr< FilePositionType >)=0
 
virtual std::shared_ptr< FilePositionType > extendFilePosition (std::shared_ptr< FilePositionType > const &, std::string)=0
 

Protected Attributes

std::unordered_map< Writable *, InvalidatableFilem_files
 map each Writable to its associated file contains only the filename, without the OS path
 
std::unordered_set< InvalidatableFilem_dirty
 

Additional Inherited Members

- Public Attributes inherited from openPMD::AbstractIOHandlerImpl
AbstractIOHandlerm_handler
 

Member Function Documentation

◆ extendFilePosition()

template<typename FilePositionType = AbstractFilePosition>
virtual std::shared_ptr< FilePositionType > openPMD::AbstractIOHandlerImplCommon< FilePositionType >::extendFilePosition ( std::shared_ptr< FilePositionType > const &  ,
std::string   
)
protectedpure virtual
Returns
A new file position that is extended with the given string.

◆ filePositionToString()

template<typename FilePositionType = AbstractFilePosition>
virtual std::string openPMD::AbstractIOHandlerImplCommon< FilePositionType >::filePositionToString ( std::shared_ptr< FilePositionType >  )
protectedpure virtual
Returns
A string representation of the file position.

◆ fullPath()

template<typename FilePositionType >
std::string openPMD::AbstractIOHandlerImplCommon< FilePositionType >::fullPath ( InvalidatableFile  fileName)
protected
Returns
Full OS path of the file.

◆ refreshFileFromParent()

template<typename FilePositionType >
InvalidatableFile openPMD::AbstractIOHandlerImplCommon< FilePositionType >::refreshFileFromParent ( Writable writable)
protected

Get the writable's containing file.

Parameters
writableThe writable whose containing file to figure out.
Returns
The containing file of the writable. If its parent is associated with another file, update the writable to match its parent and return the refreshed file.

◆ setAndGetFilePosition() [1/2]

template<typename FilePositionType >
std::shared_ptr< FilePositionType > openPMD::AbstractIOHandlerImplCommon< FilePositionType >::setAndGetFilePosition ( Writable writable,
bool  write = true 
)
protected

Figure out the file position of the writable.

Only modify the writable's fileposition when specified.

Parameters
writableThe writable.
writeWhether to refresh the writable's file position.
Returns
The current file position.

◆ setAndGetFilePosition() [2/2]

template<typename FilePositionType >
std::shared_ptr< FilePositionType > openPMD::AbstractIOHandlerImplCommon< FilePositionType >::setAndGetFilePosition ( Writable writable,
std::string  extend 
)
protectedvirtual

Figure out the file position of the writable and extend it.

Parameters
writableThe writable.
extendThe extension string.
Returns
The current file position.

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