View on GitHub

Vistle

Distributed Data-parallel Scientific Visualization in VR

object.h
Go to the documentation of this file.
1#ifndef OBJECT_H
2#define OBJECT_H
3
4#include <vector>
6#include <memory>
7#include <iostream>
8#include <string>
9#include <atomic>
10
11#ifdef NO_SHMEM
12#include <map>
13#else
14#include "shm.h"
15#endif
17#include <boost/interprocess/exceptions.hpp>
18
19#include <boost/mpl/size.hpp>
20
21#include <vistle/util/enum.h>
22
23#include "export.h"
24#include "shmname.h"
25#include "shm_array.h"
26#include "objectmeta.h"
27#include "scalars.h"
28#include "dimensions.h"
29#include "vector.h"
30
31#include "archives_config.h"
32
33
34namespace vistle {
35
36namespace interprocess = boost::interprocess;
37
38#ifdef NO_SHMEM
39#else
40typedef managed_shm::handle_t shm_handle_t;
41#endif
42
43class Shm;
44
45struct ObjectData;
46class Object;
47
48
50public:
51 //std::shared_ptr<const Object> object() const { static_cast<const Object *>(this)->shared_from_this(); }
52 virtual std::shared_ptr<const Object> object() const = 0;
53
54protected:
56};
57
58class V_COREEXPORT Object: public std::enable_shared_from_this<Object>, virtual public ObjectInterfaceBase {
59 friend class Shm;
60 friend class ObjectTypeRegistry;
61 friend struct ObjectData;
62 template<class ObjType>
63 friend class shm_obj_ref;
64 friend void Shm::markAsRemoved(const std::string &name);
65
66public:
67 typedef std::shared_ptr<Object> ptr;
68 typedef std::shared_ptr<const Object> const_ptr;
70
71 template<class Interface>
72 const Interface *getInterface() const
73 {
74 return dynamic_cast<const Interface *>(this);
75 }
76
77 std::shared_ptr<const Object> object() const override
78 {
79 return static_cast<const Object *>(this)->shared_from_this();
80 }
81
82 enum InitializedFlags { Initialized };
83
84 enum Type {
85 COORD = -9,
86 COORDWRADIUS = -8,
87 DATABASE = -7,
88
89 UNKNOWN = -1,
90
91 EMPTY = 1,
92 PLACEHOLDER = 11,
93
94 TEXTURE1D = 16,
95
96 POINTS = 18,
97 SPHERES = 19,
98 LINES = 20,
99 TUBES = 21,
100 TRIANGLES = 22,
101 POLYGONS = 23,
102 UNSTRUCTUREDGRID = 24,
103 UNIFORMGRID = 25,
104 RECTILINEARGRID = 26,
105 STRUCTUREDGRID = 27,
106 QUADS = 28,
107
108 VERTEXOWNERLIST = 95,
109 CELLTREE1 = 96,
110 CELLTREE2 = 97,
111 CELLTREE3 = 98,
112 NORMALS = 99,
113
114 VEC = 100, // base type id for all Vec types
115 };
116
117 static const char *toString(Type v);
118
119 virtual ~Object();
120
121 bool operator==(const Object &other) const;
122 bool operator!=(const Object &other) const;
123
124 bool isComplete() const;
125
126 virtual std::set<Object::const_ptr> referencedObjects() const;
127
128 static const char *typeName() { return "Object"; }
129 Object::ptr clone() const;
130 virtual Object::ptr cloneInternal() const = 0;
131
132 Object::ptr cloneType() const;
133 virtual Object::ptr cloneTypeInternal() const = 0;
134
135 static Object *createEmpty(const std::string &name = std::string());
136
137 virtual void refresh() const;
138 virtual bool check() const;
139 virtual void updateInternals();
140
141 virtual bool isEmpty() const;
142 virtual bool isEmpty();
143
144 static std::shared_ptr<Object> as(std::shared_ptr<Object> ptr) { return ptr; }
145 static std::shared_ptr<const Object> as(std::shared_ptr<const Object> ptr) { return ptr; }
146
147 shm_handle_t getHandle() const;
148
149 Type getType() const;
150 std::string getName() const;
151
152 int getBlock() const;
153 int getNumBlocks() const;
154 double getRealTime() const;
155 int getTimestep() const;
156 int getNumTimesteps() const;
157 int getIteration() const;
158 int getExecutionCounter() const;
159 int getCreator() const;
160 Matrix4 getTransform() const;
161
162 void setBlock(const int block);
163 void setNumBlocks(const int num);
164 void setRealTime(double time);
165 void setTimestep(const int timestep);
166 void setNumTimesteps(const int num);
167 void setIteration(const int num);
168 void setExecutionCounter(const int count);
169 void setCreator(const int id);
170 void setTransform(const Matrix4 &transform);
171
172 const Meta &meta() const;
173 void setMeta(const Meta &meta);
174
175 void addAttribute(const std::string &key, const std::string &value = "");
176 void setAttributeList(const std::string &key, const std::vector<std::string> &values);
177 virtual void copyAttributes(Object::const_ptr src, bool replace = true);
178 bool hasAttribute(const std::string &key) const;
179 std::string getAttribute(const std::string &key) const;
180 std::vector<std::string> getAttributes(const std::string &key) const;
181 std::vector<std::string> getAttributeList() const;
182
183 // attachments, e.g. Celltrees
184 bool addAttachment(const std::string &key, Object::const_ptr att) const;
185 bool hasAttachment(const std::string &key) const;
186 void copyAttachments(Object::const_ptr src, bool replace = true);
187 Object::const_ptr getAttachment(const std::string &key) const;
188 bool removeAttachment(const std::string &key) const;
189
190 int ref() const;
191 int unref() const;
192 int refcount() const;
193
194 template<class Archive>
195 static Object *loadObject(Archive &ar);
196
197 template<class Archive>
198 void saveObject(Archive &ar) const;
199
201
202#ifdef USE_INTROSPECTION_ARCHIVE
203 virtual void save(FindObjectReferenceOArchive &ar) const = 0;
204#endif
205
206public:
207protected:
209
210public:
211 Data *d() const { return m_data; }
212
213protected:
214 Object(Data *data);
215 Object();
216
217 static void publish(const Data *d);
218 static Object *create(Data *);
219
220private:
221 std::string m_name; // just a debugging aid
222 template<class Archive>
223 void serialize(Archive &ar);
225
226 // not implemented
227 Object(const Object &) = delete;
228 Object &operator=(const Object &) = delete;
229};
230
232
233struct ObjectData: public ShmData {
235
236 std::atomic<int> unresolvedReferences;
237
239
243 typedef std::pair<const Key, AttributeList> AttributeMapValueType;
245#ifdef NO_SHMEM
246 typedef std::map<Key, AttributeList, std::less<Key>, AttributeMapAllocator> AttributeMap;
247#else
248 typedef interprocess::map<Key, AttributeList, std::less<Key>, AttributeMapAllocator> AttributeMap;
249#endif
251 typedef std::map<std::string, std::vector<std::string>> StdAttributeMap; // for serialization
252 void addAttribute(const std::string &key, const std::string &value = "");
253 V_COREEXPORT void setAttributeList(const std::string &key, const std::vector<std::string> &values);
254 void copyAttributes(const ObjectData *src, bool replace);
255 bool hasAttribute(const std::string &key) const;
256 std::string getAttribute(const std::string &key) const;
257 V_COREEXPORT std::vector<std::string> getAttributes(const std::string &key) const;
258 V_COREEXPORT std::vector<std::string> getAttributeList() const;
259
260#ifdef NO_SHMEM
261 mutable std::recursive_mutex attachment_mutex;
262 typedef std::lock_guard<std::recursive_mutex> attachment_mutex_lock_type;
263 typedef const ObjectData *Attachment;
264#else
265 mutable boost::interprocess::interprocess_recursive_mutex attachment_mutex; //< protects attachments
266 typedef boost::interprocess::scoped_lock<boost::interprocess::interprocess_recursive_mutex>
268 typedef interprocess::offset_ptr<const ObjectData> Attachment;
269#endif
270 typedef std::pair<const Key, Attachment> AttachmentMapValueType;
272#ifdef NO_SHMEM
273 typedef std::map<Key, Attachment, std::less<Key>, AttachmentMapAllocator> AttachmentMap;
274#else
275 typedef interprocess::map<Key, Attachment, std::less<Key>, AttachmentMapAllocator> AttachmentMap;
276#endif
278 bool addAttachment(const std::string &key, Object::const_ptr att);
279 void copyAttachments(const ObjectData *src, bool replace);
280 bool hasAttachment(const std::string &key) const;
281 Object::const_ptr getAttachment(const std::string &key) const;
282 bool removeAttachment(const std::string &key);
283
284 V_COREEXPORT ObjectData(Object::Type id = Object::UNKNOWN, const std::string &name = "", const Meta &m = Meta());
285 V_COREEXPORT ObjectData(const ObjectData &other, const std::string &name,
288#ifndef NO_SHMEM
289 V_COREEXPORT void *operator new(size_t size);
290 V_COREEXPORT void *operator new(std::size_t size, void *ptr);
291 V_COREEXPORT void operator delete(void *ptr);
292 V_COREEXPORT void operator delete(void *ptr, void *voidptr2);
293#endif
294 V_COREEXPORT int ref() const;
295 V_COREEXPORT int unref() const;
296 static ObjectData *create(Object::Type id, const std::string &name, const Meta &m);
297 V_COREEXPORT bool isComplete() const;
298 V_COREEXPORT void unresolvedReference();
299 V_COREEXPORT void referenceResolved(const std::function<void()> &completeCallback);
300
302 template<class Archive>
303 void save(Archive &ar) const;
304 template<class Archive>
305 void load(Archive &ar);
306
307 // not implemented
308 ObjectData(const ObjectData &) = delete;
309 ObjectData &operator=(const ObjectData &) = delete;
310};
311
312#ifdef USE_BOOST_ARCHIVE
313extern template Object V_COREEXPORT *V_COREEXPORT::loadObject<boost_iarchive>(boost_iarchive &ar);
314extern template void V_COREEXPORT Object::saveObject<boost_oarchive>(boost_oarchive &ar) const;
315extern template void V_COREEXPORT Object::serialize<boost_iarchive>(boost_iarchive &ar);
316extern template void V_COREEXPORT Object::serialize<boost_oarchive>(boost_oarchive &ar);
317extern template void V_COREEXPORT Object::Data::load<boost_iarchive>(boost_iarchive &ar);
318extern template void V_COREEXPORT Object::Data::save<boost_oarchive>(boost_oarchive &ar) const;
319#endif
320#ifdef USE_YAS
321extern template Object V_COREEXPORT *Object::loadObject<yas_iarchive>(yas_iarchive &ar);
322extern template void V_COREEXPORT Object::saveObject<yas_oarchive>(yas_oarchive &ar) const;
323extern template void V_COREEXPORT Object::serialize<yas_iarchive>(yas_iarchive &ar);
324extern template void V_COREEXPORT Object::serialize<yas_oarchive>(yas_oarchive &ar);
325extern template void V_COREEXPORT Object::Data::load<yas_iarchive>(yas_iarchive &ar);
326extern template void V_COREEXPORT Object::Data::save<yas_oarchive>(yas_oarchive &ar) const;
327#endif
328
329typedef std::function<void(const std::string &name)> ArrayCompletionHandler;
330typedef std::function<void(Object::const_ptr)> ObjectCompletionHandler;
331
333public:
334 typedef Object *(*CreateEmptyFunc)(const std::string &name);
335 typedef Object *(*CreateFunc)(Object::Data *d);
336 typedef void (*DestroyFunc)(const std::string &name);
337
339 CreateEmptyFunc createEmpty;
340 CreateFunc create;
341 DestroyFunc destroy;
342 };
343
344 template<class O>
345 static void registerType(int id)
346 {
347 assert(typeMap().find(id) == typeMap().end());
348 struct FunctionTable t = {
349 O::createEmpty,
350 O::createFromData,
351 O::destroy,
352 };
353 typeMap()[id] = t;
354 }
355
356 static const struct FunctionTable &getType(int id);
357
358 static CreateFunc getCreator(int id);
359 static DestroyFunc getDestroyer(int id);
360
361private:
362 typedef std::map<int, FunctionTable> TypeMap;
363
364 static TypeMap &typeMap();
365};
366
368#define V_CHECK(true_expr) \
369 if (!(true_expr)) { \
370 std::cerr << __FILE__ << ":" << __LINE__ << ": " \
371 << "CONSISTENCY CHECK FAILURE on " << this->getName() << " " << this->meta() << ": " << #true_expr \
372 << std::endl; \
373 std::stringstream str; \
374 str << __FILE__ << ":" << __LINE__ << ": consistency check failure: " << #true_expr; \
375 throw(vistle::except::consistency_error(str.str())); \
376 sleep(30); \
377 return false; \
378 }
379
381#define V_OBJECT(ObjType) \
382public: \
383 typedef std::shared_ptr<ObjType> ptr; \
384 typedef std::shared_ptr<const ObjType> const_ptr; \
385 typedef ObjType Class; \
386 static Object::Type type(); \
387 static const char *typeName() { return #ObjType; } \
388 static std::shared_ptr<const ObjType> as(std::shared_ptr<const Object> ptr) \
389 { \
390 return std::dynamic_pointer_cast<const ObjType>(ptr); \
391 } \
392 static std::shared_ptr<ObjType> as(std::shared_ptr<Object> ptr) \
393 { \
394 return std::dynamic_pointer_cast<ObjType>(ptr); \
395 } \
396 static Object *createFromData(Object::Data *data) { return new ObjType(static_cast<ObjType::Data *>(data)); } \
397 std::shared_ptr<const Object> object() const override \
398 { \
399 return static_cast<const Object *>(this)->shared_from_this(); \
400 } \
401 Object::ptr cloneInternal() const override \
402 { \
403 const std::string n(Shm::the().createObjectId()); \
404 Data *data = shm<Data>::construct(n)(*d(), n); \
405 publish(data); \
406 return Object::ptr(createFromData(data)); \
407 } \
408 ptr clone() const { return ObjType::as(cloneInternal()); } \
409 ptr cloneType() const { return ObjType::as(cloneTypeInternal()); } \
410 Object::ptr cloneTypeInternal() const override { return Object::ptr(new ObjType(Object::Initialized)); } \
411 static Object *createEmpty(const std::string &name) \
412 { \
413 if (name.empty()) \
414 return new ObjType(Object::Initialized); \
415 auto d = Data::createNamed(ObjType::type(), name); \
416 return new ObjType(d); \
417 } \
418 template<class OtherType> \
419 static ptr clone(typename OtherType::ptr other) \
420 { \
421 const std::string n(Shm::the().createObjectId()); \
422 typename ObjType::Data *data = shm<typename ObjType::Data>::construct(n)(*other->d(), n); \
423 assert(data->type == ObjType::type()); \
424 ObjType *ret = dynamic_cast<ObjType *>(createFromData(data)); \
425 assert(ret); \
426 publish(data); \
427 return ptr(ret); \
428 } \
429 template<class OtherType> \
430 static ptr clone(typename OtherType::const_ptr other) \
431 { \
432 return ObjType::clone<OtherType>(std::const_pointer_cast<OtherType>(other)); \
433 } \
434 static void destroy(const std::string &name) { shm<ObjType::Data>::destroy(name); } \
435 void refresh() const override \
436 { \
437 Base::refresh(); \
438 refreshImpl(); \
439 } \
440 void refreshImpl() const; \
441 explicit ObjType(Object::InitializedFlags): Base(ObjType::Data::create()) { refreshImpl(); } \
442 virtual bool isEmpty() override; \
443 virtual bool isEmpty() const override; \
444 bool check() const override \
445 { \
446 refresh(); \
447 if (isEmpty()) { \
448 }; \
449 if (!Base::check()) \
450 return false; \
451 return checkImpl(); \
452 } \
453 struct Data; \
454 const Data *d() const { return static_cast<Data *>(Object::m_data); } \
455 Data *d() { return static_cast<Data *>(Object::m_data); } \
456 /* ARCHIVE_REGISTRATION(override) */ \
457 ARCHIVE_REGISTRATION_INLINE \
458protected: \
459 bool checkImpl() const; \
460 explicit ObjType(Data *data); \
461 ObjType(); \
462\
463private: \
464 ARCHIVE_ACCESS_SPLIT \
465 template<class Archive> \
466 void load(Archive &ar); \
467 template<class Archive> \
468 void save(Archive &ar) const; \
469 friend std::shared_ptr<const Object> Shm::getObjectFromHandle(const shm_handle_t &) const; \
470 friend shm_handle_t Shm::getHandleFromObject(std::shared_ptr<const Object>) const; \
471 friend Object *Object::create(Object::Data *); \
472 friend class ObjectTypeRegistry
473
474#define V_DATA_BEGIN(ObjType) \
475public: \
476 struct V_COREEXPORT Data: public Base::Data { \
477 static Data *createNamed(Object::Type id, const std::string &name); \
478 Data(Object::Type id, const std::string &name, const Meta &meta); \
479 Data(const Data &other, const std::string &name)
480
481#define V_DATA_END(ObjType) \
482private: \
483 friend class ObjType; \
484 ARCHIVE_ACCESS \
485 template<class Archive> \
486 void serialize(Archive &ar); \
487 void initData(); \
488 }
489
490#ifdef USE_BOOST_ARCHIVE
491#ifdef USE_YAS
492#define V_OBJECT_DECL(ObjType) \
493 extern template void V_COREEXPORT ObjType::load<yas_iarchive>(yas_iarchive & ar); \
494 extern template void V_COREEXPORT ObjType::load<boost_iarchive>(boost_iarchive & ar); \
495 extern template void V_COREEXPORT ObjType::save<yas_oarchive>(yas_oarchive & ar) const; \
496 extern template void V_COREEXPORT ObjType::save<boost_oarchive>(boost_oarchive & ar) const; \
497 extern template void V_COREEXPORT ObjType::Data::serialize<yas_iarchive>(yas_iarchive & ar); \
498 extern template void V_COREEXPORT ObjType::Data::serialize<boost_iarchive>(boost_iarchive & ar); \
499 extern template void V_COREEXPORT ObjType::Data::serialize<yas_oarchive>(yas_oarchive & ar); \
500 extern template void V_COREEXPORT ObjType::Data::serialize<boost_oarchive>(boost_oarchive & ar);
501
502#define V_OBJECT_INST(ObjType) \
503 template void V_COREEXPORT ObjType::load<yas_iarchive>(yas_iarchive & ar); \
504 template void V_COREEXPORT ObjType::load<boost_iarchive>(boost_iarchive & ar); \
505 template void V_COREEXPORT ObjType::save<yas_oarchive>(yas_oarchive & ar) const; \
506 template void V_COREEXPORT ObjType::save<boost_oarchive>(boost_oarchive & ar) const; \
507 template void V_COREEXPORT ObjType::Data::serialize<yas_iarchive>(yas_iarchive & ar); \
508 template void V_COREEXPORT ObjType::Data::serialize<boost_iarchive>(boost_iarchive & ar); \
509 template void V_COREEXPORT ObjType::Data::serialize<yas_oarchive>(yas_oarchive & ar); \
510 template void V_COREEXPORT ObjType::Data::serialize<boost_oarchive>(boost_oarchive & ar);
511#else
512#define V_OBJECT_DECL(ObjType) \
513 extern template void V_COREEXPORT ObjType::load<boost_iarchive>(boost_iarchive & ar); \
514 extern template void V_COREEXPORT ObjType::save<boost_oarchive>(boost_oarchive & ar) const; \
515 extern template void V_COREEXPORT ObjType::Data::serialize<boost_iarchive>(boost_iarchive & ar); \
516 extern template void V_COREEXPORT ObjType::Data::serialize<boost_oarchive>(boost_oarchive & ar);
517
518#define V_OBJECT_INST(ObjType) \
519 template void V_COREEXPORT ObjType::load<boost_iarchive>(boost_iarchive & ar); \
520 template void V_COREEXPORT ObjType::save<boost_oarchive>(boost_oarchive & ar) const; \
521 template void V_COREEXPORT ObjType::Data::serialize<boost_iarchive>(boost_iarchive & ar); \
522 template void V_COREEXPORT ObjType::Data::serialize<boost_oarchive>(boost_oarchive & ar);
523#endif
524#else
525#define V_OBJECT_DECL(ObjType) \
526 extern template void V_COREEXPORT ObjType::load<yas_iarchive>(yas_iarchive & ar); \
527 extern template void V_COREEXPORT ObjType::save<yas_oarchive>(yas_oarchive & ar) const; \
528 extern template void V_COREEXPORT ObjType::Data::serialize<yas_iarchive>(yas_iarchive & ar); \
529 extern template void V_COREEXPORT ObjType::Data::serialize<yas_oarchive>(yas_oarchive & ar);
530
531#define V_OBJECT_INST(ObjType) \
532 template void V_COREEXPORT ObjType::load<yas_iarchive>(yas_iarchive & ar); \
533 template void V_COREEXPORT ObjType::save<yas_oarchive>(yas_oarchive & ar) const; \
534 template void V_COREEXPORT ObjType::Data::serialize<yas_iarchive>(yas_iarchive & ar); \
535 template void V_COREEXPORT ObjType::Data::serialize<yas_oarchive>(yas_oarchive & ar);
536#endif
537
539#define V_OBJECT_TYPE(ObjType, id) \
540 Object::Type ObjType::type() { return id; }
541
542#define V_OBJECT_CREATE_NAMED(ObjType) \
543 ObjType::Data::Data(Object::Type id, const std::string &name, const Meta &meta) \
544 : ObjType::Base::Data(id, name, meta) \
545 { \
546 initData(); \
547 } \
548 ObjType::Data *ObjType::Data::createNamed(Object::Type id, const std::string &name) \
549 { \
550 Data *t = shm<Data>::construct(name)(id, name, Meta()); \
551 publish(t); \
552 return t; \
553 }
554
555#define V_OBJECT_CTOR(ObjType) \
556 V_OBJECT_CREATE_NAMED(ObjType) \
557 ObjType::ObjType(ObjType::Data *data): ObjType::Base(data) { refreshImpl(); } \
558 ObjType::ObjType(): ObjType::Base() { refreshImpl(); }
559
560#define V_OBJECT_IMPL_LOAD(ObjType) \
561 template<class Archive> \
562 void ObjType::load(Archive &ar) \
563 { \
564 std::string name; \
565 ar &V_NAME(ar, "name", name); \
566 int type = Object::UNKNOWN; \
567 ar &V_NAME(ar, "type", type); \
568 if (!ar.currentObject()) \
569 ar.setCurrentObject(Object::m_data); \
570 d()->template serialize<Archive>(ar); \
571 assert(type == Object::getType()); \
572 }
573
574#define V_OBJECT_IMPL_SAVE(ObjType) \
575 template<class Archive> \
576 void ObjType::save(Archive &ar) const \
577 { \
578 int type = Object::getType(); \
579 std::string name = d()->name; \
580 ar &V_NAME(ar, "name", name); \
581 ar &V_NAME(ar, "type", type); \
582 const_cast<Data *>(d())->template serialize<Archive>(ar); \
583 }
584
585#define V_OBJECT_IMPL(ObjType) \
586 V_OBJECT_IMPL_LOAD(ObjType) \
587 V_OBJECT_IMPL_SAVE(ObjType)
588
590
591V_ENUM_OUTPUT_OP(Type, Object)
592
593template<typename O, typename... Args>
594typename O::ptr make_ptr(Args &&...args)
595{
596 return typename O::ptr(new O{std::forward<Args>(args)...});
597}
598
599} // namespace vistle
600#endif
#define ARCHIVE_ASSUME_ABSTRACT(obj)
Definition: archives_config.h:466
#define ARCHIVE_ACCESS
Definition: archives_config.h:465
#define ARCHIVE_REGISTRATION(override)
Definition: archives_config.h:543
#define ARCHIVE_ACCESS_SPLIT
Definition: archives_config.h:502
Definition: objectmeta.h:16
Definition: object.h:49
virtual std::shared_ptr< const Object > object() const =0
virtual ~ObjectInterfaceBase()
Definition: object.h:55
Definition: object.h:332
CreateFunc create
Definition: object.h:340
CreateEmptyFunc createEmpty
Definition: object.h:339
DestroyFunc destroy
Definition: object.h:341
static void registerType(int id)
Definition: object.h:345
Definition: object.h:58
InitializedFlags
Definition: object.h:82
static const char * typeName()
Definition: object.h:128
static std::shared_ptr< const Object > as(std::shared_ptr< const Object > ptr)
Definition: object.h:145
static std::shared_ptr< Object > as(std::shared_ptr< Object > ptr)
Definition: object.h:144
std::shared_ptr< const Object > const_ptr
Definition: object.h:68
Data * d() const
Definition: object.h:211
const Interface * getInterface() const
Definition: object.h:72
Data * m_data
Definition: object.h:208
ObjectData Data
Definition: object.h:69
std::shared_ptr< const Object > object() const override
Definition: object.h:77
Type
Definition: object.h:84
@ UNKNOWN
Definition: object.h:89
virtual Object::ptr cloneInternal() const =0
std::shared_ptr< Object > ptr
Definition: object.h:67
virtual Object::ptr cloneTypeInternal() const =0
Definition: shm.h:129
void markAsRemoved(const std::string &name)
Definition: shm.cpp:481
Definition: shm_obj_ref.h:15
Definition: archives.h:342
Definition: archives.h:197
#define V_COREEXPORT
Definition: export.h:9
#define V_ENUM_OUTPUT_OP(name, scope)
Definition: enum.h:72
void serialize(Archive &ar, vistle::Vector1 &v, const unsigned int version)
Definition: vector.h:105
Definition: allobjects.cpp:30
std::function< void(Object::const_ptr)> ObjectCompletionHandler
Definition: archives.h:88
void registerTypes()
Definition: allobjects.cpp:44
bool operator!=(const ParameterVector< S > &v1, const ParameterVector< S > &v2)
Definition: paramvector_impl.h:237
O::ptr make_ptr(Args &&...args)
Definition: object.h:594
managed_shm::handle_t shm_handle_t
Definition: object.h:40
V_MODULEEXPORT double getRealTime(Object::const_ptr obj)
Definition: module.cpp:162
bool operator==(const ParameterVector< S > &v1, const ParameterVector< S > &v2)
Definition: paramvector_impl.h:225
V_MODULEEXPORT int getTimestep(Object::const_ptr obj)
Definition: module.cpp:145
Eigen::Matrix< Scalar, 4, 4 > Matrix4
Definition: vector.h:44
std::function< void(const std::string &name)> ArrayCompletionHandler
Definition: archives.h:87
Definition: object.h:233
std::map< std::string, std::vector< std::string > > StdAttributeMap
Definition: object.h:251
std::atomic< int > unresolvedReferences
no. of not-yet-available arrays and referenced objects
Definition: object.h:236
interprocess::map< Key, AttributeList, std::less< Key >, AttributeMapAllocator > AttributeMap
Definition: object.h:248
shm< char >::string Attribute
Definition: object.h:240
std::pair< const Key, AttributeList > AttributeMapValueType
Definition: object.h:243
interprocess::map< Key, Attachment, std::less< Key >, AttachmentMapAllocator > AttachmentMap
Definition: object.h:275
ObjectData(const ObjectData &)=delete
ObjectData & operator=(const ObjectData &)=delete
ARCHIVE_ACCESS_SPLIT void save(Archive &ar) const
boost::interprocess::interprocess_recursive_mutex attachment_mutex
Definition: object.h:265
Object::Type type
Definition: object.h:234
interprocess::offset_ptr< const ObjectData > Attachment
Definition: object.h:268
Meta meta
Definition: object.h:238
shm< AttachmentMapValueType >::allocator AttachmentMapAllocator
Definition: object.h:271
shm< AttributeMapValueType >::allocator AttributeMapAllocator
Definition: object.h:244
AttributeMap attributes
Definition: object.h:250
shm< char >::string Key
Definition: object.h:241
AttachmentMap attachments
Definition: object.h:277
boost::interprocess::scoped_lock< boost::interprocess::interprocess_recursive_mutex > attachment_mutex_lock_type
Definition: object.h:267
std::pair< const Key, Attachment > AttachmentMapValueType
Definition: object.h:270
shm< Attribute >::vector AttributeList
Definition: object.h:242
Definition: shmdata.h:12
boost::interprocess::basic_string< T, std::char_traits< T >, allocator > string
Definition: shm.h:112
boost::interprocess::allocator< T, managed_shm::segment_manager > allocator
Definition: shm.h:111
boost::interprocess::vector< T, allocator > vector
Definition: shm.h:113