MADNESS  0.10.1
Public Member Functions | Private Attributes | List of all members
madness::archive::VectorOutputArchive Class Reference

Wraps an archive around an STL vector for output. More...

#include <vector_archive.h>

Inheritance diagram for madness::archive::VectorOutputArchive:
Inheritance graph
[legend]
Collaboration diagram for madness::archive::VectorOutputArchive:
Collaboration graph
[legend]

Public Member Functions

 VectorOutputArchive (std::vector< unsigned char > &v, std::size_t hint=262144)
 Create a buffer to wrap the specified vector. More...
 
void close ()
 Close the archive. More...
 
void flush ()
 Flush the archive. More...
 
void open (std::size_t hint=262144)
 Clear any data in the vector and ensure its capacity is at least hint. More...
 
template<class T >
std::enable_if< madness::is_trivially_serializable< T >::value, void >::type store (const T *t, long n) const
 Appends data to the end of the vector. More...
 
- Public Member Functions inherited from madness::archive::BaseArchive
 BaseArchive ()
 

Private Attributes

std::vector< unsigned char > * v
 The STL vector being wrapped. More...
 

Additional Inherited Members

- Public Types inherited from madness::archive::BaseOutputArchive
using is_saving = std::true_type
 Type used by Boost.Serialization to determine if this object is an output archive. More...
 
- Public Types inherited from madness::archive::BaseArchive
using is_loading = std::false_type
 Type used by Boost.Serialization to determine if this object is an input archive. More...
 
using is_saving = std::false_type
 Type used by Boost.Serialization to determine if this object is an output archive. More...
 
- Static Public Attributes inherited from madness::archive::BaseOutputArchive
static constexpr bool is_output_archive = true
 Flag to determine if this object is an output archive. More...
 
- Static Public Attributes inherited from madness::archive::BaseArchive
static constexpr bool is_archive = true
 Flag to determine if this object is an archive. More...
 
static constexpr bool is_input_archive = false
 Flag to determine if this object is an input archive. More...
 
static constexpr bool is_output_archive = false
 Flag to determine if this object is an output archive. More...
 
static constexpr bool is_parallel_archive = false
 Flag to determine if this object is a parallel archive. More...
 

Detailed Description

Wraps an archive around an STL vector for output.

Constructor & Destructor Documentation

◆ VectorOutputArchive()

madness::archive::VectorOutputArchive::VectorOutputArchive ( std::vector< unsigned char > &  v,
std::size_t  hint = 262144 
)
inline

Create a buffer to wrap the specified vector.

Parameters
[in]vThe vector.
[in]hintThe minimum capacity of the vector.

References open().

Member Function Documentation

◆ close()

void madness::archive::VectorOutputArchive::close ( )
inline

Close the archive.

Referenced by main().

◆ flush()

void madness::archive::VectorOutputArchive::flush ( )
inline

Flush the archive.

◆ open()

void madness::archive::VectorOutputArchive::open ( std::size_t  hint = 262144)
inline

Clear any data in the vector and ensure its capacity is at least hint.

Parameters
[in]hintThe minimum capacity for the vector.

References v.

Referenced by VectorOutputArchive().

◆ store()

template<class T >
std::enable_if< madness::is_trivially_serializable<T>::value, void >::type madness::archive::VectorOutputArchive::store ( const T t,
long  n 
) const
inline

Appends data to the end of the vector.

Todo:
Verify/complete the documentation.
Template Parameters
TThe type of data to be appended.
Parameters
[in]tPointer to the data to be appended.
[in]nThe number of data items to be appended.
Returns
Description needed.

References T(), and v.

Referenced by madness::archive::MPIOutputArchive::store(), and madness::archive::ContainerRecordOutputArchive::store().

Member Data Documentation

◆ v

std::vector<unsigned char>* madness::archive::VectorOutputArchive::v
mutableprivate

The STL vector being wrapped.

Referenced by open(), and store().


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