本文整理汇总了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));
}
示例2: GetInstance
static
Recorder* GetInstance()
{
if (!instance)
{
instance.reset(new RASP24Recorder);
}
return instance.get();
}
示例3: objectAdded
void objectAdded(Object* object)
{
if (currentStepObject) {
return;
}
currentStepObject.reset(object->clone());
currentStepRecorded = false;
}
示例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);
}
示例5: set_disabled
bool set_disabled(SetDisabledRequest &request, SetDisabledResponse &response)
{
disabled = request.disabled;
if (disabled)
{
c3trajectory.reset();
}
return true;
}
示例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 ) ) );
}
}
示例7:
TranslatorRoster*
TranslatorRoster::default_roster()
{
static boost::scoped_ptr<TranslatorRoster> roster;
if(! roster)
roster.reset(new TranslatorRoster);
return roster.get();
}
示例8: cleanup
static void cleanup(void)
{
mgr = NULL;
staticScene = NULL;
dynamicScene = NULL;
win = NULL;
dynamicVp = NULL;
spSimpleFBO.reset();
}
示例9: handle_stop
virtual void handle_stop()
{
if (acceptor_ && acceptor_->is_open())
{
acceptor_->close();
std::cout << "Server stopped" << std::endl;
}
acceptor_.reset();
}
示例10: cleanup
static void cleanup(void)
{
mgr = nullptr;
staticScene = nullptr;
dynamicScene = nullptr;
win = nullptr;
dynamicVp = nullptr;
spSimpleFBO.reset();
}
示例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 ) );
}
示例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();
}
示例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====================="
, "=====================" ) );
}
示例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();
}
示例15: WaitForSynchronize
void InputEventsWestonTest::WaitForSynchronize()
{
synchronized = false;
syncCallback.reset(new xw::Callback(clientLibrary,
display->Sync(),
boost::bind(&InputEventsWestonTest::Synchronize,
this)));
while (!synchronized)
loop->Dispatch();
}