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


C++ scoped_ptr::reset方法代码示例

本文整理汇总了C++中boost::scoped_ptr::reset方法的典型用法代码示例。如果您正苦于以下问题:C++ scoped_ptr::reset方法的具体用法?C++ scoped_ptr::reset怎么用?C++ scoped_ptr::reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在boost::scoped_ptr的用法示例。


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

示例1: SetUp

    virtual void SetUp()
    {
        const size_t usableBlocksPerPage = (pageSize / blockSize) - 1;
        const size_t availablePages = maxSize / pageSize;
        allocations = availablePages * usableBlocksPerPage;

        allocator.reset(new SmallObjectAllocator(PageManager::create(maxSize, pageSize), blockSize));
    }
开发者ID:madrenegade,项目名称:PGameStudio,代码行数:8,代码来源:SmallObjectAllocatorTest.cpp

示例2: GetInstance

	static
	Recorder* GetInstance() 
	{
		if (!instance) 
		{
			instance.reset(new RASP24Recorder);
    	}
		return instance.get();
	}
开发者ID:chinjao,项目名称:ros_src,代码行数:9,代码来源:RASP24Recorder.hpp

示例3: objectAdded

	void objectAdded(Object* object)
	{
		if (currentStepObject) {
			return;
		}

		currentStepObject.reset(object->clone());
		currentStepRecorded = false;
	}
开发者ID:simonlmn,项目名称:actracktive,代码行数:9,代码来源:GridTransformerCalibrationUI.cpp

示例4: load

 void load(
     Archive & ar, 
     boost::scoped_ptr< T > & t, 
     const unsigned int /* version */
 ){
     T* r;
     ar >> boost::serialization::make_nvp("scoped_ptr", r);
     t.reset(r); 
 }
开发者ID:ARK1988,项目名称:nupic.core,代码行数:9,代码来源:scoped_ptr.hpp

示例5: set_disabled

 bool set_disabled(SetDisabledRequest &request, SetDisabledResponse &response)
 {
   disabled = request.disabled;
   if (disabled)
   {
     c3trajectory.reset();
   }
   return true;
 }
开发者ID:uf-mil,项目名称:SubjuGator,代码行数:9,代码来源:node.cpp

示例6: start

	/** component start method, starts thread */
	virtual void start()
	{
		if ( !m_running )
		{
			m_bStop = false;
			m_running = true;
			m_pThread.reset( new boost::thread( boost::bind( &KeyboardEvent::mainLoop, this ) ) );
		}
	}
开发者ID:Killerregenwurm,项目名称:utcomponents,代码行数:10,代码来源:KeyboardEvent.cpp

示例7:

TranslatorRoster*
TranslatorRoster::default_roster()
{
	static boost::scoped_ptr<TranslatorRoster> roster;
	if(! roster)
		roster.reset(new TranslatorRoster);

	return roster.get();
}
开发者ID:snori,项目名称:ntk,代码行数:9,代码来源:translatorroster.cpp

示例8: cleanup

static void cleanup(void)
{
    mgr   = NULL;
    staticScene = NULL;
    dynamicScene = NULL;
    win   = NULL;
    dynamicVp = NULL;
    spSimpleFBO.reset();
}
开发者ID:marcusl,项目名称:OpenSG,代码行数:9,代码来源:dyndrawing1.cpp

示例9: handle_stop

 virtual void handle_stop()
 {
     if (acceptor_ && acceptor_->is_open())
     {
         acceptor_->close();
         std::cout << "Server stopped" << std::endl;
     }
     acceptor_.reset();
 }
开发者ID:mrZreat,项目名称:AsioTest,代码行数:9,代码来源:echo_server.cpp

示例10: cleanup

static void cleanup(void)
{
    mgr   = nullptr;
    staticScene = nullptr;
    dynamicScene = nullptr;
    win   = nullptr;
    dynamicVp = nullptr;
    spSimpleFBO.reset();
}
开发者ID:jondo2010,项目名称:OpenSG,代码行数:9,代码来源:dyndrawing1.cpp

示例11: Graphics

	CTextInputWindow()
		: FK2DEngine::CFKWindow( 300, 200, false )
	{
		SetCaption( L"自由骑士笃志引擎:字符输入测试" );
		SetBackgroudColor( FK2DEngine::CColor::YELLOW );
		// 设置字体
		m_pFont.reset( new FK2DEngine::CFont( Graphics(), L"Sans MT 936_S60", 20 ) );

		for( unsigned int nIndex = 0; nIndex < LengthOf( m_pTextFields ); ++nIndex )
		{
			m_pTextFields[nIndex].reset( new CTextField( *this, *m_pFont, 50, 30 + nIndex * 50 ) );
		}
		// 开动计时器
		m_Timer.Play();
		// 隐藏真实鼠标,自定虚拟鼠标
		::ShowCursor( FALSE );
		// 设置自己鼠标图片
		m_pCursor.reset( new FK2DEngine::CImage( Graphics(), FK2DEngine::ShareResourcePrefix() + L"rc/media/Cursor.png", false ) );
	}
