コード例 #1
0
ファイル: placeholder.cpp プロジェクト: xyuan/vistle
void PlaceHolder::setReal(Object::const_ptr r) {

   if (Object::const_ptr old = real())
      old->unref();
   d()->real = r->d();
   if (r)
      r->ref();
}
コード例 #2
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;
}
コード例 #3
0
ファイル: object.cpp プロジェクト: vistle/vistle
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;
}