• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetPlatform函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: work

 // This will return as soon as a message is posted
 S32 work(Thread::MessageQueue& messageQueue)
 {
    U32 start = GetPlatform()->getRealMilliseconds();
    Thread::MessageRef msg;
    messageQueue.waitOnMessageToThread(msg, true);
    return GetPlatform()->getRealMilliseconds() - start;
 }
开发者ID:justindujardin,项目名称:ACL,代码行数:8,代码来源:threadTests.cpp


示例2: LogMessageFile

void LogMessageFile(my::LogLevel level, my::SrcPoint const & srcPoint, string const & msg)
{
  static mutex mtx;
  static unique_ptr<FileWriter> file;

  string recordType;
  switch (level)
  {
  case LINFO: recordType.assign("INFO "); break;
  case LDEBUG: recordType.assign("DEBUG "); break;
  case LWARNING: recordType.assign("WARN "); break;
  case LERROR: recordType.assign("ERROR "); break;
  case LCRITICAL: recordType.assign("FATAL "); break;
  }

  lock_guard<mutex> lock(mtx);

  if (file == nullptr)
  {
    if (GetPlatform().WritableDir().empty())
      return;
    tm * curTimeTM = GetLocalTime();
    stringstream fileName;
    fileName << "logging_" << curTimeTM->tm_year + 1900 << "_" << curTimeTM->tm_mon + 1 << "_" << curTimeTM->tm_mday << "_"
      << curTimeTM->tm_hour << "_" << curTimeTM->tm_min << "_" << curTimeTM->tm_sec << ".log";
    file.reset(new FileWriter(GetPlatform().WritablePathForFile(fileName.str())));
  }

  string srcString = recordType + DebugPrint(srcPoint) + " " + msg + "\n";

  file->Write(srcString.c_str(), srcString.size());
  file->Flush();
}
开发者ID:DINKIN,项目名称:omim,代码行数:33,代码来源:file_logging.cpp


示例3: rect

Rect HierarchyTreeScreenNode::GetRect() const
{
	Rect rect(0, 0, GetPlatform()->GetWidth(), GetPlatform()->GetHeight());
	
	CombineRectWithChild(rect);
	
	return rect;
}
开发者ID:galek,项目名称:dava.framework,代码行数:8,代码来源:HierarchyTreeScreenNode.cpp


示例4: TEST

   TEST(Thread, DeleteTermination)
   {
      AutoPtr<Thread> t(new Thread(MakeDelegate(&work)));

      U32 time = GetPlatform()->getRealMilliseconds();
      t->start();
      t = NULL;
      time = GetPlatform()->getRealMilliseconds() - time;
      //, "Thread deletion did not immediately terminate the thread");
      EXPECT_TRUE(time < 1000);
   }
开发者ID:justindujardin,项目名称:ACL,代码行数:11,代码来源:threadTests.cpp


示例5: m_writableDirBeforeTest

WritableDirChanger::WritableDirChanger(string const & testDir)
  : m_writableDirBeforeTest(GetPlatform().WritableDir())
  , m_testDirFullPath(m_writableDirBeforeTest + testDir)
{
  Platform & platform = GetPlatform();
  platform.RmDirRecursively(m_testDirFullPath);
  TEST(!platform.IsFileExistsByFullPath(m_testDirFullPath), ());
  TEST_EQUAL(Platform::ERR_OK, platform.MkDir(m_testDirFullPath), ());
  platform.SetWritableDirForTests(m_testDirFullPath);
  settings::Clear();
}
开发者ID:tsd-kikkawa,项目名称:omim,代码行数:11,代码来源:write_dir_changer.cpp


示例6: main

int main(int argc, char * argv[])
{
  // Our double parsing code (base/string_utils.hpp) needs dots as a floating point delimiters, not commas.
  // TODO: Refactor our doubles parsing code to use locale-independent delimiters.
  // For example, https://github.com/google/double-conversion can be used.
  // See http://dbaron.org/log/20121222-locale for more details.
  (void)::setenv("LC_NUMERIC", "C", 1);

  InitializeFinalize mainGuard;
  UNUSED_VALUE(mainGuard);

  QApplication a(argc, argv);

#ifdef DEBUG
  alohalytics::Stats::Instance().SetDebugMode(true);
#endif

  GetPlatform().SetupMeasurementSystem();

  // display EULA if needed
  char const * settingsEULA = "EulaAccepted";
  bool eulaAccepted = false;
  if (!Settings::Get(settingsEULA, eulaAccepted) || !eulaAccepted)
  {
    QStringList buttons;
    buttons << "Accept" << "Decline";

    string buffer;
    {
      ReaderPtr<Reader> reader = GetPlatform().GetReader("eula.html");
      reader.ReadAsString(buffer);
    }
    qt::InfoDialog eulaDialog("MAPS.ME End User Licensing Agreement", buffer.c_str(), NULL, buttons);
    eulaAccepted = (eulaDialog.exec() == 1);
    Settings::Set(settingsEULA, eulaAccepted);
  }

  int returnCode = -1;
  if (eulaAccepted)   // User has accepted EULA
  {
    qt::MainWindow w;
    w.show();
    returnCode = a.exec();
  }

  dbg::ObjectTracker::PrintLeaks();

  LOG_SHORT(LINFO, ("MapsWithMe finished with code", returnCode));
  return returnCode;
}
开发者ID:alexz89ua,项目名称:omim,代码行数:50,代码来源:main.cpp


示例7: Name

const wxString wxProcessKiller::Name(int pid)
{
    wxString str;
    str.Printf(_T("id=%d"),pid);
#ifdef _DEBUG
#ifdef _WIN32
    if(VER_PLATFORM_WIN32_NT==GetPlatform() && hInstLib1){
        static BOOL (WINAPI *lpfEnumProcessModules)( HANDLE, HMODULE *, DWORD, LPDWORD ) =
            (BOOL(WINAPI *)(HANDLE, HMODULE *, DWORD, LPDWORD)) GetProcAddress( (HINSTANCE) hInstLib1,"EnumProcessModules" ) ;
        static DWORD (WINAPI *lpfGetModuleFileNameEx)( HANDLE, HMODULE, LPTSTR, DWORD )=
            (DWORD (WINAPI *)(HANDLE, HMODULE,LPTSTR, DWORD )) GetProcAddress( (HINSTANCE) hInstLib1,"GetModuleFileNameExA" ) ;
        if( lpfEnumProcessModules &&  lpfGetModuleFileNameEx ) {
            HANDLE hProcess=::OpenProcess(PROCESS_ALL_ACCESS,false,pid);
            if(hProcess) {
                HMODULE hMod;
                DWORD dwSize;
                if(lpfEnumProcessModules( hProcess, &hMod, sizeof(HMODULE), &dwSize ) ){
                    // Get Full pathname:
                    TCHAR buf[1+MAX_PATH];
                    lpfGetModuleFileNameEx( hProcess, hMod, buf, MAX_PATH);
                    str+=_TCHAR(' ');
                    str+=buf;
                }
                CloseHandle(hProcess);
            }
        }
    }
#endif
#endif
    return str;
}
开发者ID:Joel397,项目名称:Ongoing_work_files,代码行数:31,代码来源:ecutils.cpp


示例8: m_platform

TestSearchEngine::TestSearchEngine(unique_ptr<::search::SearchQueryFactory> factory,
                                   Engine::Params const & params)
  : m_platform(GetPlatform())
  , m_infoGetter(storage::CountryInfoReader::CreateCountryInfoReader(m_platform))
  , m_engine(*this, GetDefaultCategories(), *m_infoGetter, move(factory), params)
{
}
开发者ID:65apps,项目名称:omim,代码行数:7,代码来源:test_search_engine.cpp


示例9: m_platform

TestSearchEngine::TestSearchEngine(std::string const & locale)
    : m_platform(GetPlatform()),
      m_engine(this, m_platform.GetReader(SEARCH_CATEGORIES_FILE_NAME),
               m_platform.GetReader(PACKED_POLYGONS_FILE), m_platform.GetReader(COUNTRIES_FILE),
               locale, make_unique<TestSearchQueryFactory>())
{
}
开发者ID:morsya,项目名称:omim,代码行数:7,代码来源:test_search_engine.cpp


