17 #ifndef HH_SENF_PPI_QueueingAlgorithm_ 18 #define HH_SENF_PPI_QueueingAlgorithm_ 1 31 :
private boost::noncopyable
36 typedef std::unique_ptr<QueueingAlgorithm>
ptr;
44 unsigned size()
const;
45 unsigned peek(
unsigned maxSize = 0x7fffffff)
const;
53 virtual void v_pop() = 0;
55 virtual unsigned v_size()
const = 0;
56 virtual unsigned v_peek(
unsigned maxSize)
const = 0;
58 virtual bool v_empty()
const = 0;
69 template <
class QAlgorithm>
80 typedef boost::ptr_map<std::string, detail::QueueingAlgorithmRegistry_EntryBase> QAlgoMap;
93 template <
class QAlgorithm>
98 template <
class QAlgorithm>
99 void registerQAlgorithm(std::string key);
102 void dump(std::ostream & os)
const;
106 # define SENF_PPI_REGISTER_QALGORITHM( key, QAlgorithm ) \ 108 senf::ppi::QueueingAlgorithmRegistry::RegistrationProxy<QAlgorithm> \ 109 BOOST_PP_CAT(qAlgorithmRegistration_, __LINE__)( key); \ 115 std::queue<Packet> queue_;
121 virtual unsigned v_peek(
unsigned maxSize)
const;
122 virtual void v_pop();
124 virtual unsigned v_size()
const;
136 virtual unsigned v_peek(
unsigned maxSize)
const;
137 virtual void v_pop();
139 virtual unsigned v_size()
const;
Packet const & front() const
virtual unsigned v_size() const =0
virtual ~QueueingAlgorithmRegistry_EntryBase()
virtual unsigned v_peek(unsigned maxSize) const =0
Exception(std::string const &descr)
unsigned peek(unsigned maxSize=0x7fffffff) const
std::unique_ptr< QueueingAlgorithm > ptr
virtual bool v_empty() const =0
void dump(std::ostream &os, DirectoryNode &dir=root())
virtual Packet const & v_front() const =0
virtual bool v_enqueue(Packet const &packet, bool force)=0
virtual ~QueueingAlgorithm()
console::DirectoryNode & consoleDir()
bool enqueue(Packet const &packet, bool force=false)