本文整理汇总了C++中Universe::SetName方法的典型用法代码示例。如果您正苦于以下问题:C++ Universe::SetName方法的具体用法?C++ Universe::SetName怎么用?C++ Universe::SetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Universe
的用法示例。
在下文中一共展示了Universe::SetName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetUniverseName
/*
* Sets the name of a universe
*/
void OlaServerServiceImpl::SetUniverseName(
RpcController* controller,
const UniverseNameRequest* request,
Ack*,
google::protobuf::Closure* done) {
ClosureRunner runner(done);
Universe *universe = m_universe_store->GetUniverse(request->universe());
if (!universe)
return MissingUniverseError(controller);
universe->SetName(request->name());
}
示例2: SetUniverseName
/*
* Sets the name of a universe
*/
void OlaServerServiceImpl::SetUniverseName(
RpcController* controller,
const UniverseNameRequest* request,
Ack*,
ola::rpc::RpcService::CompletionCallback* done) {
ClosureRunner runner(done);
Universe *universe = m_universe_store->GetUniverse(request->universe());
if (!universe)
return MissingUniverseError(controller);
universe->SetName(request->name());
}
示例3: testLifecycle
/*
* Test that we can create universes and save their settings
*/
void UniverseTest::testLifecycle() {
Universe *universe = m_store->GetUniverse(TEST_UNIVERSE);
OLA_ASSERT_FALSE(universe);
universe = m_store->GetUniverseOrCreate(TEST_UNIVERSE);
OLA_ASSERT(universe);
OLA_ASSERT_EQ(TEST_UNIVERSE, universe->UniverseId());
OLA_ASSERT_EQ((unsigned int) 1, m_store->UniverseCount());
OLA_ASSERT_EQ(Universe::MERGE_LTP, universe->MergeMode());
OLA_ASSERT_FALSE(universe->IsActive());
string universe_name = "New Name";
universe->SetName(universe_name);
universe->SetMergeMode(Universe::MERGE_HTP);
OLA_ASSERT_EQ(universe_name, universe->Name());
OLA_ASSERT_EQ(Universe::MERGE_HTP, universe->MergeMode());
// delete it
m_store->AddUniverseGarbageCollection(universe);
m_store->GarbageCollectUniverses();
OLA_ASSERT_EQ((unsigned int) 0, m_store->UniverseCount());
universe = m_store->GetUniverse(TEST_UNIVERSE);
OLA_ASSERT_FALSE(universe);
// now re-create it
universe = m_store->GetUniverseOrCreate(TEST_UNIVERSE);
OLA_ASSERT(universe);
OLA_ASSERT_EQ((unsigned int) 1, m_store->UniverseCount());
OLA_ASSERT_EQ(TEST_UNIVERSE, universe->UniverseId());
OLA_ASSERT_EQ(universe_name, universe->Name());
OLA_ASSERT_EQ(Universe::MERGE_HTP, universe->MergeMode());
m_store->DeleteAll();
OLA_ASSERT_EQ((unsigned int) 0, m_store->UniverseCount());
}