您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ Any函数代码示例

51自学网 2021-06-01 19:47:06
  C++
这篇教程C++ Any函数代码示例写得很实用,希望能帮到您。

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

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

示例1: switch

	// 获取属性值	Any TriggerObject::getProperty(uint id)const	{		if(id > ID_NullObject_Begin && id < ID_NullObject_End)			return NullObject::getProperty(id);		switch(id)		{		case ID_Trigger:							// 触发器设置			{				return Any();			}			break;		case ID_TriggerCondition:							// 满足条件			{				return Any(getCondition());			}			break;		case ID_TriggerOnEnterEvent:							// 进入事件			{				return Any(getOnEnterEvent());			}			break;		case ID_TriggerOnLeaveEvent:							// 退出事件			{				return Any(getOnLeaveEvent());			}			break;		default:			return Any();			break;		}	}
开发者ID:duzhi5368,项目名称:FKOgreWorldEdit,代码行数:32,


示例2: PageData

	//---------------------------------------------------------------------	WorkQueue::Response* Page::handleRequest(const WorkQueue::Request* req, const WorkQueue* srcQ)	{		// Background thread (maybe)		PageRequest preq = any_cast<PageRequest>(req->getData());		// only deal with own requests; we shouldn't ever get here though		if (preq.srcPage != this)			return 0;		PageResponse res;		res.pageData = OGRE_NEW PageData();		WorkQueue::Response* response = 0;		try		{			prepareImpl(res.pageData);			response = OGRE_NEW WorkQueue::Response(req, true, Any(res));		}		catch (Exception& e)		{			// oops			response = OGRE_NEW WorkQueue::Response(req, false, Any(res), 				e.getFullDescription());		}		return response;	}
开发者ID:JangoOs,项目名称:kbengine_ogre_demo,代码行数:27,


示例3: Any

    //---------------------------------------------------------------------    WorkQueue::Response* TerrainPagedWorldSection::handleRequest(const WorkQueue::Request* req, const WorkQueue* srcQ)    {        if(mPagesInLoading.empty())        {            mHasRunningTasks = false;            req->abortRequest();            return OGRE_NEW WorkQueue::Response(req, true, Any());        }        unsigned long currentTime = Root::getSingletonPtr()->getTimer()->getMilliseconds();        if(currentTime < mNextLoadingTime)        {            // Wait until the next page is to be loaded -> we are in background thread here            OGRE_THREAD_SLEEP(mNextLoadingTime - currentTime);        }        PageID pageID = mPagesInLoading.front();        // call the TerrainDefiner from the background thread        long x, y;        // pageID is the same as a packed index        mTerrainGroup->unpackIndex(pageID, &x, &y);        if(!mTerrainDefiner)            mTerrainDefiner = OGRE_NEW TerrainDefiner();        mTerrainDefiner->define(mTerrainGroup, x, y);        // continue loading in main thread        return OGRE_NEW WorkQueue::Response(req, true, Any());    }
开发者ID:LiberatorUSA,项目名称:GUCEF,代码行数:31,


示例4: if

        void Preferences::onChangeHedgeSelection(int) {            fl::Engine* engine = Model::Default()->engine();            if (ui->ckx_any->isChecked() and not engine->hasHedge(Any().name()))                engine->addHedge(new Any);            else if (not ui->ckx_any->isChecked() and engine->hasHedge(Any().name()))                delete engine->removeHedge(Any().name());            if (ui->ckx_extremely->isChecked() and not engine->hasHedge(Extremely().name()))                engine->addHedge(new Extremely);            else if (not ui->ckx_extremely->isChecked() and engine->hasHedge(Extremely().name()))                delete engine->removeHedge(Extremely().name());            if (ui->ckx_not->isChecked() and not engine->hasHedge(Not().name()))                engine->addHedge(new Not);            else if (not ui->ckx_not->isChecked() and engine->hasHedge(Not().name()))                delete engine->removeHedge(Not().name());            if (ui->ckx_seldom->isChecked() and not engine->hasHedge(Seldom().name()))                engine->addHedge(new Seldom);            else if (not ui->ckx_seldom->isChecked() and engine->hasHedge(Seldom().name()))                delete engine->removeHedge(Seldom().name());            if (ui->ckx_somewhat->isChecked() and not engine->hasHedge(Somewhat().name()))                engine->addHedge(new Somewhat);            else if (not ui->ckx_somewhat->isChecked() and engine->hasHedge(Somewhat().name()))                delete engine->removeHedge(Somewhat().name());            if (ui->ckx_very->isChecked() and not engine->hasHedge(Very().name()))                engine->addHedge(new Very);            else if (not ui->ckx_very->isChecked() and engine->hasHedge(Very().name()))                delete engine->removeHedge(Very().name());            Window::mainWindow()->fixDependencies();        }
