View on GitHub

Vistle

Distributed Data-parallel Scientific Visualization in VR

Classes | Namespaces | Macros | Typedefs | Functions
object.h File Reference
#include <vector>
#include <vistle/util/sysdep.h>
#include <memory>
#include <iostream>
#include <string>
#include <atomic>
#include "shm.h"
#include <vistle/util/boost_interprocess_config.h>
#include <boost/interprocess/exceptions.hpp>
#include <boost/mpl/size.hpp>
#include <vistle/util/enum.h>
#include "export.h"
#include "shmname.h"
#include "shm_array.h"
#include "objectmeta.h"
#include "scalars.h"
#include "dimensions.h"
#include "vector.h"
#include "archives_config.h"
Include dependency graph for object.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  vistle::ObjectInterfaceBase
 
class  vistle::Object
 
struct  vistle::ObjectData
 
class  vistle::ObjectTypeRegistry
 
struct  vistle::ObjectTypeRegistry::FunctionTable
 

Namespaces

namespace  vistle
 

Macros

#define V_CHECK(true_expr)
 use in checkImpl More...
 
#define V_OBJECT(ObjType)
 declare a new Object type More...
 
#define V_DATA_BEGIN(ObjType)
 
#define V_DATA_END(ObjType)
 
#define V_OBJECT_DECL(ObjType)
 
#define V_OBJECT_INST(ObjType)
 
#define V_OBJECT_TYPE(ObjType, id)    Object::Type ObjType::type() { return id; }
 register a new Object type (simple form for non-templates, symbol suffix determined automatically) More...
 
#define V_OBJECT_CREATE_NAMED(ObjType)
 
#define V_OBJECT_CTOR(ObjType)
 
#define V_OBJECT_IMPL_LOAD(ObjType)
 
#define V_OBJECT_IMPL_SAVE(ObjType)
 
#define V_OBJECT_IMPL(ObjType)
 

Typedefs

typedef managed_shm::handle_t vistle::shm_handle_t
 

Functions

void vistle::registerTypes ()
 
template<typename O , typename... Args>
O::ptr vistle::make_ptr (Args &&...args)
 

Class Documentation

◆ vistle::ObjectTypeRegistry::FunctionTable

struct vistle::ObjectTypeRegistry::FunctionTable
Collaboration diagram for vistle::ObjectTypeRegistry::FunctionTable:
Class Members
CreateFunc create
CreateEmptyFunc createEmpty
DestroyFunc destroy

Macro Definition Documentation

◆ V_CHECK

#define V_CHECK (   true_expr)
Value:
if (!(true_expr)) { \
std::cerr << __FILE__ << ":" << __LINE__ << ": " \
<< "CONSISTENCY CHECK FAILURE on " << this->getName() << " " << this->meta() << ": " << #true_expr \
<< std::endl; \
std::stringstream str; \
str << __FILE__ << ":" << __LINE__ << ": consistency check failure: " << #true_expr; \
throw(vistle::except::consistency_error(str.str())); \
sleep(30); \
return false; \
}
Definition: exception.h:40

use in checkImpl

◆ V_DATA_BEGIN

#define V_DATA_BEGIN (   ObjType)
Value:
public: \
struct V_COREEXPORT Data: public Base::Data { \
static Data *createNamed(Object::Type id, const std::string &name); \
Data(Object::Type id, const std::string &name, const Meta &meta); \
Data(const Data &other, const std::string &name)
#define V_COREEXPORT
Definition: export.h:9

◆ V_DATA_END

#define V_DATA_END (   ObjType)
Value:
private: \
friend class ObjType; \
ARCHIVE_ACCESS \
template<class Archive> \
void serialize(Archive &ar); \
void initData(); \
}
void serialize(Archive &ar, vistle::Vector1 &v, const unsigned int version)
Definition: vector.h:105

◆ V_OBJECT

#define V_OBJECT (   ObjType)

declare a new Object type

◆ V_OBJECT_CREATE_NAMED

#define V_OBJECT_CREATE_NAMED (   ObjType)
Value:
ObjType::Data::Data(Object::Type id, const std::string &name, const Meta &meta) \
: ObjType::Base::Data(id, name, meta) \
{ \
initData(); \
} \
ObjType::Data *ObjType::Data::createNamed(Object::Type id, const std::string &name) \
{ \
Data *t = shm<Data>::construct(name)(id, name, Meta()); \
publish(t); \
return t; \
}

◆ V_OBJECT_CTOR

#define V_OBJECT_CTOR (   ObjType)
Value:
ObjType::ObjType(ObjType::Data *data): ObjType::Base(data) { refreshImpl(); } \
ObjType::ObjType(): ObjType::Base() { refreshImpl(); }
#define V_OBJECT_CREATE_NAMED(ObjType)
Definition: object.h:542

◆ V_OBJECT_DECL

#define V_OBJECT_DECL (   ObjType)
Value:
extern template void V_COREEXPORT ObjType::load<yas_iarchive>(yas_iarchive & ar); \
extern template void V_COREEXPORT ObjType::save<yas_oarchive>(yas_oarchive & ar) const; \
extern template void V_COREEXPORT ObjType::Data::serialize<yas_iarchive>(yas_iarchive & ar); \
extern template void V_COREEXPORT ObjType::Data::serialize<yas_oarchive>(yas_oarchive & ar);

◆ V_OBJECT_IMPL

#define V_OBJECT_IMPL (   ObjType)
Value:
V_OBJECT_IMPL_LOAD(ObjType) \
V_OBJECT_IMPL_SAVE(ObjType)
#define V_OBJECT_IMPL_LOAD(ObjType)
Definition: object.h:560

◆ V_OBJECT_IMPL_LOAD

#define V_OBJECT_IMPL_LOAD (   ObjType)
Value:
template<class Archive> \
void ObjType::load(Archive &ar) \
{ \
std::string name; \
ar &V_NAME(ar, "name", name); \
int type = Object::UNKNOWN; \
ar &V_NAME(ar, "type", type); \
if (!ar.currentObject()) \
ar.setCurrentObject(Object::m_data); \
d()->template serialize<Archive>(ar); \
assert(type == Object::getType()); \
}
#define V_NAME(ar, name, obj)
Definition: archives_config.h:441

◆ V_OBJECT_IMPL_SAVE

#define V_OBJECT_IMPL_SAVE (   ObjType)
Value:
template<class Archive> \
void ObjType::save(Archive &ar) const \
{ \
int type = Object::getType(); \
std::string name = d()->name; \
ar &V_NAME(ar, "name", name); \
ar &V_NAME(ar, "type", type); \
const_cast<Data *>(d())->template serialize<Archive>(ar); \
}

◆ V_OBJECT_INST

#define V_OBJECT_INST (   ObjType)
Value:
template void V_COREEXPORT ObjType::load<yas_iarchive>(yas_iarchive & ar); \
template void V_COREEXPORT ObjType::save<yas_oarchive>(yas_oarchive & ar) const; \
template void V_COREEXPORT ObjType::Data::serialize<yas_iarchive>(yas_iarchive & ar); \
template void V_COREEXPORT ObjType::Data::serialize<yas_oarchive>(yas_oarchive & ar);

◆ V_OBJECT_TYPE

#define V_OBJECT_TYPE (   ObjType,
  id 
)     Object::Type ObjType::type() { return id; }

register a new Object type (simple form for non-templates, symbol suffix determined automatically)