36 #ifndef MADNESS_WORLD_VECAR_H__INCLUDED
37 #define MADNESS_WORLD_VECAR_H__INCLUDED
55 mutable std::vector<unsigned char>* v;
65 const unsigned char* ptr = (
unsigned char*) t;
66 v->insert(v->end(),ptr,ptr+n*
sizeof(
T));
69 void open(std::size_t hint=262144) {
82 mutable std::vector<unsigned char>* v;
83 mutable std::size_t i;
91 std::size_t
m = n*
sizeof(
T);
92 if (m+i > v->size())
MADNESS_EXCEPTION(
"VectorInputArchive: reading past end", m+1);
93 memcpy((
unsigned char*) t, &((*v)[i]), m);
111 #endif // MADNESS_WORLD_VECAR_H__INCLUDED
Interface templates for the archives (serialization)
Wraps an archive around an STL vector for output.
Definition: vecar.h:54
void open(std::size_t hint=262144)
Definition: vecar.h:69
madness::enable_if< madness::is_serializable< T >, void >::type store(const T *t, long n) const
Definition: vecar.h:64
const T1 &f1 return GTEST_2_TUPLE_() T(f0, f1)
Base class for output archives classes.
Definition: archive.h:583
void flush()
Definition: vecar.h:76
void close()
Definition: vecar.h:74
const double m
Definition: gfit.cc:199
VectorOutputArchive(std::vector< unsigned char > &v, std::size_t hint=262144)
Definition: vecar.h:57
#define MADNESS_EXCEPTION(msg, value)
Definition: worldexc.h:88
enable_if from Boost for conditionally instantiating templates based on type
Definition: enable_if.h:60
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45