1#ifndef VISTLE_ARCHIVE_SAVER_H
2#define VISTLE_ARCHIVE_SAVER_H
8#include <boost/mpl/for_each.hpp>
20 : m_ok(false), m_name(name), m_type(type), m_ar(ar), m_array(array)
35 std::cerr <<
"ArraySaver: multiple type matches for data array " << m_name << std::endl;
45 std::cerr <<
"ArraySaver: did not find data array " << m_name << std::endl;
55 boost::mpl::for_each<VectorTypes>(boost::reference_wrapper<ArraySaver>(*
this));
57 std::cerr <<
"ArraySaver: failed to save array " << m_name <<
" to archive" << std::endl;
66 const void *m_array =
nullptr;
71 void saveArray(
const std::string &name,
int type,
const void *array)
override;
72 void saveObject(
const std::string &name,
obj_const_ptr obj)
override;
74 void flushDirectory();
76 bool isObjectSaved(
const std::string &name)
const;
77 bool isArraySaved(
const std::string &name)
const;
79 std::set<std::string> savedObjects()
const;
80 std::set<std::string> savedArrays()
const;
81 void setSavedObjects(
const std::set<std::string> &objs);
82 void setSavedArrays(
const std::set<std::string> &arrs);
88 std::map<std::string, buffer> m_objects;
89 std::map<std::string, buffer> m_arrays;
90 std::set<std::string> m_archivedObjects;
91 std::set<std::string> m_archivedArrays;
Definition: archive_saver.h:69
Definition: archives.h:120
static Shm & the()
Definition: shm.cpp:315
const ShmVector< T > getArrayFromName(const std::string &name) const
Definition: shm_impl.h:32
Definition: shm_reference.h:15
Definition: shm_array.h:19
Definition: archives.h:197
#define V_COREEXPORT
Definition: export.h:9
Definition: allobjects.cpp:30
std::vector< SubArchiveDirectoryEntry > SubArchiveDirectory
Definition: archives.h:118
std::shared_ptr< const Object > obj_const_ptr
Definition: archives.h:86
Definition: archive_saver.h:18
ArraySaver(const ArraySaver &other)=delete
std::string m_name
Definition: archive_saver.h:63
int m_type
Definition: archive_saver.h:64
ArraySaver(const std::string &name, int type, vistle::oarchive &ar, const void *array=nullptr)
Definition: archive_saver.h:19
bool save()
Definition: archive_saver.h:53
vistle::oarchive & m_ar
Definition: archive_saver.h:65
bool m_ok
Definition: archive_saver.h:62
void operator()(T)
Definition: archive_saver.h:26
Definition: archives.h:51
boost::interprocess::allocator< T, managed_shm::segment_manager > allocator
Definition: shm.h:111