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


C++ GetFactory函数代码示例

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


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

示例1: SDL_LockAudio

bool Game::Update(GameTime)
{
	time.StartFrame();

	SDL_LockAudio();
	{
		ParseInput();
		if (Transitioning())
		{
			Transist();
		}
		else if (phase)
		{
			phase->Update(time);
		}
	}
	SDL_UnlockAudio();

	GetFactory()->Purge();

	if (finished)
	{
		SDL_CloseAudio();
	}

	return !finished;
}
开发者ID:MihailTrajkovski,项目名称:xiq,代码行数:27,代码来源:Game.cpp

示例2: GetFactory

bool LevelWorkerGameObjects::RemoveFeature()
{
    // Remove this worker from the ID->Worker map maintained by the factory.
    GetFactory()->ClearWorkerForObject(m_pGo->GetId());
    // Remove the object.
    Engine::Instance()->ClearGameObject(m_pGo->GetId());
    return true;
}
开发者ID:jason-amju,项目名称:amju-scp,代码行数:8,代码来源:LevelWorkerGameObjects.cpp

示例3: GetParameterList

  void RebalanceMapFactory<LocalOrdinal, GlobalOrdinal, Node>::DeclareInput(Level & currentLevel) const {
    const Teuchos::ParameterList & pL = GetParameterList();
    std::string mapName                        = pL.get<std::string> ("Map name");
    Teuchos::RCP<const FactoryBase> mapFactory = GetFactory          ("Map factory");
    currentLevel.DeclareInput(mapName,mapFactory.get(),this);

    Input(currentLevel, "Importer");
  } //DeclareInput()
开发者ID:KineticTheory,项目名称:Trilinos,代码行数:8,代码来源:MueLu_RebalanceMapFactory_def.hpp

示例4: GetFactory

bool pgCollection::IsCollectionFor(pgObject *obj)
{
	if (!obj)
		return false;
	pgaFactory *f = obj->GetFactory();
	if (!f)
		return false;
	return GetFactory() == f->GetCollectionFactory();
}
开发者ID:KrisShannon,项目名称:pgadmin3,代码行数:9,代码来源:pgCollection.cpp

示例5: Input

  void SaPFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::DeclareInput(Level &fineLevel, Level &coarseLevel) const {
    Input(fineLevel, "A");

    // Get default tentative prolongator factory
    // Getting it that way ensure that the same factory instance will be used for both SaPFactory and NullspaceFactory.
    RCP<const FactoryBase> initialPFact = GetFactory("P");
    if (initialPFact == Teuchos::null) { initialPFact = coarseLevel.GetFactoryManager()->GetFactory("Ptent"); }
    coarseLevel.DeclareInput("P", initialPFact.get(), this); // --
  }
开发者ID:abhishek4747,项目名称:trilinos,代码行数:9,代码来源:MueLu_SaPFactory_def.hpp

