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


C++ shared_ptr::get方法代码示例

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


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

示例1: add_item_to_feed

void rss_parser::add_item_to_feed(std::tr1::shared_ptr<rss_feed> feed, std::tr1::shared_ptr<rss_item> item) {
	// only add item to feed if it isn't on the ignore list or if there is no ignore list
	if (!ign || !ign->matches(item.get())) {
		feed->add_item(item);
		LOG(LOG_INFO, "rss_parser::parse: added article title = `%s' link = `%s' ign = %p", item->title().c_str(), item->link().c_str(), ign);
	} else {
		LOG(LOG_INFO, "rss_parser::parse: ignored article title = `%s' link = `%s'", item->title().c_str(), item->link().c_str());
	}
}
开发者ID:curl-zz,项目名称:newsbeuter,代码行数:9,代码来源:rss_parser.cpp

示例2: pollOSC

void App::pollOSC()
{
    if (0 == osc_receiver_.get())
        return;
    if (osc_receiver_.get()->isRunning())
    {
        std::vector<tempi::Message> messages = osc_receiver_.get()->poll();
        std::vector<tempi::Message>::iterator iter;
        for (iter = messages.begin(); iter != messages.end(); ++iter)
        {
            tempi::Message msg = (*iter);
            if (msg.indexMatchesType(0, tempi::STRING))
                if (! handleOscMessage(msg))
                    std::cout << "Unhandled OSC message: " << msg << std::endl;
                else if (verbose_)
                    std::cout << "Handled OSC message: " << msg << std::endl;
        }
    }
}
开发者ID:aalex,项目名称:ubuntu-tempi,代码行数:19,代码来源:main.cpp

示例3: push

    inline Value push(std::tr1::shared_ptr<T> newProp)
    {
      if (dynamic_cast<NumericProperty*>(newProp.get()))
	{
	  _numericProperties.push_back(Value(newProp));
	  return _numericProperties.back();
	}    
    
      _namedProperties.push_back(Value(newProp));
      return _namedProperties.back();
    }
开发者ID:armando-2011,项目名称:DynamO,代码行数:11,代码来源:property.hpp

示例4: GetMainThreadId

DWORD GetMainThreadId(void) 
{
	const std::tr1::shared_ptr<void> hThreadSnapshot(CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0), CloseHandle);
	if (hThreadSnapshot.get() == INVALID_HANDLE_VALUE) 
	{
		add_log("GetMainThreadId failed");
		return 0;
	}
	THREADENTRY32 tEntry;
	tEntry.dwSize = sizeof(THREADENTRY32);
	DWORD result = 0;
	DWORD currentPID = GetCurrentProcessId();
	for (BOOL success = Thread32First(hThreadSnapshot.get(), &tEntry);
		!result && success && GetLastError() != ERROR_NO_MORE_FILES;
		success = Thread32Next(hThreadSnapshot.get(), &tEntry))
	{
		if (tEntry.th32OwnerProcessID == currentPID) 
		{
			result = tEntry.th32ThreadID;
		}
	}
	return result;
}
开发者ID:caellach,项目名称:OGL-3DVision-Wrapper,代码行数:23,代码来源:opengl32.cpp

示例5: startOSC

bool App::startOSC()
{
    // starts OSC
    if (osc_recv_port_ == 0)
    {
        std::cout << "OSC receiving disabled." << std::endl;
        return false;
    }
    else
    {
        osc_receiver_.reset(new tempi::osc::OscReceiver(osc_recv_port_));
        std::cout << "Receive OSC from " << (*osc_receiver_.get()) << std::endl;
    }
    return true;
}
开发者ID:aalex,项目名称:ubuntu-tempi,代码行数:15,代码来源:main.cpp

示例6: hasValue

 bool hasValue() const
 {
     std::tr1::try_mutex::scoped_try_lock lock(*mutex);
     return lock && result->get();
 }
开发者ID:ChicoTeam,项目名称:gosu,代码行数:5,代码来源:Async.hpp

示例7: Sub

		struct Sub {Object *_o; Sub(Object *o) :_o(o) {} bool operator ()(const std::tr1::shared_ptr<Object > &a) {return _o == a.get(); } };
开发者ID:rasim-valiullin,项目名称:d512388b-9b91-45f9-8f88-b6d4e252c270,代码行数:1,代码来源:Game.cpp

示例8: operator

		struct Sub {bool operator ()(const std::tr1::shared_ptr<Object > &a) {return dynamic_cast<Target *>(a.get()) != 0; } };
开发者ID:rasim-valiullin,项目名称:d512388b-9b91-45f9-8f88-b6d4e252c270,代码行数:1,代码来源:Game.cpp


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