当前位置: 首页>>代码示例>>C++>>正文


C++ ObjectData类代码示例

本文整理汇总了C++中ObjectData的典型用法代码示例。如果您正苦于以下问题:C++ ObjectData类的具体用法?C++ ObjectData怎么用?C++ ObjectData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ObjectData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

 void TwoDepthImageAlignerNode::Relation::serialize(ObjectData& data, IdContext& context) {
   MapNodeBinaryRelation::serialize(data,context);
   data.setPointer("aligner", _aligner);
   data.setPointer("converter", _converter);
   data.setPointer("currentSensingFrame", _currentSensingFrame);
   data.setPointer("referenceSensingFrame", _referenceSensingFrame);
   data.setString("topic", _topic);
   data.setInt("inliers", _inliers);
   data.setFloat("error", _error);
 }
开发者ID:9578577,项目名称:g2o_frontend,代码行数:10,代码来源:two_depthimage_aligner_node.cpp

示例2: f_get_called_class

Variant f_get_called_class() {
  if (hhvm) {
    CallerFrame cf;
    ActRec* ar = cf();
    if (ar == NULL) {
      return Variant(false);
    }
    if (ar->hasThis()) {
      ObjectData* obj = ar->getThis();
      return obj->o_getClassName();
    } else if (ar->hasClass()) {
      return ar->getClass()->preClass()->name()->data();
    } else {
      return Variant(false);
    }
  } else {
    CStrRef cls = FrameInjection::GetStaticClassName(
      ThreadInfo::s_threadInfo.getNoCheck());
    return cls.size() ? Variant(cls.get()) : Variant(false);
  }
}
开发者ID:hashaash,项目名称:hiphop-php,代码行数:21,代码来源:ext_function.cpp

示例3: applyRebase

    //---------------------------------------------------------------------
    void ObjectMemoryManager::applyRebase( ArrayMemoryManager::ManagerType managerType, uint16 level,
                                            const MemoryPoolVec &newBasePtrs,
                                            const ArrayMemoryManager::PtrdiffVec &diffsList )
    {
        ObjectData objectData;
        const size_t numObjs = this->getFirstObjectData( objectData, level );

        for( size_t i=0; i<numObjs; i += ARRAY_PACKED_REALS )
        {
            for( size_t j=0; j<ARRAY_PACKED_REALS; ++j )
            {
                if( objectData.mOwner[j] )
                {
                    objectData.mIndex = j;
                    objectData.mOwner[j]->_getObjectData() = objectData;
                }
            }

            objectData.advancePack();
        }
    }
开发者ID:amerkoleci,项目名称:mogre,代码行数:22,代码来源:OgreObjectMemoryManager.cpp

示例4: objOffsetSet

void objOffsetSet(TypedValue* base, CVarRef offset, TypedValue* val,
                  bool validate /* = true */) {
  if (validate) {
    objArrayAccess(base);
  }
  static StringData* sd__offsetSet = StringData::GetStaticString("offsetSet");
  ObjectData* obj = base->m_data.pobj;
  if (LIKELY(obj->isInstance())) {
    Instance* instance = static_cast<Instance*>(obj);
    const Func* method = instance->methodNamed(sd__offsetSet);
    ASSERT(method != NULL);
    TypedValue tvResult;
    tvWriteUninit(&tvResult);
    instance->invokeUserMethod(&tvResult, method,
                               CREATE_VECTOR2(offset, tvAsCVarRef(val)));
    tvRefcountedDecRef(&tvResult);
  } else {
    tvAsVariant(base).getArrayAccess()
      ->o_invoke(sd__offsetSet, CREATE_VECTOR2(offset, tvAsCVarRef(val)));
  }
}
开发者ID:hashaash,项目名称:hiphop-php,代码行数:21,代码来源:member_operations.cpp

示例5: objOffsetGet

TypedValue* objOffsetGet(TypedValue& tvRef, TypedValue* base,
                         CVarRef offset, bool validate /* = true */) {
  if (validate) {
    objArrayAccess(base);
  }
  TypedValue* result;
  ObjectData* obj = base->m_data.pobj;
  if (LIKELY(obj->isInstance())) {
    Instance* instance = static_cast<Instance*>(obj);
    static StringData* sd__offsetGet = StringData::GetStaticString("offsetGet");
    const Func* method = instance->methodNamed(sd__offsetGet);
    ASSERT(method != NULL);
    instance->invokeUserMethod(&tvRef, method, CREATE_VECTOR1(offset));
    result = &tvRef;
  } else {
    tvAsVariant(&tvRef)
      = tvAsVariant(base).getArrayAccess()->___offsetget_lval(offset);
    result = &tvRef;
  }
  return result;
}
开发者ID:hashaash,项目名称:hiphop-php,代码行数:21,代码来源:member_operations.cpp

示例6: getArrayIterHelper

