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

Public Member Functions

 AbstractIOHandlerImplCommon (AbstractIOHandler *handler)
 

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, bool preferParentFile)
 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
 

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,
bool  preferParentFile 
)
protected

Get the writable's containing file.

Parameters
writableThe writable whose containing file to figure out.
preferParentFileIf true, the file is set to the parent's file if present. Otherwise, the parent file is only considered if no own file is defined. This is usually needed when switching between iterations when opening paths.
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: