25 #ifndef LOG4CPLUS_HELPERS_QUEUE_H
26 #define LOG4CPLUS_HELPERS_QUEUE_H
30 #if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
34 #if ! defined (LOG4CPLUS_SINGLE_THREADED)
56 explicit Queue (
unsigned len = 100);
The internal representation of logging events.
Single consumer, multiple producers queue.
Semaphore sem
Semaphore that limits the queue length.
flags_type signal_exit(bool drain=true)
Sets EXIT flag and DRAIN flag and sets internal event object into signaled state.
queue_storage_type queue
Queue storage.
unsigned flags_type
Type of the state flags field.
Flags
Possible state flags.
flags_type put_event(spi::InternalLoggingEvent const &ev)
Puts event ev into queue, sets QUEUE flag and sets internal event object into signaled state.
flags_type get_events(queue_storage_type *buf)
The get_events() function is used by queue's consumer.
flags_type flags
State flags.
ManualResetEvent ev_consumer
Event on which consumer can wait if it finds queue empty.
std::deque< spi::InternalLoggingEvent > queue_storage_type
Queue storage type.
Mutex mutex
Mutex protecting queue and flags.
helpers::SharedObjectPtr< Queue > QueuePtr