util/queue/I_Queue.h

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------------
00002 Name:      I_Queue.h
00003 Project:   xmlBlaster.org
00004 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
00005 ------------------------------------------------------------------------------*/
00006 #ifndef _UTIL_QUEUE_I_QUEUE_H
00007 #define _UTIL_QUEUE_I_QUEUE_H
00008 
00009 #include <util/xmlBlasterDef.h>
00010 #include <util/ReferenceHolder.h>
00011 #include <util/queue/MsgQueueEntry.h>
00012 #include <util/plugin/I_Plugin.h>
00013 
00014 namespace org { namespace xmlBlaster { namespace util { namespace queue {
00015 
00019 typedef ReferenceHolder<MsgQueueEntry> EntryType;
00020 
00027 class Dll_Export I_Queue : public virtual org::xmlBlaster::util::plugin::I_Plugin
00028 {
00029 public:
00030    virtual ~I_Queue() {};
00031     
00039    virtual void put(const MsgQueueEntry &entry) = 0;
00040 
00050    virtual const std::vector<EntryType> peekWithSamePriority(long maxNumOfEntries=-1, long maxNumOfBytes=-1) const = 0;
00051 
00060    virtual long randomRemove(const std::vector<EntryType>::const_iterator &start, const std::vector<EntryType>::const_iterator &end) = 0;
00061 
00066    virtual long getNumOfEntries() const = 0;
00067 
00072    virtual long getMaxNumOfEntries() const = 0;
00073 
00081    virtual int64_t getNumOfBytes() const = 0;
00082 
00087    virtual int64_t getMaxNumOfBytes() const = 0;
00088 
00093    virtual void clear() = 0;
00094 
00099    virtual bool empty() const = 0;
00100 
00108    virtual void destroy() = 0;
00109 };
00110 
00111 }}}} // namespace
00112 
00113 #endif
00114