开发者ID:DevasenaInupakutika,项目名称:assn2,代码行数:34,


示例5: Any

Any Converter<float>::convert(const Any& a){	if (typeid(int) == a.type())		return Any(helper<float, int>::convert(a));	else if (typeid(const char *) == a.type())		return Any(helper<float, const char *>::convert(a));	return any_cast<float>(a);}
开发者ID:biofag,项目名称:UMOF,代码行数:9,


示例6: Any

Any Converter<float>::convert(const Any& a){    if (Type::from<int>() == a.type())		return Any(helper<float, int>::convert(a));    else if (Type::from<const char *>() == a.type())		return Any(helper<float, const char *>::convert(a));	return any_cast<float>(a);}
开发者ID:crazybie,项目名称:uMOF,代码行数:9,


示例7: switch

	// 获取属性值	Any CameraObject::getProperty(uint id)const	{		if(id > ID_NullObject_Begin && id < ID_NullObject_End)			return NullObject::getProperty(id);		switch(id)		{		case ID_Camera:							// 摄像机设置			{				return Any();			}			break;		case ID_PolygonMode:						// 几何渲染模式			{				return Any((long)m_camera->getPolygonMode());			}			break;		case ID_LodBias:							// LOD偏移			{				return Any(m_camera->getLodBias());			}			break;		case ID_NearClipDistance:				// 近裁面			{				return Any(m_camera->getNearClipDistance());			}			break;		case ID_FarClipDistance:					// 远裁面			{				return Any(m_camera->getFarClipDistance());			}			break;		case ID_FOVy:							// FOVy角度			{				return Any(m_camera->getFOVy().valueDegrees());			}			break;		case ID_AspectRatio:						// 窗口比率			{				return Any(m_camera->getAspectRatio());			}			break;		case ID_ProjectionType:					// 投影方式			{				return Any((long)m_camera->getProjectionType());			}			break;		case ID_OrthoWindow:						// 正交投影窗口大小			{				return Any(Vector2(m_camera->getOrthoWindowWidth() , m_camera->getOrthoWindowHeight()));			}			break;		default:			return Any();			break;		}	}
开发者ID:duzhi5368,项目名称:FKOgreWorldEdit,代码行数:57,


示例8: Any

Any ArticulatedModel::Instruction::Identifier::toAny() const {    if (isAll()) {        return Any(Any::ARRAY, "all");    } else if (isRoot()) {        return Any(Any::ARRAY, "root");    } else if (id.initialized()) {        return Any(int(id));    } else {        return Any(name);    }}
开发者ID:A7med-Shoukry,项目名称:g3d,代码行数:11,


示例9: convertToAny

Any convertToAny(NPP npp, const NPVariant* variant){    switch (variant->type)    {    case NPVariantType_Void:    case NPVariantType_Null:        return Any();        break;    case NPVariantType_Bool:        return NPVARIANT_TO_BOOLEAN(*variant);        break;    case NPVariantType_Int32:        return NPVARIANT_TO_INT32(*variant);        break;    case NPVariantType_Double:        return NPVARIANT_TO_DOUBLE(*variant);        break;    case NPVariantType_String:        return std::string(NPVARIANT_TO_STRING(*variant).utf8characters, NPVARIANT_TO_STRING(*variant).utf8length);        break;    case NPVariantType_Object:    {        NPObject* object = NPVARIANT_TO_OBJECT(*variant);        if (!object)        {            break;        }        if (StubObject::isStub(object))        {            StubObject* stub = static_cast<StubObject*>(object);            return stub->getObject();        }        PluginInstance* instance = static_cast<PluginInstance*>(npp->pdata);        if (instance)        {            ProxyControl* proxyControl = instance->getProxyControl();            if (proxyControl)            {                return proxyControl->createProxy(object);            }        }        break;    }    default:        break;    }    return Any();}
开发者ID:giobeatle1794,项目名称:es-operating-system,代码行数:48,


