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


C++ ObjectPtr类代码示例

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


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

示例1: convertObject

static ObjectPtr convertObject(ObjectPtr x) {
    switch (x->objKind) {
    case RECORD : {
        Record *y = (Record *)x.ptr();
        if (y->params.empty() && !y->varParam.ptr())
            return recordType(y, vector<ObjectPtr>()).ptr();
        return x;
    }
    case VARIANT : {
        Variant *y = (Variant *)x.ptr();
        if (y->params.empty() && !y->varParam.ptr())
            return variantType(y, vector<ObjectPtr>()).ptr();
        return x;
    }
    default :
        return x;
    }
}
开发者ID:kssreeram,项目名称:clay-old,代码行数:18,代码来源:loader.cpp

示例2: addObject

 //-----------------------------------------------------------------------
 void Scene::addObject(const ObjectPtr& object)
 {
     if (!mObjects.get<by_identity>().insert(object).second)
     {
         OGRE_EXCEPT(Ogre::Exception::ERR_DUPLICATE_ITEM,
             "The given object with name '" + object->getName() + "' already contain by this scene",
             "Scene::addObject");
     }
 }
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:10,代码来源:WXScene.cpp

示例3: Indicator

    void 
    AddLightObjectPlugin::onAddObject(const ObjectPtr& object)
    {
        Ogre::String type = object->getType();

        // 判断,如果是能处理的类型(LightObject),就处理
        if ( type == "Light" )
        {
            LightObject *lightObject = static_cast<LightObject *> (object.get());
            Indicator *indicator = new Indicator(object,mSceneManipulator->getSceneManager(),
                mSceneManipulator );

            std::pair<Indicators::iterator, bool> inserted =
                mIndicators.insert(Indicators::value_type(object, indicator));

            assert(inserted.second);
        }
    }
开发者ID:gitrider,项目名称:wxsj2,代码行数:18,代码来源:AddLightObjectPlugin.cpp

示例4: removeObject

 //-----------------------------------------------------------------------
 void Scene::removeObject(const ObjectPtr& object)
 {
     if (mObjects.get<by_identity>().erase(object) <= 0)
     {
         OGRE_EXCEPT(Ogre::Exception::ERR_ITEM_NOT_FOUND,
             "The given object with name '" + object->getName() + "' doesn't contain by this scene",
             "Scene::removeObject");
     }
 }
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:10,代码来源:WXScene.cpp

示例5: TEST

		TEST(ObjectTests, NilObject)
		{
			ObjectPtr object = createObject();
			ASSERT_EQ(Object::NIL, object->getNativeType());
			ASSERT_TRUE(object->isNil());
			ASSERT_EQ(false, object->getBoolean());
			ASSERT_EQ(0.f, object->getNumber());
			ASSERT_TRUE(object->getString().empty());
			ASSERT_EQ(0, object->getUserdata());
			ASSERT_STREQ("nil", object->getReadableString().c_str());
		}
开发者ID:redxdev,项目名称:shogun-old,代码行数:11,代码来源:Object.cpp

示例6: OnContextMenu

