INTRODUCTION Overview Download and Install Quick Start Documentation Publications NONFRAMEWORK CODE Driver Interfaces Drivers Libraries Utilities FRAMEWORK CODE Interfaces Components Libraries Utilities Full Software Listings DEVELOPER Tutorials Examples Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
bufferedconsumerImpl.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2009 Alex Brooks, Alexei Makarenko, Tobias Kaupp 00005 * 00006 * This copy of Orca is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef ORCAIFACEIMPL_BUFFERED_CONSUMER_IMPL_H 00012 #define ORCAIFACEIMPL_BUFFERED_CONSUMER_IMPL_H 00013 00014 #include <gbxsickacfr/gbxiceutilacfr/buffer.h> 00015 #include <orcaifaceimpl/consumerImpl.h> 00016 00017 namespace orcaifaceimpl 00018 { 00019 00024 template<class ProviderType, 00025 class ConsumerType, 00026 class ObjectType, 00027 class ConsumerTypeIType=ConsumerTypeI<ConsumerType,ObjectType> > 00028 class BufferedConsumerImpl : 00029 public ConsumerImpl<ProviderType,ConsumerType,ObjectType,ConsumerTypeIType> 00030 { 00031 public: 00033 BufferedConsumerImpl( int depth, gbxiceutilacfr::BufferType type, const orcaice::Context &context ) 00034 : ConsumerImpl<ProviderType,ConsumerType,ObjectType,ConsumerTypeIType>(context), 00035 buffer_(depth,type) {} 00036 00038 gbxiceutilacfr::Buffer<ObjectType> &buffer() { return buffer_; } 00039 00041 virtual void dataEvent( const ObjectType& data ) { buffer_.push( data ); } 00042 00043 private: 00044 gbxiceutilacfr::Buffer<ObjectType> buffer_; 00045 }; 00046 00047 } // namespace 00048 00049 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)