示例10: Any

void CCPlayer::Open(const std::string& loadParams){    CCMessageCenter::GetInstance()->PostMessage(MESSAGE_OBJECT_ENUM_CLIENT,                                                MESSAGE_OBJECT_ENUM_PLAYER,                                                COMMAND_TYPE_ENUM_OPEN,                                                Any(loadParams));}
开发者ID:fastget,项目名称:CCPlayer_On_iOS,代码行数:7,


示例11: find

    //---------------------------------------------------------------------    void TerrainPagedWorldSection::loadPage(PageID pageID, bool forceSynchronous)    {        if (!mParent->getManager()->getPagingOperationsEnabled())            return;        PageMap::iterator i = mPages.find(pageID);        if (i == mPages.end())        {            std::list<PageID>::iterator it = find( mPagesInLoading.begin(), mPagesInLoading.end(), pageID);            if(it==mPagesInLoading.end())            {                mPagesInLoading.push_back(pageID);                mHasRunningTasks = true;            }                        // no running tasks, start the new one            if(mPagesInLoading.size()==1)            {                Root::getSingleton().getWorkQueue()->addRequest(                    mWorkQueueChannel, WORKQUEUE_LOAD_TERRAIN_PAGE_REQUEST,                     Any(), 0, forceSynchronous);            }        }        PagedWorldSection::loadPage(pageID, forceSynchronous);    }
开发者ID:LiberatorUSA,项目名称:GUCEF,代码行数:27,


示例12: RTException

void	StateRoom::accessRoom(){  INetworkRelay *network = this->_world->getSharedObject<INetworkRelay>("NetworkRelay");  if (network) {    Remote *remote = NULL;    if (this->_textboxRoom->getString() != "")      this->_textboxRoom->setString("defaulte");    if (!(remote = network->getRemote(0)))      throw RTException("Invalid remote");    IBuffer *buffer = network->getTCPBuffer();    *buffer << static_cast<char>(INetworkRelay::CHANGE_ROOM_QUERY);    *buffer << this->_textboxRoom->getString();    remote->sendTCP(buffer);    Thread<INetworkRelay> *thread = new Thread<INetworkRelay>();    thread->start(network, &INetworkRelay::start, Any());    while (42) {      LockVector<IBuffer *> &recv_buffer = remote->getRecvBufferTCP();      auto guard = create_lock(recv_buffer);      for (auto it = recv_buffer.begin(); it != recv_buffer.end();)	{	  if (this->parsePacket(recv_buffer, it))	    return ;	}    }  } else {    throw RTException("Invalid network");  }}
开发者ID:deb0ch,项目名称:R-Type,代码行数:32,


示例13: ss

Signature TextureProxy::MakeSignature(const Proxy<res::Image> &image, vid::opengl::TextureFormat format, vid::opengl::TextureFlags flags, const math::Vector<2, bool> &clamp){    std::ostringstream ss(image.GetSignature());    switch (format)    {    case vid::opengl::defaultTextureFormat:        break;    case vid::opengl::alphaTextureFormat:        ss << ":alpha";        break;    case vid::opengl::luminanceTextureFormat:        ss << ":luminance";        break;    default:        assert(!"invalid texture format");    }    if (flags & vid::opengl::filterTextureFlag) ss << ":filter";    if (flags & vid::opengl::mipmapTextureFlag) ss << ":mipmap";    if (Any(clamp))    {        ss << ":clamp";        if      (!clamp.x) ss << ".y";        else if (!clamp.y) ss << ".x";    }    return Signature("OpenGL texture", ss.str());}
开发者ID:davidosborn,项目名称:page,代码行数:26,


示例14: Room

RoomServer::RoomServer(ServerRelay *server, const std::string &nameRoomServer)  : Room(), _serverRelay(server), _nameRoomServer(nameRoomServer){  std::cout << "Creating new room: " << this->_nameRoomServer << std::endl;  this->_runWorldServer = new RunWorldServer(server, nameRoomServer);  this->_thread.start(this->_runWorldServer, &RunWorldServer::run, Any());}
开发者ID:deb0ch,项目名称:R-Type,代码行数:7,


示例15: inputStream