void SceneBrowser::OnContextMenu( ObjectPtr &object, wxTreeEvent& event )
{
	const Ogre::String &type = object->getType();

	if ( type == "Actor" )
	{
		ActorAnimationSettingDialog *dlg = new ActorAnimationSettingDialog(this, wxID_ANY,
			_("ActorAnimationSetting Dialog"), object, mSceneManipulator, event.GetPoint());

		int result = dlg->Show(true);
		//if (result == wxID_CANCEL)
		//{
		//	// 如果异常列表中仍有内容,就给出提示
		//	if (dlg->mListBox->GetCount() > 0)
		//	{
		//		wxMessageBox(_("Thera are still some wrongs in scene,remember to fix them!"));
		//	}
		//	else
		//	{
		//		wxMessageBox(_("All wrongs in scene have been fixed,remember to save the scene!"));
		//	}
		//}

	}
	else if ( type == "Effect" )
	{
		
		Fairy::Effect *effect = static_cast<Fairy::EffectObject *>(object.get())->getEffect();

		if ( effect )
		{
			if ( NULL == mEffectDialog )
			{
				mEffectDialog = new WXEffectEditDialog(this, wxID_ANY, _("Effect Setting"));
			}
			if ( false == mEffectDialog->IsShown() )
				mEffectDialog->Show();			
			mEffectDialog->InitEffectDialog(effect, mSceneManipulator);
		}			
	}

	mSceneManipulator->setActiveAction(NULL);
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:43,代码来源:SceneBrowser.cpp

示例7: material_

DX11DeferredRendererMaterial::DX11DeferredRendererMaterial(const ObjectPtr<DX11Material>& base_material) :
material_(base_material->Instantiate()){

	auto& resources = DX11Graphics::GetInstance().GetResources();

	shader_parameters_ = resources.Load<IStructuredBuffer, IStructuredBuffer::FromSize>({ sizeof(ShaderParameters) });

	material_->SetInput(kShaderParameters, ObjectPtr<IStructuredBuffer>(shader_parameters_));

}
开发者ID:Tiriath,项目名称:GI,代码行数:10,代码来源:dx11deferred_renderer.cpp

示例8: insert

void ObjectSet::insert(ObjectPtr object)
{
    std::pair<ObjectSet::SetType::iterator, bool> result =
        objects.insert(object);

    if (result.second)
    {
        objectMap[object->getId()] = result.first;
    }
}
开发者ID:naderman,项目名称:spoac,代码行数:10,代码来源:ObjectSet.cpp

示例9: guard

IException* User::Channel::SendAndReceive(TypeInfo::MethodAttributes_t attribs, Remoting::IMessage* pSend, Remoting::IMessage*& pRecv)
{
	// Get the object manager
	OOBase::Guard<OOBase::SpinLock> guard(m_lock);

	ObjectPtr<Remoting::IMarshaller> ptrMarshaller = m_ptrMarshaller;
	if (!ptrMarshaller)
		throw Remoting::IChannelClosedException::Create(OMEGA_CREATE_INTERNAL("SendAndReceive() called on disconnected channel"));

	guard.release();

	// We need to wrap the message
	ObjectPtr<ObjectImpl<OOCore::CDRMessage> > ptrEnvelope = ObjectImpl<OOCore::CDRMessage>::CreateObject();
	ptrMarshaller->MarshalInterface(string_t::constant("payload"),ptrEnvelope,OMEGA_GUIDOF(Remoting::IMessage),pSend);

	OOBase::CDRStream response;
	try
	{
		OOServer::MessageHandler::io_result::type res = Manager::instance()->send_request(m_channel_id,ptrEnvelope->GetCDRStream(),&response,attribs);
		if (res != OOServer::MessageHandler::io_result::success)
		{
			if (res == OOServer::MessageHandler::io_result::channel_closed)
			{
				disconnect();
				throw Omega::Remoting::IChannelClosedException::Create(OMEGA_CREATE_INTERNAL("Failed to send request"));
			}
			
			disconnect();
			OMEGA_THROW("Internal server exception");
		}
	}
	catch (...)
	{
		ptrMarshaller->ReleaseMarshalData(string_t::constant("payload"),ptrEnvelope,OMEGA_GUIDOF(Remoting::IMessage),pSend);
		throw;
	}

	if (!(attribs & TypeInfo::Asynchronous))
	{
		try
		{
			// Wrap the response
			ObjectPtr<ObjectImpl<OOCore::CDRMessage> > ptrRecv = ObjectImpl<OOCore::CDRMessage>::CreateObject();
			ptrRecv->init(response);

			// Unwrap the payload...
			IObject* pObj = NULL;
			ptrMarshaller->UnmarshalInterface(string_t::constant("payload"),ptrRecv,OMEGA_GUIDOF(Remoting::IMessage),pObj);
			pRecv = static_cast<Remoting::IMessage*>(pObj);
		}
		catch (IException* pE)
		{
			return pE;
		}
	}

	return NULL;
}
开发者ID:omegaonline,项目名称:oocore,代码行数:58,代码来源:UserChannel.cpp

示例10: printStaticName

void printStaticName(llvm::raw_ostream &out, ObjectPtr x)
{
    if (x->objKind == IDENTIFIER) {
        Identifier *y = (Identifier *)x.ptr();
        out << y->str;
    }
    else {
        printName(out, x);
    }
}
开发者ID:DawidvC,项目名称:clay,代码行数:10,代码来源:printer.cpp

示例11: Inside_Object

bool Inside_Object (const Vector3d& IPoint, ObjectPtr Object, TraceThreadData *Thread)
{
    for (vector<ObjectPtr>::iterator Sib = Object->Clip.begin(); Sib != Object->Clip.end(); Sib++)
    {
        if(!Inside_Object(IPoint, *Sib, Thread))
            return false;
    }

    return (Object->Inside(IPoint, Thread));
}
开发者ID:atlaste,项目名称:povray,代码行数:10,代码来源:object.cpp

示例12: configureTab

void HistogramDialog::configureTab(ObjectPtr object) {
  if (!object) {
    _histogramTab->setRealTimeAutoBin(dialogDefaults().value("histogram/realTimeAutoBin", false).toBool());
    _histogramTab->setNormalizationType(Histogram::NormalizationType(dialogDefaults().value("histogram/normalizationType",Histogram::Number).toInt()));
  } else if (HistogramPtr histogram = kst_cast<Histogram>(object)) {
    _histogramTab->setVector(histogram->vector());
    _histogramTab->setMin(histogram->xMin());
    _histogramTab->setMax(histogram->xMax());
    _histogramTab->setBins(histogram->numberOfBins());
    _histogramTab->setRealTimeAutoBin(histogram->realTimeAutoBin());
    _histogramTab->setNormalizationType(histogram->normalizationType());
    _histogramTab->hideCurveOptions();
    if (_editMultipleWidget) {
      HistogramList objects = _document->objectStore()->getObjects<Histogram>();
      _editMultipleWidget->clearObjects();
      foreach(HistogramPtr object, objects) {
        _editMultipleWidget->addObject(object->Name(), object->descriptionTip());
      }
    }
开发者ID:lnickers2004,项目名称:kst,代码行数:19,代码来源:histogramdialog.cpp

示例13: SetAgent

void Player::SetAgent( sf::Uint16 id ) {
	m_tentative_agent_id = id;
	ObjectPtr object = Game::GetGame()->GetObjectManager()->GetObjectById( id );

	if( !object ) {
		return;
	}

	if( object->GetType() != ObjectType::SHIP ) {
		return;
	}

	ShipPtr agent = std::static_pointer_cast<Ship>( Game::GetGame()->GetObjectManager()->GetObjectById( id ) );
	agent->SetPlayer( true );
	LogConsole( "Set player ship to object: " + string_cast( id ) );
	m_tentative_agent_id = 0xffff;

	m_agent = agent;
}
开发者ID:Tym17tools,项目名称:Wyrm,代码行数:19,代码来源:player.cpp

示例14: DeserializeInstance

void ArchiveBinary::DeserializeInstance(ObjectPtr& object)
{
    //
    // If we don't have an object allocated for deserialization, pull one from the stream
    //

    if (!object.ReferencesObject())
    {
        object = Allocate();
    }

    //
    // We should now have an instance (unless data was skipped)
    //

    if (object.ReferencesObject())
    {
#ifdef REFLECT_ARCHIVE_VERBOSE
        m_Indent.Get(stdout);
        Log::Print(TXT("Deserializing %s\n"), object->GetClass()->m_Name);
        m_Indent.Push();
#endif

        object->PreDeserialize( NULL );

        Data* data = SafeCast<Data>(object);

        if ( data )
        {
            data->Deserialize(*this);
        }
        else
        {
            DeserializeFields(object);
        }

        object->PostDeserialize( NULL );

#ifdef REFLECT_ARCHIVE_VERBOSE
        m_Indent.Pop();
#endif
    }
}
开发者ID:euler0,项目名称:Helium,代码行数:43,代码来源:ArchiveBinary.cpp

示例15: throwUOE

void
throwUOE(const string& expectedType, const ObjectPtr& v)
{
    //
    // If the object is an unknown sliced object, we didn't find an
    // object factory, in this case raise a NoObjectFactoryException
    // instead.
    //
    UnknownSlicedObject* uso = dynamic_cast<UnknownSlicedObject*>(v.get());
    if(uso)
    {
        throw NoObjectFactoryException(__FILE__, __LINE__, "", uso->getUnknownTypeId());
    }

    string type = v->ice_id();
    throw Ice::UnexpectedObjectException(__FILE__, __LINE__,
                                         "expected element of type `" + expectedType + "' but received '" +
                                         type, type, expectedType);
}
开发者ID:Jonavin,项目名称:ice,代码行数:19,代码来源:Exception.cpp


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