Loading...
Searching...
No Matches
Public Member Functions | List of all members
bitpit::IBinaryArchive Class Reference

Input binary archive. More...

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

Public Member Functions

 IBinaryArchive (const std::string &name, const std::string &extension, int block=-1)
 
 IBinaryArchive (const std::string &name, int block=-1)
 
bool checkVersion (int version)
 
std::istream & getStream ()
 
void open (const std::string &name, const std::string &extension, int block=-1)
 
void open (const std::string &name, int block=-1)
 
- Public Member Functions inherited from bitpit::BinaryArchive
 BinaryArchive ()
 
 ~BinaryArchive ()
 
std::string getHeader () const
 
std::string getPath () const
 
int getVersion () const
 

Additional Inherited Members

- Static Public Member Functions inherited from bitpit::BinaryArchive
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 inherited from bitpit::BinaryArchive
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 inherited from bitpit::BinaryArchive
void open (const std::string &name, const std::string &extension, ios_base::openmode mode, int block=-1)
 
- Protected Attributes inherited from bitpit::BinaryArchive
std::string m_header
 
std::string m_path
 
int m_version
 

Detailed Description

Input binary archive.

The IBinaryArchive class can read a binary archive, the binary archive has a fixed ASCII header.

Examples
POD_example_00002.cpp.

Definition at line 67 of file binary_archive.hpp.

Constructor & Destructor Documentation

◆ IBinaryArchive() [1/2]

bitpit::IBinaryArchive::IBinaryArchive ( const std::string & name,
int block = -1 )

Creates a new input archive.

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

Definition at line 162 of file binary_archive.cpp.

◆ IBinaryArchive() [2/2]

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

Creates a new input archive.

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

Definition at line 175 of file binary_archive.cpp.

Member Function Documentation

◆ checkVersion()

bool bitpit::IBinaryArchive::checkVersion ( int version)

Checks if the version of the archive matches the specified version.

Parameters
versionis the requested version
Returns
Retuns true if the version of the archive matches the specified version, otherwise it returns false.

Definition at line 236 of file binary_archive.cpp.

◆ getStream()

std::istream & bitpit::IBinaryArchive::getStream ( )

Get a reference to the input stream associated to the archive.

Returns
A reference to the input stream associated to the archive.
Examples
POD_example_00002.cpp.

Definition at line 224 of file binary_archive.cpp.

◆ open() [1/2]

void bitpit::IBinaryArchive::open ( const std::string & name,
const std::string & extension,
int block = -1 )

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
blockis the parallel block thefile belongs to, a negative value mean that the file is serial

Definition at line 202 of file binary_archive.cpp.

◆ open() [2/2]

void bitpit::IBinaryArchive::open ( const std::string & name,
int block = -1 )

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
blockis the parallel block thefile belongs to, a negative value mean that the file is serial

Definition at line 188 of file binary_archive.cpp.


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