1#ifndef VISTLE_ARCHIVE_LOADER_H
2#define VISTLE_ARCHIVE_LOADER_H
9#include <boost/mpl/for_each.hpp>
42 std::cerr <<
"ArrayLoader: multiple type matches for data array " << m_name << std::endl;
49 std::cerr <<
"ArrayLoader: already have data array with name " << m_name << std::endl;
56 assert(arname == m_arname);
57 m_name = ar.translateArrayName(arname);
63 ar.registerArrayNameTranslation(arname, arr.
name());
72 const std::string &name()
const;
73 std::shared_ptr<ArrayOwner> owner()
const;
84 DeepArchiveFetcher(
const std::map<std::string, buffer> &objects,
const std::map<std::string, buffer> &arrays,
85 const std::map<std::string, message::CompressionMode> &compressions,
86 const std::map<std::string, size_t> &sizes);
88 void requestArray(
const std::string &name,
int type,
const ArrayCompletionHandler &completeCallback)
override;
91 bool renameObjects()
const override;
92 std::string translateObjectName(
const std::string &name)
const override;
93 std::string translateArrayName(
const std::string &name)
const override;
94 void registerObjectNameTranslation(
const std::string &arname,
const std::string &name)
override;
95 void registerArrayNameTranslation(
const std::string &arname,
const std::string &name)
override;
97 void setRenameObjects(
bool rename);
98 std::map<std::string, std::string> objectTranslations()
const;
99 std::map<std::string, std::string> arrayTranslations()
const;
100 void setObjectTranslations(
const std::map<std::string, std::string> &objs);
101 void setArrayTranslations(
const std::map<std::string, std::string> &arrs);
103 void releaseArrays();
106 bool m_rename =
false;
107 std::map<std::string, std::string> m_transObject, m_transArray;
109 const std::map<std::string, buffer> &m_objects;
110 const std::map<std::string, buffer> &m_arrays;
111 const std::map<std::string, message::CompressionMode> &m_compression;
112 const std::map<std::string, size_t> &m_rawSize;
114 std::set<std::shared_ptr<ArrayLoader::ArrayOwner>> m_ownedArrays;
Definition: archive_loader.h:82
Definition: archives.h:244
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
bool valid() const
Definition: shm_reference.h:110
const shm_name_t & name() const
Definition: shm_reference_impl.h:129
void construct(const Args &...args)
Definition: shm_reference.h:86
void reset()
Definition: shm_reference.h:55
Definition: shm_array.h:19
Definition: archives.h:342
#define V_COREEXPORT
Definition: export.h:9
Definition: allobjects.cpp:30
std::function< void(Object::const_ptr)> ObjectCompletionHandler
Definition: archives.h:88
std::function< void(const std::string &name)> ArrayCompletionHandler
Definition: archives.h:87
Definition: archive_loader.h:20
virtual ~ArrayOwner()
Definition: archive_loader.h:21
Definition: archive_loader.h:25
Unreffer(ShmVector< T > &ref)
Definition: archive_loader.h:26
ShmVector< T > m_ref
Definition: archive_loader.h:27
Definition: archive_loader.h:19
const vistle::iarchive & m_ar
Definition: archive_loader.h:79
std::shared_ptr< ArrayOwner > m_unreffer
Definition: archive_loader.h:34
ArrayLoader(const ArrayLoader &other)=delete
int m_type
Definition: archive_loader.h:78
std::string m_arname
Definition: archive_loader.h:76
std::string m_name
Definition: archive_loader.h:77
void operator()(T)
Definition: archive_loader.h:37
bool m_ok
Definition: archive_loader.h:75
std::string str() const
Definition: shmname.cpp:18
boost::interprocess::allocator< T, managed_shm::segment_manager > allocator
Definition: shm.h:111