ArrayIter getArrayIterHelper(const Variant& v, size_t& sz) {
  if (v.isArray()) {
    ArrayData* ad = v.getArrayData();
    sz = ad->size();
    return ArrayIter(ad);
  }
  if (v.isObject()) {
    ObjectData* obj = v.getObjectData();
    if (obj->isCollection()) {
      sz = collections::getSize(obj);
      return ArrayIter(obj);
    }
    bool isIterable;
    Object iterable = obj->iterableObject(isIterable);
    if (isIterable) {
      sz = 0;
      return ArrayIter(iterable.detach(), ArrayIter::noInc);
    }
  }
  SystemLib::throwInvalidArgumentExceptionObject(
    "Parameter must be an array or an instance of Traversable");
}
开发者ID:facebook,项目名称:hhvm,代码行数:22,代码来源:ext_collections.cpp

示例7: wxGetApp

void GUIMainWindow::OnRecalcBtClick(wxCommandEvent& event) {

	//Ist ein Objekt geladen?
	if (wxGetApp().getCurrentDataObjectIndex() > -1) {
		//das aktive Objekt
		ObjectData* obj = wxGetApp().getActiveObject();
		//Speichern der Objekteigenschaften
		assignCurrentObjectProps();
		//neuberechnen der Temperaturverteilung
		obj->calculateIO();
		//aktualisieren des 3D-Fensters
		gl_context->refresh();

		//Objekteigenschaften aktuell
		propbox->getUpToDateLbl()->Hide();

		//evtl. Analysedatenübersicht aktualisieren
		if (analyze_window_valid) {
			analyzerframe->Update();
		}
	}
}
开发者ID:vroland,项目名称:SimpleAnalyzer,代码行数:22,代码来源:GUIMainWindow.cpp

示例8: assert

MStatus ObjectParameterHandler::doSetValue( IECore::ConstParameterPtr parameter, MPlug &plug ) const
{
	IECore::ConstObjectParameterPtr p = IECore::runTimeCast<const IECore::ObjectParameter>( parameter );
	if( !p )
	{
		return MS::kFailure;
	}

	// Keep trying all the available handlers until we find one that works.
	/// \todo Investigate whether we can do a parameter->getValue() here and just get the handler which represents it
	for (IECore::ObjectParameter::TypeIdSet::const_iterator it = p->validTypes().begin(); it != p->validTypes().end(); ++it)
	{
		ConstParameterHandlerPtr h = ParameterHandler::create( *it );
		if (h)
		{
			if ( h->doSetValue( parameter, plug) )
			{
				return MS::kSuccess;
			}
		}
	}

	MStatus s;

	MFnPluginData fnData;
	MObject plugData = fnData.create( ObjectData::id );
	assert( plugData != MObject::kNullObj );

	s = fnData.setObject( plugData );
	assert(s);

	ObjectData* data = dynamic_cast<ObjectData *>( fnData.data(&s) );
	assert(s);
	assert(data);

	data->setObject( p->getValue()->copy() );
	return plug.setValue( plugData );
}
开发者ID:AtomicFiction,项目名称:cortex,代码行数:38,代码来源:ObjectParameterHandler.cpp

示例9: assert

ALWAYS_INLINE
typename std::enable_if<
  std::is_base_of<BaseMap, TMap>::value, Object>::type
BaseMap::php_differenceByKey(const Variant& it) {
  if (!it.isObject()) {
    SystemLib::throwInvalidArgumentExceptionObject(
               "Parameter it must be an instance of Iterable");
  }
  ObjectData* obj = it.getObjectData();
  TMap* target = BaseMap::Clone<TMap>(this);
  auto ret = Object::attach(target);
  if (obj->isCollection()) {
    if (isMapCollection(obj->collectionType())) {
      auto map = static_cast<BaseMap*>(obj);
      auto* eLimit = map->elmLimit();
      for (auto* e = map->firstElm(); e != eLimit; e = nextElm(e, eLimit)) {
        if (e->hasIntKey()) {
          target->remove((int64_t)e->ikey);
        } else {
          assert(e->hasStrKey());
          target->remove(e->skey);
        }
      }
      return ret;
    }
  }
  for (ArrayIter iter(obj); iter; ++iter) {
    Variant k = iter.first();
    if (k.isInteger()) {
      target->remove(k.toInt64());
    } else {
      assert(k.isString());
      target->remove(k.getStringData());
    }
  }
  return ret;
}
开发者ID:gamer7569,项目名称:hhvm,代码行数:37,代码来源:ext_collections-map.cpp

示例10: hasInternalReference

bool ArrayData::hasInternalReference(PointerSet &vars,
                                     bool ds /* = false */) const {
    if (isSharedMap()) return false;
    for (ArrayIter iter(this); iter; ++iter) {
        CVarRef var = iter.secondRef();
        if (var.isReferenced()) {
            Variant *pvar = var.getVariantData();
            if (vars.find(pvar) != vars.end()) {
                return true;
            }
            vars.insert(pvar);
        }
        if (var.isObject()) {
            ObjectData *pobj = var.getObjectData();
            if (vars.find(pobj) != vars.end()) {
                return true;
            }
            vars.insert(pobj);
            if (pobj->o_instanceof("Serializable")) {
                if (ds) {
                    // We want to detect Serializable object as well
                    return true;
                } else {
                    // Serializable object does not have internal reference issue
                    return false;
                }
            }
            if (pobj->o_toArray().get()->hasInternalReference(vars, ds)) {
                return true;
            }
        } else if (var.isArray() &&
                   var.getArrayData()->hasInternalReference(vars, ds)) {
            return true;
        }
    }
    return false;
}
开发者ID:Braunson,项目名称:hiphop-php,代码行数:37,代码来源:array_data.cpp

