4#include <boost/type_traits.hpp>
5#include <boost/mpl/find.hpp>
6#include <boost/mpl/size.hpp>
7#include <boost/mpl/push_back.hpp>
23template<
typename T,
class allocator>
26 const size_t pos = boost::mpl::find<VectorTypes, T>::type::pos::value;
27 static_assert(pos < boost::mpl::size<VectorTypes>::value,
"Scalar type not found");
46 if (array::typeId() != arr->type()) {
56template<
class Archive>
59 std::string n(
name.data());
61 ar &
V_NAME(ar,
"shm_name_t", n);
64template<
class Archive>
68 ar &
V_NAME(ar,
"shm_name_t", n);
69 auto end = n.find(
'\0');
70 if (end != std::string::npos) {
73 if (n.size() <
name.size()) {
74 std::copy(n.begin(), n.end(),
name.data());
75 name[n.size()] =
'\0';
77 std::cerr <<
"shm_name_t: name too long: " << n <<
" (" << n.size() <<
" chars)" << std::endl;
79 assert(n.size() <
name.size());
87typename managed_shm::segment_manager::template construct_proxy<T>::type
shm<T>::construct(
const std::string &name)
#define V_NAME(ar, name, obj)
Definition: archives_config.h:441
friend struct shm
Definition: shm.h:131
static Shm & the()
Definition: shm.cpp:315
const ShmVector< T > getArrayFromName(const std::string &name) const
Definition: shm_impl.h:32
std::string name() const
Definition: shm.cpp:300
Definition: shm_reference.h:15
Definition: shm_array.h:19
static int typeId()
Definition: shm_impl.h:24
Definition: allobjects.cpp:30
boost::mpl::push_back< VectorTypes1, CelltreeNode< sizeof(Index), 2 > >::type VectorTypes2
Definition: shm_impl.h:20
boost::mpl::vector< char, signed char, unsigned char, int32_t, uint32_t, int64_t, uint64_t, float, double > Scalars
Definition: scalars.h:14
boost::mpl::push_back< Scalars, CelltreeNode< sizeof(Index), 1 > >::type VectorTypes1
Definition: shm_impl.h:19
boost::mpl::push_back< VectorTypes2, CelltreeNode< sizeof(Index), 3 > >::type VectorTypes
Definition: shm_impl.h:21
uint32_t Index
Definition: index.h:13
Definition: celltree.h:20
@ ARRAY
Definition: shmdata.h:16
void load(Archive &ar)
Definition: shm_impl.h:65
std::array< char, 32 > name
Definition: shmname.h:12
ARCHIVE_ACCESS_SPLIT void save(Archive &ar) const
static T * find_and_ref(const std::string &name)
Definition: shm.h:255
static managed_shm::segment_manager::template construct_proxy< T >::type construct(const std::string &name)
Definition: shm_impl.h:87