40 #ifndef ORO_CORELIB_BUFFER_UNSYNC_HPP 41 #define ORO_CORELIB_BUFFER_UNSYNC_HPP 108 if (
cap == (size_type)
buf.size() ) {
120 buf.push_back( item );
124 size_type
Push(
const std::vector<value_t>& items)
126 typename std::vector<value_t>::const_iterator itl( items.begin() );
132 itl = items.begin() + ( items.size() -
cap );
133 }
else if (
mcircular && (size_type)(
buf.size() + items.size()) >
cap) {
135 assert( (size_type)items.size() <
cap );
136 while ( (size_type)(
buf.size() + items.size()) >
cap )
143 while ( ((size_type)
buf.size() !=
cap) && (itl != items.end()) ) {
144 buf.push_back( *itl );
148 size_type written = (itl - items.begin());
165 size_type
Pop(std::vector<value_t>& items )
169 while ( !
buf.empty() ) {
170 items.push_back(
buf.front() );
194 assert(item == &
lastSample &&
"Wrong pointer given back to buffer");
214 return (size_type)
buf.size() ==
cap;
231 #endif // BUFFERSIMPLE_HPP value_t * PopWithoutRelease()
FlowStatus Pop(reference_t item)
BufferUnSync(size_type size, const Options &options=Options())
BufferInterface< T >::size_type size_type
BufferInterface< T >::param_t param_t
boost::call_traits< T >::reference reference_t
BufferUnSync(size_type size, param_t initial_value, const Options &options=Options())
size_type capacity() const
boost::call_traits< T >::param_type param_t
BufferBase::Options Options
BufferInterface< T >::reference_t reference_t
size_type Pop(std::vector< value_t > &items)
BufferBase::size_type size_type
std::deque< value_t > buf
virtual bool data_sample(param_t sample, bool reset=true)
size_type Push(const std::vector< value_t > &items)
virtual value_t data_sample() const
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
virtual size_type dropped() const
void Release(value_t *item)