示例11: assert

Variant ArrayIter::firstHelper() {
    if (hasVector()) {
        return m_pos;
    }
    if (hasMap()) {
        assert(m_pos != 0);
        c_Map* mp = getMap();
        if (UNLIKELY(m_versionNumber != mp->getVersionNumber())) {
            throw_collection_modified();
        }
        return mp->iter_key(m_pos);
    }
    if (hasStableMap()) {
        assert(m_pos != 0);
        c_StableMap* smp = getStableMap();
        if (UNLIKELY(m_versionNumber != smp->getVersionNumber())) {
            throw_collection_modified();
        }
        return smp->iter_key(m_pos);
    }
    assert(hasObject());
    ObjectData* obj = getObject();
    return obj->o_invoke(s_key, Array());
}
开发者ID:gitlisted,项目名称:hiphop-php,代码行数:24,代码来源:array_iterator.cpp

示例12: save

Status PlaybackManager::save( Object* o )
{
	ObjectData* data = o->data();
	data->setLooping( mIsLooping );
	data->setRangedPlayback( mIsRangedPlayback );
	data->setMarkInFrameNumber( mMarkInFrame );
	data->setMarkOutFrameNumber( mMarkOutFrame );
	data->setFrameRate( mFps );
	return Status::OK;
}
开发者ID:linganesan,项目名称:pencil,代码行数:10,代码来源:playbackmanager.cpp

示例13: deserialize

void ManifoldVoronoiExtractor::deserialize(ObjectData& data, IdContext& context)
{
    StreamProcessor::deserialize(data,context);
    data.getReference("manager").bind(_manager);
    data.getReference("cache").bind(_cache);
    _resolution = data.getFloat("resolution");
    _xSize = data.getInt("xSize");
    _ySize = data.getInt("ySize");
    _normalThreshold = data.getFloat("normalThreshold");
    _dequeSize = data.getInt("dequeSize");
}
开发者ID:9578577,项目名称:g2o_frontend,代码行数:11,代码来源:manifold_voronoi_extractor.cpp

示例14: serialize

void ManifoldVoronoiExtractor::serialize(ObjectData& data, IdContext& context)
{
    StreamProcessor::serialize(data,context);
    data.setPointer("manager", _manager);
    data.setPointer("cache", _cache);
    data.setFloat("resolution", _resolution);
    data.setInt("xSize", _xSize);
    data.setInt("ySize", _ySize);
    data.setFloat("normalThreshold", _normalThreshold);
    data.setInt("dequeSize", _dequeSize);
}
开发者ID:9578577,项目名称:g2o_frontend,代码行数:11,代码来源:manifold_voronoi_extractor.cpp

示例15: f_hphp_get_iterator

static Variant f_hphp_get_iterator(VRefParam iterable, bool isMutable) {
  if (iterable.isArray()) {
    if (isMutable) {
      return create_object(s_MutableArrayIterator,
                           CREATE_VECTOR1(ref(iterable)));
    }
    return create_object(s_ArrayIterator,
                         CREATE_VECTOR1(iterable));
  }
  if (iterable.isObject()) {
    ObjectData *obj = iterable.getObjectData();
    Variant iterator;
    while (obj->instanceof(SystemLib::s_IteratorAggregateClass)) {
      iterator = obj->o_invoke(s_getIterator, Array());
      if (!iterator.isObject()) break;
      obj = iterator.getObjectData();
    }
    VM::Class*ctx = g_vmContext->getContextClass();
    CStrRef context = ctx ? ctx->nameRef() : empty_string;
    if (isMutable) {
      if (obj->instanceof(SystemLib::s_IteratorClass)) {
        throw FatalErrorException("An iterator cannot be used for "
                                  "iteration by reference");
      }
      Array properties = obj->o_toIterArray(context, true);
      return create_object(s_MutableArrayIterator,
                           CREATE_VECTOR1(ref(properties)));
    } else {
      if (obj->instanceof(SystemLib::s_IteratorClass)) {
        return obj;
      }
      return create_object(s_ArrayIterator,
                           CREATE_VECTOR1(obj->o_toIterArray(context)));
    }
  }
  raise_warning("Invalid argument supplied for iteration");
  if (isMutable) {
    return create_object(s_MutableArrayIterator,
                         CREATE_VECTOR1(Array::Create()));
  }
  return create_object(s_ArrayIterator,
                       CREATE_VECTOR1(Array::Create()));
}
开发者ID:SagaieNet,项目名称:hiphop-php,代码行数:43,代码来源:ext_array.cpp


注:本文中的ObjectData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。