本文整理汇总了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);
}
示例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);
}
}
示例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();
}
}
示例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)));
}
}
示例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;
}
示例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");
}
示例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();
}
}
}
示例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 );
}
示例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;
}
示例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;
}
示例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());
}
示例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;
}
示例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");
}
示例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);
}
示例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()));
}