示例10: Load

  void Load()
  {
    LOG(LDEBUG, ("Reading of classificator started"));

    Platform & p = GetPlatform();

    MapStyle const originMapStyle = GetStyleReader().GetCurrentStyle();

    for (size_t i = 0; i < MapStyleCount; ++i)
    {
      MapStyle const mapStyle = static_cast<MapStyle>(i);
      // Read the merged style only if it was requested.
      if (mapStyle != MapStyleMerged || originMapStyle == MapStyleMerged)
      {
        GetStyleReader().SetCurrentStyle(mapStyle);
        ReadCommon(p.GetReader("classificator.txt"),
                   p.GetReader("types.txt"));

        drule::LoadRules();
      }
    }

    GetStyleReader().SetCurrentStyle(originMapStyle);

    LOG(LDEBUG, ("Reading of classificator finished"));
  }
开发者ID:65apps,项目名称:omim,代码行数:26,代码来源:classificator_loader.cpp


示例11: primaryRC

  void Framework::InitRenderPolicy(bool needApiPin, m2::PointD const & apiPinPoint,
                                   bool needMyLoc, m2::PointD const & myLocPoint)
  {
    shared_ptr<RenderContext> primaryRC(new RenderContext());
    graphics::ResourceManager::Params rmParams;
    rmParams.m_texFormat = graphics::Data4Bpp;
    rmParams.m_texRtFormat = graphics::Data4Bpp;
    rmParams.m_videoMemoryLimit = GetPlatform().VideoMemoryLimit();

    RenderPolicy::Params rpParams;

    rpParams.m_videoTimer = &m_timer;
    rpParams.m_useDefaultFB = true;
    rpParams.m_rmParams = rmParams;
    rpParams.m_primaryRC = primaryRC;
    rpParams.m_density = graphics::EDensityMDPI;
    rpParams.m_skinName = "basic.skn";
    rpParams.m_screenWidth = m_width;
    rpParams.m_screenHeight = m_height;

    YopmeRP * rp = new YopmeRP(rpParams);
    m_framework.SetRenderPolicy(rp);
    m_framework.InitGuiSubsystem();

    rp->SetDrawingApiPin(needApiPin, m_framework.GtoP(apiPinPoint));
    rp->SetDrawingMyLocation(needMyLoc, m_framework.GtoP(myLocPoint));
  }
开发者ID:alexz89ua,项目名称:omim,代码行数:27,代码来源:Framework.cpp


示例12: Java_com_mapswithme_maps_uber_Uber_nativeRequestUberProducts

JNIEXPORT void JNICALL Java_com_mapswithme_maps_uber_Uber_nativeRequestUberProducts(
    JNIEnv * env, jclass clazz, jdouble srcLat, jdouble srcLon, jdouble dstLat, jdouble dstLon)
{
  PrepareClassRefs(env);

  ms::LatLon const from(srcLat, srcLon);
  ms::LatLon const to(dstLat, dstLon);

  g_lastRequestId = g_framework->RequestUberProducts(
      from, to, [](vector<uber::Product> const & products, uint64_t const requestId) {
        GetPlatform().RunOnGuiThread([=]() {

          if (g_lastRequestId != requestId)
            return;

          JNIEnv * env = jni::GetEnv();

          auto uberProducts = jni::ToJavaArray(
              env, g_productClass, products, [](JNIEnv * env, uber::Product const & item) {
                return env->NewObject(
                    g_productClass, g_productConstructor, jni::ToJavaString(env, item.m_productId),
                    jni::ToJavaString(env, item.m_name), jni::ToJavaString(env, item.m_time),
                    jni::ToJavaString(env, item.m_price));
              });

          jobject const routingControllerInstance =
              env->CallStaticObjectMethod(g_routingControllerClass, g_routingControllerGetMethod);
          env->CallVoidMethod(routingControllerInstance, g_uberInfoCallbackMethod,
                              env->NewObject(g_uberInfoClass, g_uberInfoConstructor, uberProducts));
        });
      });
}
开发者ID:bykoianko,项目名称:omim,代码行数:32,代码来源:Uber.cpp


