本文整理汇总了C++中boost::circular_buffer::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ circular_buffer::empty方法的具体用法?C++ circular_buffer::empty怎么用?C++ circular_buffer::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boost::circular_buffer
的用法示例。
在下文中一共展示了circular_buffer::empty方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: take
void take() {
while(flag) {
unique_lock<mutex> locker(m_mutex);
while(Q.empty())
full.wait(locker);
if(flag) {
assert(!Q.empty());
cout << "# " << Q.front() <<endl;
Q.pop_front();
empty.notify_all();
}
}
}
示例2: while
boost::shared_ptr< const MapsBuffer::MapsRgb >
MapsBuffer::getFront(bool print)
{
boost::shared_ptr< const MapsBuffer::MapsRgb > depth_rgb;
{
boost::mutex::scoped_lock buff_lock (bmutex_);
while (buffer_.empty ())
{
if (is_done)
break;
{
boost::mutex::scoped_lock io_lock (io_mutex);
//std::cout << "No data in buffer_ yet or buffer is empty." << std::endl;
}
buff_empty_.wait (buff_lock);
}
depth_rgb = buffer_.front ();
buffer_.pop_front ();
}
if(print)
PCL_INFO("%d maps left in the buffer...\n", buffer_.size ());
return (depth_rgb);
}
示例3: downOne
QList<QConsoleWidgetCommand> downOne(){
if(commandBuffers.empty()){return QList<QConsoleWidgetCommand>();}
--currentIndex;
if( currentIndex<size() && currentIndex>=0){
return commandBuffers[currentIndex ];
}else{
currentIndex=0;
}
return commandBuffers[0];
}
示例4: upOne
QList<QConsoleWidgetCommand> upOne(){
if(commandBuffers.empty()){return QList<QConsoleWidgetCommand>();}
++currentIndex;
if( currentIndex< size() && currentIndex>=0){
return commandBuffers[currentIndex ];
}else{
currentIndex= size();
}
return *(commandBuffers.rbegin());
}
示例5: longClick
/*! @brief Returns true if the last press was a long one
@param times a circular buffer of the click times
@param durations a circular buffer of the click durations
@param previoustime the previous time that this event has occured
*/
bool BehaviourProvider::longClick(const boost::circular_buffer<float>& times, const boost::circular_buffer<float>& durations, float& previoustime)
{
if (times.empty())
return false;
else if (previoustime == times.back())
return false;
else if (durations.back() <= 800)
return false;
else
{
previoustime = m_current_time;
return true;
}
}
示例6:
pcl::PointCloud<pcl::PointXYZRGBA>::ConstPtr
PCDBuffer::getFront ()
{
pcl::PointCloud<pcl::PointXYZRGBA>::ConstPtr cloud;
{
boost::mutex::scoped_lock buff_lock (bmutex_);
while (buffer_.empty ())
{
if (is_done)
break;
{
boost::mutex::scoped_lock io_lock (io_mutex);
//std::cout << "No data in buffer_ yet or buffer is empty." << std::endl;
}
buff_empty_.wait (buff_lock);
}
cloud = buffer_.front ();
buffer_.pop_front ();
}
return (cloud);
}