Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
bitpit::BinaryArchive Class Reference

Base class for binary archives. More...

Inheritance diagram for bitpit::BinaryArchive:
Inheritance graph
[legend]
Collaboration diagram for bitpit::BinaryArchive:
Collaboration graph
[legend]

Public Member Functions

 BinaryArchive ()
 
 ~BinaryArchive ()
 
std::string getHeader () const
 
std::string getPath () const
 
int getVersion () const
 

Static Public Member Functions

static std::string generatePath (const std::string &name, const std::string &extension, int block=-1)
 
static std::string generatePath (const std::string &name, int block=-1)
 

Static Public Attributes

static BITPIT_PUBLIC_API const std::string EXTENSION_DEFAULT = "dat"
 
static BITPIT_PUBLIC_API const int HEADER_SIZE = 1024
 
static BITPIT_PUBLIC_API const int VERSION_UNDEFINED = - std::numeric_limits<int>::max()
 

Protected Member Functions

void open (const std::string &name, const std::string &extension, ios_base::openmode mode, int block=-1)
 

Protected Attributes

std::string m_header
 
std::string m_path
 
int m_version
 

Detailed Description

Base class for binary archives.

The BinaryArchive is the blas class from which input and output binary archives are derived from.

Definition at line 36 of file binary_archive.hpp.

Constructor & Destructor Documentation

◆ BinaryArchive()

bitpit::BinaryArchive::BinaryArchive ( )

Default constructor

Definition at line 79 of file binary_archive.cpp.

◆ ~BinaryArchive()

bitpit::BinaryArchive::~BinaryArchive ( )

Destructor

Definition at line 87 of file binary_archive.cpp.

Member Function Documentation

◆ generatePath() [1/2]

std::string bitpit::BinaryArchive::generatePath ( const std::string & name,
const std::string & extension,
int block = -1 )
static

Generates the path of the archive with the specified properties.

Parameters
nameis the name of the file
extensionis the extension of the file
blockis the parallel block thefile belongs to, a negative value mean that the file is serial
Returns
The path of the archive with the specified properties.

Definition at line 65 of file binary_archive.cpp.

◆ generatePath() [2/2]

std::string bitpit::BinaryArchive::generatePath ( const std::string & name,
int block = -1 )
static

Generates the path of the archive with the specified properties.

Parameters
nameis the name of the file
blockis the parallel block thefile belongs to, a negative value mean that the file is serial
Returns
The path of the archive with the specified properties.

Definition at line 51 of file binary_archive.cpp.

◆ getHeader()

std::string bitpit::BinaryArchive::getHeader ( ) const

Gets the header associated to the archive.

Returns
The header associated to the archive.

Definition at line 131 of file binary_archive.cpp.

◆ getPath()

std::string bitpit::BinaryArchive::getPath ( ) const

Gets the path of the archive.

Returns
The path of the archive.

Definition at line 141 of file binary_archive.cpp.

◆ getVersion()

int bitpit::BinaryArchive::getVersion ( ) const

Gets the version associated to the archive.

Returns
The version associated to the archive.

Definition at line 121 of file binary_archive.cpp.

◆ open()

void bitpit::BinaryArchive::open ( const std::string & name,
const std::string & extension,
ios_base::openmode mode,
int block = -1 )
protected

Opens the specified file, associating it with the stream object, so that input/output operations are performed on its content.

Parameters
nameis the name of the file
extensionis the extension of the file
modespecifies the opening mode
blockis the parallel block thefile belongs to, a negative value mean that the file is serial

Definition at line 102 of file binary_archive.cpp.

Member Data Documentation

◆ EXTENSION_DEFAULT

const std::string bitpit::BinaryArchive::EXTENSION_DEFAULT = "dat"
static

Definition at line 43 of file binary_archive.hpp.

◆ HEADER_SIZE

BITPIT_PUBLIC_API const int bitpit::BinaryArchive::HEADER_SIZE = 1024
static

Definition at line 40 of file binary_archive.hpp.

◆ m_header

std::string bitpit::BinaryArchive::m_header
protected

Definition at line 59 of file binary_archive.hpp.

◆ m_path

std::string bitpit::BinaryArchive::m_path
protected

Definition at line 60 of file binary_archive.hpp.

◆ m_version

int bitpit::BinaryArchive::m_version
protected

Definition at line 58 of file binary_archive.hpp.

◆ VERSION_UNDEFINED

BITPIT_PUBLIC_API const int bitpit::BinaryArchive::VERSION_UNDEFINED = - std::numeric_limits<int>::max()
static

Definition at line 41 of file binary_archive.hpp.


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