本文整理汇总了C++中ptr_type类的典型用法代码示例。如果您正苦于以下问题:C++ ptr_type类的具体用法?C++ ptr_type怎么用?C++ ptr_type使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ptr_type类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: if
/*protected virtual */void ASDDeviceTransceiver::update(ptr_type device)
{
DataRec data;
tgs::TGSError error;
boost::upgrade_lock<boost::shared_mutex> ulock(_mutex);
data = _data;
if ((error = device->getFrequencySender(&data.frequencySender)) == tgs::TGSERROR_NO_RESULT) {
data.frequencySender = -1;
}
else if (error != tgs::TGSERROR_OK) {
artsatd::getInstance().log(LOG_WARNING, "TGSTransceiverInterface getFrequencySender error [%s]", error.print().c_str());
}
if ((error = device->getFrequencyReceiver(&data.frequencyReceiver)) == tgs::TGSERROR_NO_RESULT) {
data.frequencyReceiver = -1;
}
else if (error != tgs::TGSERROR_OK) {
artsatd::getInstance().log(LOG_WARNING, "TGSTransceiverInterface getFrequencyReceiver error [%s]", error.print().c_str());
}
if (data.frequencySender != _data.frequencySender || data.frequencyReceiver != _data.frequencyReceiver) {
boost::upgrade_to_unique_lock<boost::shared_mutex> wlock(ulock);
_data = data;
}
return;
}
开发者ID:ARTSAT,项目名称:ground_station,代码行数:25,代码来源:ASDDeviceTransceiver.cpp
示例2: operator
void operator()(ptr_type p)
{
if (_prev)
{
_prev->next(p);
p->previous(_prev);
}
_prev = p;
}
开发者ID:scholli,项目名称:gpucast,代码行数:9,代码来源:previous_next_set.hpp
示例3: get_checked_disp_
inline
/* static */
object_helper::
ptr_type
object_helper::
get_checked_disp_(
ptr_type disp,
char const* message /* = NULL */
) /* const */
{
check_disp_(disp.get(), message);
return disp;
}
开发者ID:synesissoftware,项目名称:VOLE,代码行数:14,代码来源:object.hpp
示例4: offset
static ptr_type offset(ptr_type ptr, index_type i)
{
switch (ptr.format())
{
case array: return ptr_type(ptr.template as<array>() + i);
case interleaved_complex:
return ptr_type(ptr.template as<interleaved_complex>() + 2*i);
case split_complex:
{
std::pair<T*,T*> p = ptr.template as<split_complex>();
return ptr_type(p.first + i, p.second + i);
}
default: assert(0);
}
}
开发者ID:fsheikh,项目名称:openvsip,代码行数:15,代码来源:traits.hpp
示例5: ulock
/*protected virtual */void ASDDeviceRotator::update(ptr_type device)
{
DataRec data;
tgs::TGSError error;
boost::upgrade_lock<boost::shared_mutex> ulock(_mutex);
data = _data;
if ((error = device->getAngle(&data.azimuth, &data.elevation)) != tgs::TGSERROR_OK) {
artsatd::getInstance().log(LOG_WARNING, "TGSRotatorInterface getAngle error [%s]", error.print().c_str());
}
if (data.azimuth != _data.azimuth || data.elevation != _data.elevation) {
boost::upgrade_to_unique_lock<boost::shared_mutex> wlock(ulock);
_data = data;
}
return;
}
开发者ID:ARTSAT,项目名称:ground_station,代码行数:16,代码来源:ASDDeviceRotator.cpp
示例6: put
static void put(ptr_type ptr, index_type i, value_type v)
{
switch (ptr.format())
{
case array:
*ptr.template as<array>() = v;
break;
case interleaved_complex:
*reinterpret_cast<value_type*>(ptr.template as<interleaved_complex>()) = v;
break;
case split_complex:
{
std::pair<T const*,T const*> p = ptr.template as<split_complex>();
p.first = v.real();
p.second = v.imag();
break;
}
default: assert(0);
}
}
开发者ID:fsheikh,项目名称:openvsip,代码行数:20,代码来源:traits.hpp
示例7:
CNode::CNode( ptr_type first, ptr_type second ) {
left() = first;
right() = second;
weight_m = first->getWeight() + second->getWeight();
}
开发者ID:metopa,项目名称:BWT-RLE-Huffman,代码行数:5,代码来源:CHuffmanTree.cpp
示例8:
//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
void
XMLConfigurationElement::addChild(ptr_type _pChild)
{
m_children.insert(children_pair_type(_pChild->getName(), _pChild));
}
开发者ID:RobertTheMagnificent,项目名称:zen-core,代码行数:6,代码来源:XMLConfigurationElement.cpp
示例9: push
void push(ptr_type& vec) {
if(var.which() != empty_t)
vec->push_back(*this);
}
开发者ID:khuck,项目名称:hpx_script,代码行数:4,代码来源:xlua.hpp
示例10: catch
promise_base( std::allocator_arg_t, Allocator alloc) {
typedef detail::shared_state_object< R, Allocator > object_type;
typedef std::allocator_traits< typename object_type::allocator_type > traits_type;
typedef pointer_traits< typename traits_type::pointer > ptrait_type;
typename object_type::allocator_type a{ alloc };
typename traits_type::pointer ptr{ traits_type::allocate( a, 1) };
typename ptrait_type::element_type* p = ptrait_type::to_address(ptr);
try {
traits_type::construct( a, p, a);
} catch (...) {
traits_type::deallocate( a, ptr, 1);
throw;
}
future_.reset(p);
}
开发者ID:AbhinavJain13,项目名称:turicreate,代码行数:16,代码来源:promise.hpp
示例11: packaged_task
explicit packaged_task( std::allocator_arg_t, Allocator const& alloc, Fn && fn) {
typedef detail::task_object<
typename std::decay< Fn >::type, Allocator, R, Args ...
> object_type;
typedef std::allocator_traits<
typename object_type::allocator_type
> traits_type;
typedef pointer_traits< typename traits_type::pointer > ptrait_type;
typename object_type::allocator_type a{ alloc };
typename traits_type::pointer ptr{ traits_type::allocate( a, 1) };
typename ptrait_type::element_type* p = boost::to_address(ptr);
try {
traits_type::construct( a, p, a, std::forward< Fn >( fn) );
} catch (...) {
traits_type::deallocate( a, ptr, 1);
throw;
}
task_.reset(p);
}
开发者ID:PopcornTimeTV,项目名称:PopcornTorrent,代码行数:20,代码来源:packaged_task.hpp
示例12: OnDestroy
void OnDestroy(void) {
if (ptr)ptr->OnDestroy();
}
开发者ID:modulexcite,项目名称:Far3bis-googlecode,代码行数:3,代码来源:smart_ptr.hpp
示例13: swap
void swap( packaged_task & other) noexcept {
std::swap( obtained_, other.obtained_);
task_.swap( other.task_);
}
开发者ID:PopcornTimeTV,项目名称:PopcornTorrent,代码行数:4,代码来源:packaged_task.hpp
示例14:
~packaged_task() {
if ( task_) {
task_->owner_destroyed();
}
}
开发者ID:PopcornTimeTV,项目名称:PopcornTorrent,代码行数:5,代码来源:packaged_task.hpp
示例15: operator
void operator()( Args ... args) {
if ( BOOST_UNLIKELY( ! valid() ) ) {
throw packaged_task_uninitialized{};
}
task_->run( std::forward< Args >( args) ... );
}
开发者ID:PopcornTimeTV,项目名称:PopcornTorrent,代码行数:6,代码来源:packaged_task.hpp
示例16: get_ptr
Base* get_ptr() const {
return ptr_.get();
}
开发者ID:bolero-MURAKAMI,项目名称:Sprig,代码行数:3,代码来源:polymorphic_holder.hpp
示例17: valid
bool valid() const noexcept {
return nullptr != task_.get();
}
开发者ID:PopcornTimeTV,项目名称:PopcornTorrent,代码行数:3,代码来源:packaged_task.hpp
示例18:
polymorphic_holder& operator=(Derived const& rhs) {
ptr_.reset(boost::make_shared<Derived>(rhs));
return *this;
}
开发者ID:bolero-MURAKAMI,项目名称:Sprig,代码行数:4,代码来源:polymorphic_holder.hpp
示例19:
~promise_base() {
if ( future_) {
future_->owner_destroyed();
}
}
开发者ID:AbhinavJain13,项目名称:turicreate,代码行数:5,代码来源:promise.hpp
示例20: set_exception
void set_exception( std::exception_ptr p) {
if ( BOOST_UNLIKELY( ! future_) ) {
throw promise_uninitialized{};
}
future_->set_exception( p);
}
开发者ID:AbhinavJain13,项目名称:turicreate,代码行数:6,代码来源:promise.hpp
注:本文中的ptr_type类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论