void Instance::LoadModList(){	if (GetModListFile().FileExists())	{		wxFileInputStream inputStream(GetModListFile().GetFullPath());		wxStringList modListFile = ReadAllLines(inputStream);				for (wxStringList::iterator iter = modListFile.begin(); iter != modListFile.end(); iter++)		{			// Normalize the path to the instMods dir.			wxFileName modFile(*iter);			modFile.Normalize(wxPATH_NORM_ALL, GetInstModsDir().GetFullPath());			modFile.MakeRelativeTo();						if (!Any(modList.begin(), modList.end(), [&modFile] (Mod mod) -> bool				{ return mod.GetFileName().SameAs(wxFileName(modFile)); }))			{				//SetNeedsRebuild();				modList.push_back(Mod(modFile));			}		}	}		for (size_t i = 0; i < modList.size(); i++)	{		if (!modList[i].GetFileName().FileExists())		{			SetNeedsRebuild();			modList.erase(modList.begin() + i);			i--;		}	}		LoadModListFromDir(GetInstModsDir());}
开发者ID:bartbes,项目名称:MultiMC4,代码行数:35,


示例16: Any

void GameObject::createGameObject(const String &name, const String &meshName){	mEntity = mSceneMgr->createEntity(generateName(name), meshName);	mSceneNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();	mSceneNode->getUserObjectBindings().setUserAny("GameObject", Any(this));	mSceneNode->attachObject(mEntity);}
开发者ID:keinerweiss,项目名称:3DGPProject,代码行数:7,


示例17: ServiceControl

 void ServiceControl(int offset, const std::string& operation, int ranking) {     if (0 <= offset && offset <= 3)     {         if (operation == "register")         {             if (!servregs[offset])             {                 std::stringstream servicename;                 servicename << SERVICE << offset;                 InterfaceMap ifm;                 ifm.insert(std::make_pair(servicename.str(), static_cast<void*>(this)));                 ServiceProperties props;                 props.insert(std::make_pair(ServiceConstants::SERVICE_RANKING(), Any(ranking)));                 servregs[offset] = mc->RegisterService(ifm, props);             }         }         if (operation == "unregister")         {             if (servregs[offset])             {                 ServiceRegistrationU sr1 = servregs[offset];                 sr1.Unregister();                 servregs[offset] = 0;             }         }     } }
开发者ID:GHfangxin,项目名称:MITK,代码行数:28,


示例18: csharpformat

	std::string csharpformat(std::string fmt, T1 t1)	{		std::vector<streamable> args;		args.push_back(Any(t1));		csharpformat(fmt, arga);	}
开发者ID:GoMani,项目名称:Mervin,代码行数:7,


示例19: switch

	Any& Any::operator=(Type t) {		switch (t) {		case NONE:			*this = Any();			break;		case TABLE:		case ARRAY:			*this = Any(t);			break;		default:			alwaysAssertM(false, "Can only assign NONE, TABLE, or ARRAY Type enum.");		}		return *this;	}
开发者ID:lev1976g,项目名称:easywow,代码行数:17,


示例20: Any

GLight::operator Any() const {    Any a(Any::TABLE, "GLight");    a.set("position", position.operator Any());    a.set("rightDirection", rightDirection.operator Any());    a.set("spotDirection", spotDirection.operator Any());    a.set("spotCutoff", spotCutoff);    a.set("spotSquare", spotSquare);    Any att(Any::ARRAY);    att.append(attenuation[0], attenuation[1], attenuation[2]);    a.set("attenuation", att);    a.set("color", color.operator Any());    a.set("enabled", enabled);    a.set("specular", specular);    a.set("diffuse", diffuse);    return a;}
开发者ID:Blumfield,项目名称:TBCPvP,代码行数:17,


示例21: EditorPlugin

	/**	 *	 * /param pluginName 	 * /param nPageX 	 * /param nPageY 	 * /param vPos 	 * /param nMinBatchSize 	 * /param nMaxBatchSize 	 * /param nLayerCount 	 * /param tpl 	 * /param bAtOnceLoad 	 * /return 	 */	EditorTerrainPage::EditorTerrainPage(const String& pluginName, int nPageX, int nPageY, const Vector3& vPos, uint16 nMinBatchSize, uint16 nMaxBatchSize,		uint16 nLayerCount, const STerrainPageLayer& tpl, bool bAtOnceLoad)		: EditorPlugin(pluginName), m_pTerrain(NULL), m_pSaveHeight(NULL)	{		m_AlterRect = Rect(0, 0, 0, 0);		if (configure(nPageX, nPageY, vPos, nMinBatchSize, nMaxBatchSize, nLayerCount, tpl, bAtOnceLoad))		{			addProperty(terrainPageName[TERRAINPAGE_PLUGIN_NAME],				Any(pluginName), PVT_STRING, 0, terrainPageDesc[TERRAINPAGE_PLUGIN_NAME]);			addProperty(terrainPageName[TERRAINPAGE_LAYERCOUNT],				Any(nLayerCount), PVT_USHORT, true, terrainPageDesc[TERRAINPAGE_LAYERCOUNT]);			addProperty(terrainPageName[TERRAINPAGE_PAGEX],				Any(nPageX), PVT_INT, true, terrainPageDesc[TERRAINPAGE_PAGEX]);			addProperty(terrainPageName[TERRAINPAGE_PAGEY],				Any(nPageY), PVT_INT, true, terrainPageDesc[TERRAINPAGE_PAGEY]);		}	}
开发者ID:lonyzone,项目名称:oathx-ogrex-editor,代码行数:31,


示例22: SetScale

	void Scale::SetScale(const math::Vec3 &value)	{		// NOTE: comparing value to avoid redundant dirty marking		if (Any(value != this->value))		{			this->value = value;			dirtyTransformSig();		}	}
开发者ID:davidosborn,项目名称:page,代码行数:9,


示例23: Any

Any ModuleManifest::GetValue(const std::string& key) const{  AnyMap::const_iterator iter = m_Properties.find(key);  if (iter != m_Properties.end())  {    return iter->second;  }  return Any();}
开发者ID:0r,项目名称:MITK,代码行数:9,


示例24: destroy

	// 创建对象实体	void BoxTriggerObject::create(IScene *scene , const NameValuePairList* params)	{		destroy();		NullObject::create(scene , params);		// 创建实体		m_entity = m_scene->getTriggerWorld()->createBoxTriggerEntity(getFullName());		m_entity->setUserAny(Any(static_cast<ISceneObject*>(this)));		m_node->setListener(this);	}
开发者ID:duzhi5368,项目名称:FKOgreWorldEdit,代码行数:10,


示例25: toString

 std::string CppExporter::toString(const Hedge * hedge) const {     if (hedge->name() == Any().name()) return "new " + fl("Any");     if (hedge->name() == Extremely().name()) return "new " + fl("Extremely");     if (hedge->name() == Not().name()) return "new " + fl("Not");     if (hedge->name() == Seldom().name()) return "new " + fl("Seldom");     if (hedge->name() == Somewhat().name()) return "new " + fl("Somewhat");     if (hedge->name() == Very().name()) return "new " + fl("Very");     return "new " + fl(hedge->name()); }
开发者ID:senabhishek,项目名称:fuzzyliteAndSwift,代码行数:9,


示例26: registerConstructor

 HedgeFactory::HedgeFactory() : ConstructionFactory<Hedge*>("Hedge") {     registerConstructor("", fl::null);     registerConstructor(Any().name(), &(Any::constructor));     registerConstructor(Extremely().name(), &(Extremely::constructor));     registerConstructor(Not().name(), &(Not::constructor));     registerConstructor(Seldom().name(), &(Seldom::constructor));     registerConstructor(Somewhat().name(), &(Somewhat::constructor));     registerConstructor(Very().name(), &(Very::constructor)); }
开发者ID:invalid404,项目名称:FuzzyFall,代码行数:9,


示例27: toString

 std::string CppExporter::toString(const Hedge * hedge) const {     if (hedge->name() == Any().name()) return "new fl::Any";     if (hedge->name() == Extremely().name()) return "new fl::Extremely";     if (hedge->name() == Not().name()) return "new fl::Not";     if (hedge->name() == Seldom().name()) return "new fl::Seldom";     if (hedge->name() == Somewhat().name()) return "new fl::Somewhat";     if (hedge->name() == Very().name()) return "new fl::Very";     return hedge->name(); }
开发者ID:maciek-slon,项目名称:Fuzzy,代码行数:9,



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


C++ App函数代码示例
C++ AnscSizeOfString函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。