开发者ID:adan830,项目名称:FKEngine,代码行数:19,代码来源:Main.cpp

示例12: configure

	/*! @brief configure the detector state
	 *
	 * The configure method is called once when the ECTO cell is launched,
	 * and is designed to initialise the detector state and load models,
	 * parameters, etc.
	 *
	 * @param params the parameters made available through the config file and
	 * python bindings
	 * @param inputs for initializing inputs, if necessary
	 * @param outputs for initializing outputs, if necessary
	 */
	void configure(const tendrils& params, const tendrils& inputs,
			const tendrils& outputs)
	{

		std::cout << "MODEL: " << *model_file_ << std::endl;
		// create the model object and deserialize it
		FileStorageModel model;
		model.deserialize(*model_file_);

		// create the visualizer
		visualizer_.reset(new Visualize(model.name()));

		// create the PartsBasedDetector and distribute the model parameters
		detector_.reset(new PartsBasedDetector<double>);
		detector_->distributeModel(model);

		// set the model_name
		model_name_ = model.name();
	}
开发者ID:biometrics,项目名称:PartsBasedDetector,代码行数:30,代码来源:detect.cpp

示例13: MainClass

  MainClass(int argc, const char *argv[])
      :argv_(argv)
  {
    rg_.reset(new RegistryPO(argc,argv));
    util::initLogger ( argc, argv );
    FORCELINFO ( argv[0] << " starts!" );
    FORCELINFO ( rg_->dump ( "CONFIG parameters:\n====================="
                             , "=====================" ) );

  }
开发者ID:aurelienwaite,项目名称:ucam-smt,代码行数:10,代码来源:main.hpp

示例14: SetUp

void InputEventsWestonTest::SetUp()
{
  WestonTest::SetUp();
  
  clientLibrary.Load();
  eglLibrary.Load();
  xkbCommonLibrary.Load();
  
  xkbContext.reset(CXKBKeymap::CreateXKBContext(xkbCommonLibrary),
                   boost::bind(&IDllXKBCommon::xkb_context_unref,
                               &xkbCommonLibrary, _1));
  keymap.reset(new CXKBKeymap(
                 xkbCommonLibrary, 
                 CXKBKeymap::CreateXKBKeymapFromNames(xkbCommonLibrary,
                                                      xkbContext.get(),
                                                      "evdev",
                                                      "pc105",
                                                      "us",
                                                      "",
                                                      "")));
  
  display.reset(new xw::Display(clientLibrary));
  queue.reset(CreateEventQueue());
  registry.reset(new xw::Registry(clientLibrary,
                                  display->GetWlDisplay(),
                                  *this));
  loop.reset(new xwe::Loop(listener, *queue));

  /* Wait for the seat, shell, compositor to appear */
  WaitForSynchronize();
  
  ASSERT_TRUE(input.get() != NULL);
  ASSERT_TRUE(compositor.get() != NULL);
  ASSERT_TRUE(shell.get() != NULL);
  ASSERT_TRUE(xbmcWayland.get() != NULL);
  
  /* Wait for input devices to appear etc */
  WaitForSynchronize();
  
  surface.reset(new xw::Surface(clientLibrary,
                                compositor->CreateSurface()));
  shellSurface.reset(new xw::ShellSurface(clientLibrary,
                                          shell->CreateShellSurface(
                                            surface->GetWlSurface())));
  openGLSurface.reset(new xw::OpenGLSurface(eglLibrary,
                                            surface->GetWlSurface(),
                                            SurfaceWidth,
                                            SurfaceHeight));

  wl_shell_surface_set_toplevel(shellSurface->GetWlShellSurface());
  surface->Commit();
}
开发者ID:7orlum,项目名称:xbmc,代码行数:52,代码来源:TestXBMCWaylandInputAcceptance.cpp

示例15: WaitForSynchronize

void InputEventsWestonTest::WaitForSynchronize()
{
  synchronized = false;
  syncCallback.reset(new xw::Callback(clientLibrary,
                                      display->Sync(),
                                      boost::bind(&InputEventsWestonTest::Synchronize,
                                                  this)));
  
  while (!synchronized)
    loop->Dispatch();
}
开发者ID:7orlum,项目名称:xbmc,代码行数:11,代码来源:TestXBMCWaylandInputAcceptance.cpp


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