示例6: m

  void RebalanceMapFactory<LocalOrdinal, GlobalOrdinal, Node>::Build(Level &level) const {
    FactoryMonitor m(*this, "Build", level);

    //Teuchos::RCP<Teuchos::FancyOStream> fos = Teuchos::getFancyOStream(Teuchos::rcpFromRef(std::cout));

    // extract data from Level object
    const Teuchos::ParameterList & pL = GetParameterList();
    std::string mapName = pL.get<std::string> ("Map name");
    Teuchos::RCP<const FactoryBase> mapFactory = GetFactory ("Map factory");

    RCP<const Import> rebalanceImporter = Get<RCP<const Import> >(level, "Importer");

    if(rebalanceImporter != Teuchos::null) {
      // input map (not rebalanced)
      RCP<const Map> map = level.Get< RCP<const Map> >(mapName,mapFactory.get());

      // create vector based on input map
      // Note, that the map can be a part only of the full map stored in rebalanceImporter.getSourceMap()
      RCP<Vector> v = VectorFactory::Build(map);
      v->putScalar(1.0);

      // create a new vector based on the full rebalanceImporter.getSourceMap()
      // import the partial map information to the full source map
      RCP<const Import> blowUpImporter = ImportFactory::Build(map, rebalanceImporter->getSourceMap());
      RCP<Vector> pv = VectorFactory::Build(rebalanceImporter->getSourceMap());
      pv->doImport(*v,*blowUpImporter,Xpetra::INSERT);

      // do rebalancing using rebalanceImporter
      RCP<Vector> ptv = VectorFactory::Build(rebalanceImporter->getTargetMap());
      ptv->doImport(*pv,*rebalanceImporter,Xpetra::INSERT);

      if (pL.get<bool>("repartition: use subcommunicators") == true)
        ptv->replaceMap(ptv->getMap()->removeEmptyProcesses());

      // reconstruct rebalanced partial map
      Teuchos::ArrayRCP< const Scalar > ptvData = ptv->getData(0);
      std::vector<GlobalOrdinal> localGIDs;  // vector with GIDs that are stored on current proc

      for (size_t k = 0; k < ptv->getLocalLength(); k++) {
        if(ptvData[k] == 1.0) {
          localGIDs.push_back(ptv->getMap()->getGlobalElement(k));
        }
      }

      const Teuchos::ArrayView<const GlobalOrdinal> localGIDs_view(&localGIDs[0],localGIDs.size());

      Teuchos::RCP<const Map> localGIDsMap = MapFactory::Build(
          map->lib(),
          Teuchos::OrdinalTraits<int>::invalid(),
          localGIDs_view,
          0, ptv->getMap()->getComm());  // use correct communicator here!

      // store rebalanced partial map using the same name and generating factory as the original map
      // in the level class
      level.Set(mapName, localGIDsMap, mapFactory.get());
    }
  } //Build()
开发者ID:KineticTheory,项目名称:Trilinos,代码行数:57,代码来源:MueLu_RebalanceMapFactory_def.hpp

示例7: GetFactory

//---------------------------------------------------------------------------
// 初期化
bool TModuleJava::Initialize(void){
	JavaVM *vm; JNIEnv *env;
	if (JNI_OK!=setup(GetFactory().GetLogger(), &vm, &env)) return false;

	obj_saori=(jobject)handle;
	jclass lref_cls=env->GetObjectClass(obj_saori);
	cls_saori=(jclass)env->NewGlobalRef(lref_cls);

	mid_load=env->GetMethodID(cls_saori, "load", "([B)Z");
	mid_unload=env->GetMethodID(cls_saori, "unload", "()Z");
	mid_request=env->GetMethodID(cls_saori, "request", "([B)[B");

	if (mid_request==NULL){
		GetFactory().GetLogger().GetStream(LOG_ERROR) << "[SAORI Java] importing 'request' from ("+path+") failed." << endl;
		return false;
	}
	return true;
}
开发者ID:Narazaka,项目名称:kawari,代码行数:20,代码来源:saori_java.cpp

示例8: Input

 void RigidBodyModeFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps>::DeclareInput(Level &currentLevel) const {
   if (currentLevel.IsAvailable(nspName_, NoFactory::get()) == false && currentLevel.GetLevelID() == 0) {
     Input(currentLevel, "A");
     //Input(currentLevel,"Coordinates");
   }
   if (currentLevel.GetLevelID() !=0) {
     currentLevel.DeclareInput("Nullspace", GetFactory(nspName_).get(), this); /* ! "Nullspace" and nspName_ mismatch possible here */
   }
 }
开发者ID:gitter-badger,项目名称:quinoa,代码行数:9,代码来源:MueLu_RigidBodyModeFactory_def.hpp

示例9: GetFactory

IGameComponent* GameComponentCreator::CreateObject(const core::string&name,GameEntityManager*mngr)
{
	IGameComponentFactory* f= GetFactory(name);
	if(!f)
	{
		gLogManager.log(mT("Game Component Factory with type: '")+name+mT("' was not found"),ELL_WARNING,EVL_Normal);
		return 0;
	}
	return f->CreateComponent(mngr);
}
开发者ID:yingzhang536,项目名称:mrayy-Game-Engine,代码行数:10,代码来源:GameComponentCreator.cpp

