本文整理汇总了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;
}
示例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;
}
示例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()
示例4: GetFactory
bool pgCollection::IsCollectionFor(pgObject *obj)
{
if (!obj)
return false;
pgaFactory *f = obj->GetFactory();
if (!f)
return false;
return GetFactory() == f->GetCollectionFactory();
}
示例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); // --
}
示例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()
示例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;
}
示例8: Input
void RigidBodyModeFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps>::DeclareInput(Level ¤tLevel) 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 */
}
}
示例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);
}
示例10: Input
void PermutationFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps>::DeclareInput(Level ¤tLevel) 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);
}
}
示例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)));
}
示例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;
}
}
}
示例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;
}
示例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);
}
示例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());
}
}