ug4
|
#include <parallel_archive.h>
Classes | |
struct | Buffer_stringstream |
struct | BufferBinaryBuffer |
struct | BufferBinaryStream |
struct | BufferInterface |
internal virtual buffer interface to support different buffers More... | |
struct | ConstCharBuffer |
Public Member Functions | |
void | add_raw (FileBufferDescriptor f) |
ug::BinaryBuffer & | create_BinaryBuffer_file (std::string name) |
ug::BinaryStream & | create_BinaryStream_file (std::string name) |
void | create_new_archive (std::string filename) |
std::stringstream & | create_stringstream_file (std::string name) |
ParallelArchive (std::string filename, pcl::ProcessCommunicator pc=pcl::ProcessCommunicator(pcl::PCD_WORLD)) | |
void | write () |
~ParallelArchive () | |
Private Types | |
typedef std::map< std::string, SmartPtr< BufferInterface > >::iterator | map_iterator |
Private Attributes | |
std::map< std::string, SmartPtr< BufferInterface > > | files |
bool | m_bUnsafe |
bool | m_bWritten |
std::string | m_filename |
pcl::ProcessCommunicator | m_pc |
This class creates one .a archive out of several parallel file writes This has two advantages
For extracting the archive use ar x thefile.a
Example usage:
|
private |
|
inline |
Create a parallel archive. Note that the file is written on descruction or when you call write() explicitely
filename | the name of the archive. add .a for clearness |
pc | the process communicator used for MPI purposes. default WORLD |
References m_bUnsafe, and m_bWritten.
|
inline |
if the file(s) were not written already, this will write the file NOTE: Don't do this when using add_raw (unsafe!) NOTE: Communication happens here.
References m_bUnsafe, m_bWritten, UG_LOGN, and write().
|
inline |
add raw buffer descriptors (see FileBufferDescriptor) NOTE: be sure all data/pointers are valid until write is called NOTE: You HAVE to use ParallelArchive::write explicitely using deconstructors is UNSAFE since data can be deconstructed before ParallelArchive.
f |
References pcl::FileBufferDescriptor::buf, files, m_bUnsafe, make_sp(), pcl::FileBufferDescriptor::name, and pcl::FileBufferDescriptor::size.
|
inline |
|
inline |
|
inline |
References m_bWritten, m_filename, and write().
|
inline |
create a file inside the archive.
name | the filename inside the archive. can be a path, but only filename is taken |
References files, name, and p.
Referenced by ug::ConnectionViewer::WriteMatrixPar().
|
inline |
explicitely writes the data NOTE: Communication happens here.
References ug::FilenameWithoutPath(), files, m_bWritten, m_filename, m_pc, and pcl::WriteParallelArchive().
Referenced by create_new_archive(), and ~ParallelArchive().
|
private |
Referenced by add_raw(), create_BinaryBuffer_file(), create_BinaryStream_file(), create_stringstream_file(), and write().
|
private |
Referenced by add_raw(), ParallelArchive(), and ~ParallelArchive().
|
private |
Referenced by create_new_archive(), ParallelArchive(), write(), and ~ParallelArchive().
|
private |
Referenced by create_new_archive(), and write().
|
private |
Referenced by write().