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

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

#include <vector_archive.h>

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

Public Member Functions

 VectorInputArchive (std::vector< unsigned char > &v)
 Create a buffer to wrap the specified vector. More...
 
void close ()
 Close the archive. More...
 
template<class T >
std::enable_if< madness::is_trivially_serializable< T >::value, void >::type load (T *t, long n) const
 Load data from the vector. More...
 
std::size_t nbyte_avail () const
 Get the amount of space left to be read from the vector. More...
 
void open ()
 Open the archive. More...
 
void rewind () const
 Reset the read location to the beginning of the vector. More...
 
- Public Member Functions inherited from madness::archive::BaseArchive
 BaseArchive ()
 

Private Attributes

std::size_t i
 Current input location. More...
 
std::vector< unsigned char > * v
 The STL vector being wrapped. More...
 

Additional Inherited Members

- Public Types inherited from madness::archive::BaseInputArchive
using is_loading = std::true_type
 Type used by Boost.Serialization to determine if this object is an input 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::BaseInputArchive
static constexpr bool is_input_archive = true
 Flag to determine if this object is an input 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 input.

Constructor & Destructor Documentation

◆ VectorInputArchive()

madness::archive::VectorInputArchive::VectorInputArchive ( std::vector< unsigned char > &  v)
inline

Create a buffer to wrap the specified vector.

Parameters
[in]vThe vector.

Member Function Documentation

◆ close()

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

Close the archive.

Referenced by main().

◆ load()

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

Load data from the vector.

The function only appears (due to enable_if) if T is serializable.

Template Parameters
TThe type of data to be loaded.
Parameters
[out]tWhere to store the loaded data.
[in]nThe number of data items to be loaded.

References i, m, MADNESS_EXCEPTION, T(), and v.

Referenced by madness::archive::MPIInputArchive::load(), and madness::archive::ContainerRecordInputArchive::load().

◆ nbyte_avail()

std::size_t madness::archive::VectorInputArchive::nbyte_avail ( ) const
inline

Get the amount of space left to be read from the vector.

Returns
The amount of space left to be read from the vector.

References i, and v.

Referenced by madness::archive::MPIInputArchive::load().

◆ open()

void madness::archive::VectorInputArchive::open ( )
inline

Open the archive.

◆ rewind()

void madness::archive::VectorInputArchive::rewind ( ) const
inline

Reset the read location to the beginning of the vector.

References i.

Referenced by madness::archive::MPIInputArchive::load().

Member Data Documentation

◆ i

std::size_t madness::archive::VectorInputArchive::i
mutableprivate

Current input location.

Referenced by load(), nbyte_avail(), and rewind().

◆ v

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

The STL vector being wrapped.

Referenced by load(), and nbyte_avail().


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