示例10: Input

void PermutationFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps>::DeclareInput(Level &currentLevel) const {
  Input(currentLevel, "A");

  const ParameterList & pL = GetParameterList();
  std::string mapName                        = pL.get<std::string> ("PermutationRowMapName");
  Teuchos::RCP<const FactoryBase> mapFactory = GetFactory          ("PermutationRowMapFactory");

  if(mapName.length() > 0 ) {
    currentLevel.DeclareInput(mapName,mapFactory.get(),this);
  }
}
开发者ID:gitter-badger,项目名称:quinoa,代码行数:11,代码来源:MueLu_PermutationFactory_def.hpp

示例11: Request

//---------------------------------------------------------------------------
// SAORI/1.0 Request
string TModuleJava::Request(const string &req){
	if (!mid_request) return ("");

	JavaVM *vm; JNIEnv *env;
	if (JNI_OK!=setup(GetFactory().GetLogger(), &vm, &env)) return ("");

	jobject obj_saori=(jobject)handle;

	return jba2string(env, (jbyteArray)env->CallObjectMethod(
		obj_saori, mid_request, string2jba(env, req)));
}
开发者ID:Narazaka,项目名称:kawari,代码行数:13,代码来源:saori_java.cpp

示例12: GetFactory

void Ghost::Process()
{
    --seconds_until_respawn_;
    if (seconds_until_respawn_ < 0)
    {
        size_t net_id = GetFactory().GetNetId(GetId());
        if (net_id)
        {
            auto login_mob = GetFactory().Create<IMob>(LoginMob::T_ITEM_S());

            GetFactory().SetPlayerId(net_id, login_mob.ret_id());
            if (GetId() == GetMob().ret_id())
            {
                ChangeMob(login_mob);
            }
            delThis();
            //qDebug() << "Ghost deleted: net_id: " << net_id;
        }
    }
}
开发者ID:Disasm,项目名称:karya-valya,代码行数:20,代码来源:Ghost.cpp

示例13:

pgaFactory *pgaFactory::GetFactoryByMetaType(const int type)
{
	int i;
	pgaFactory *factory;

	for (i = FACTORY_OFFSET ; (factory = GetFactory(i)) != 0 ; i++)
	{
		if (factory->GetMetaType() == type)
			return factory;
	}
	return 0;
}
开发者ID:AnnaSkawinska,项目名称:pgadmin3,代码行数:12,代码来源:factory.cpp

示例14: PlaySoundIfVisible

void Grille::AttackBy(id_ptr_on<Item> item)
{
    if (id_ptr_on<Wirecutters> w = item)
    {
        PlaySoundIfVisible("Wirecutter.ogg", owner.ret_id());
        if (!cutted_)
        {
            SetState("brokengrille");
            SetPassable(D_ALL, Passable::FULL);
            cutted_ = true;
            GetFactory().Create<IOnMapObject>(Rod::T_ITEM_S(), GetOwner());
        }
        else
        {
            GetFactory().Create<IOnMapObject>(Rod::T_ITEM_S(), GetOwner());
            delThis();
        }
    }
    else
        Structure::AttackBy(item);
}
开发者ID:Disasm,项目名称:karya-valya,代码行数:21,代码来源:Grille.cpp

示例15: Input

  void UncoupledAggregationFactory<LocalOrdinal, GlobalOrdinal, Node, LocalMatOps>::DeclareInput(Level& currentLevel) const {
    Input(currentLevel, "Graph");
    Input(currentLevel, "DofsPerNode");

    const ParameterList& pL = GetParameterList();

    std::string mapOnePtName = pL.get<std::string>("OnePt aggregate map name");
    if (mapOnePtName.length() > 0) {
      RCP<const FactoryBase> mapOnePtFact = GetFactory("OnePt aggregate map factory");
      currentLevel.DeclareInput(mapOnePtName, mapOnePtFact.get());
    }
  }
开发者ID:rorypeck,项目名称:trilinos,代码行数:12,代码来源:MueLu_UncoupledAggregationFactory_def.hpp


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