Ejemplo n.º 1
0
shm_handle_t Shm::getHandleFromObject(Object::const_ptr object) const {

#ifdef NO_SHMEM
   return object->d();
#else
   try {
      return m_shm->get_handle_from_address(object->d());

   } catch (interprocess_exception &) { }

   return 0;
#endif
}
Ejemplo n.º 2
0
void PlaceHolder::setReal(Object::const_ptr r) {

   if (Object::const_ptr old = real())
      old->unref();
   d()->real = r->d();
   if (r)
      r->ref();
}
Ejemplo n.º 3
0
bool Object::Data::addAttachment(const std::string &key, Object::const_ptr obj) {

   boost::interprocess::scoped_lock<boost::interprocess::interprocess_recursive_mutex> lock(attachment_mutex);
   const Key skey(key.c_str(), Shm::the().allocator());
   AttachmentMap::iterator it = attachments->find(skey);
   if (it != attachments->end()) {
      return false;
   }

   obj->ref();
   attachments->insert(AttachmentMapValueType(skey, obj->d()));

   return true;
}
Ejemplo n.º 4
0
bool Object::Data::addAttachment(const std::string &key, Object::const_ptr obj) {

   attachment_mutex_lock_type lock(attachment_mutex);
   const Key skey(key.c_str(), Shm::the().allocator());
   AttachmentMap::const_iterator it = attachments.find(skey);
   if (it != attachments.end()) {
      return false;
   }

   obj->ref();
   attachments.insert(AttachmentMapValueType(skey, obj->d()));

   return true;
}
Ejemplo n.º 5
0
void Object::copyAttributes(Object::const_ptr src, bool replace) {

   if (replace) {
      auto &m = d()->meta;
      auto &sm = src->meta();
      m.setBlock(sm.block());
      m.setNumBlocks(sm.numBlocks());
      m.setTimeStep(sm.timeStep());
      m.setNumTimesteps(sm.numTimesteps());
      m.setRealTime(sm.realTime());
      m.setAnimationStep(sm.animationStep());
      m.setNumAnimationSteps(sm.numAnimationSteps());
      m.setIteration(sm.iteration());
   }

   d()->copyAttributes(src->d(), replace);
}
Ejemplo n.º 6
0
void Object::copyAttachments(Object::const_ptr src, bool replace) {

   d()->copyAttachments(src->d(), replace);
}