示例13: watch

 S32 watch(Thread::MessageQueue& messageQueue)
 {
    worker = new Thread(MakeDelegate(&work));
    worker->start();
    while(worker->isRunning())
       GetPlatform()->sleep(1);
    return 0;
 }
开发者ID:justindujardin,项目名称:ACL,代码行数:8,代码来源:threadTests.cpp


示例14: OpenRecord

GMPErr
OpenRecord(const char* aName,
           uint32_t aNameLength,
           GMPRecord** aOutRecord,
           GMPRecordClient* aClient)
{
  return GetPlatform()->createrecord(aName, aNameLength, aOutRecord, aClient);
}
开发者ID:Acidburn0zzz,项目名称:tor-browser,代码行数:8,代码来源:ClearKeyStorage.cpp


示例15: GetPlatform

WritableDirChanger::~WritableDirChanger()
{
  settings::Clear();
  Platform & platform = GetPlatform();
  string const writableDirForTest = platform.WritableDir();
  platform.SetWritableDirForTests(m_writableDirBeforeTest);
  platform.RmDirRecursively(writableDirForTest);
}
开发者ID:tsd-kikkawa,项目名称:omim,代码行数:8,代码来源:write_dir_changer.cpp


示例16: memset

CCpuUsage::CCpuUsage()
{
	m_bFirstTime = true;
	m_lnOldValue = 0;
	memset(&m_OldPerfTime100nSec, 0, sizeof(m_OldPerfTime100nSec));

	m_nPlatform = GetPlatform();
}
开发者ID:joshball,项目名称:locate32-cogit.net,代码行数:8,代码来源:CpuUsage.cpp


示例17: IsScaleAllowableIn3d

bool IsScaleAllowableIn3d(int scale)
{
  int minScale = scales::GetMinAllowableIn3dScale();
  if (df::VisualParams::Instance().GetVisualScale() <= 1.0)
    --minScale;
  if (GetPlatform().IsTablet())
    ++minScale;
  return scale >= minScale;
}
开发者ID:Mapotempo,项目名称:omim,代码行数:9,代码来源:screen_operations.cpp


示例18: PlatformMain

int PlatformMain( void ){
	pPlatform = GetPlatform();	
	pPlatform->ShowDebugConsole();
	pPlatform->Create(L"Hello", 4, 2, 640, 640, 24, 8, 24, 8, CPlatform::MS_0);	
	Setup(pPlatform);
	while(!pPlatform->IsQuitting())
		MainLoop(pPlatform);
	CleanUp();
	return 0;
}
开发者ID:wip-,项目名称:opengl_samples,代码行数:10,代码来源:cubemap.cpp


示例19: GetPlatform

void BackendRenderer::InitGLDependentResource()
{
  dp::TextureManager::Params params;
  params.m_resPrefix = VisualParams::Instance().GetResourcePostfix();
  params.m_glyphMngParams.m_uniBlocks = "unicode_blocks.txt";
  params.m_glyphMngParams.m_whitelist = "fonts_whitelist.txt";
  params.m_glyphMngParams.m_blacklist = "fonts_blacklist.txt";
  GetPlatform().GetFontNames(params.m_glyphMngParams.m_fonts);

  m_textures->Init(params);
}
开发者ID:morsya,项目名称:omim,代码行数:11,代码来源:backend_renderer.cpp


示例20: PlatformMain

int PlatformMain( void ){
	pPlatform = GetPlatform();	
	pPlatform->ShowDebugConsole();
	pPlatform->Create(L"transform example, phasersonkill.com", 4, 2, 640, 640, 24, 8, 24, 8, CPlatform::MS_0);
	Setup(pPlatform);

	while(!pPlatform->IsQuitting())
		MainLoop(pPlatform);
	CleanUp();
	return 0;
}
开发者ID:welford,项目名称:opengl_samples,代码行数:11,代码来源:transform_test.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetPlatformNumberOfSockets函数代码示例发布时间:2022-05-30
下一篇:
C++ GetPlainName函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap