7#ifndef PACKET_QUEUE_MGR_H
8#define PACKET_QUEUE_MGR_H
14#include <boost/shared_ptr.hpp>
38template<
typename PacketQueueTypePtr>
78 factories_.insert(std::make_pair(queue_type, factory));
139 std::string queue_type ;
142 }
catch (
const std::exception& ex) {
152 queue_type <<
"' is not supported"); }
157 auto new_queue = index->second(parameters);
160 " factory returned NULL");
This is a base class for exceptions thrown from the DNS library module.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
A generic exception that is thrown when an unexpected error condition occurs.
static std::string getString(isc::data::ConstElementPtr scope, const std::string &name)
Returns a string parameter from a scope.
Invalid queue parameter exception.
Invalid Queue type exception.
InvalidQueueType(const char *file, size_t line, const char *what)
Packet Queue Managers (PQM).
void createPacketQueue(data::ConstElementPtr parameters)
Create an instance of a packet queue.
std::map< std::string, Factory > factories_
A map holding registered backend factory functions.
bool registerPacketQueueFactory(const std::string &queue_type, Factory factory)
Registers new queue factory function for a given queue type.
PacketQueueTypePtr getPacketQueue() const
Returns underlying packet queue.
std::function< PacketQueueTypePtr(data::ConstElementPtr)> Factory
Defines the type of the packet queue factory function.
PacketQueueMgr()
Constructor.
bool unregisterPacketQueueFactory(const std::string &queue_type)
Unregisters the queue factory function for a given type.
PacketQueueTypePtr packet_queue_
the current queue_ ?
void destroyPacketQueue()
Destroys the current packet queue.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
boost::shared_ptr< const Element > ConstElementPtr
Defines the logger used by the top-level component of kea-lfc.