Panda3D
Public Member Functions | List of all members
QueuedReturn< Thing > Class Template Reference

This is the implementation of a family of things that queue up their return values for later retrieval by client code, like QueuedConnectionReader, QueuedConnectionListener, QueuedConnectionManager. More...

#include "queuedReturn.h"

Public Member Functions

int get_current_queue_size () const
 Returns the current number of things in the queue. More...
 
int get_max_queue_size () const
 Returns the maximum size the queue is allowed to grow to. More...
 
bool get_overflow_flag () const
 Returns true if the queue has overflowed since the last call to reset_overflow_flag() (implying that some elements have been dropped from the queue), or false otherwise. More...
 
void reset_overflow_flag ()
 Resets the overflow flag so that get_overflow_flag() will return false until a new overflow occurs. More...
 
void set_max_queue_size (int max_size)
 Sets the maximum size the queue is allowed to grow to. More...
 

Detailed Description

template<class Thing>
class QueuedReturn< Thing >

This is the implementation of a family of things that queue up their return values for later retrieval by client code, like QueuedConnectionReader, QueuedConnectionListener, QueuedConnectionManager.

Definition at line 35 of file queuedReturn.h.

Member Function Documentation

◆ get_current_queue_size()

template<class Thing >
int QueuedReturn< Thing >::get_current_queue_size ( ) const

Returns the current number of things in the queue.

Definition at line 44 of file queuedReturn.I.

◆ get_max_queue_size()

template<class Thing >
int QueuedReturn< Thing >::get_max_queue_size ( ) const

Returns the maximum size the queue is allowed to grow to.

See set_max_queue_size().

Definition at line 35 of file queuedReturn.I.

◆ get_overflow_flag()

template<class Thing >
bool QueuedReturn< Thing >::get_overflow_flag ( ) const

Returns true if the queue has overflowed since the last call to reset_overflow_flag() (implying that some elements have been dropped from the queue), or false otherwise.

Definition at line 57 of file queuedReturn.I.

◆ reset_overflow_flag()

template<class Thing >
void QueuedReturn< Thing >::reset_overflow_flag ( )

Resets the overflow flag so that get_overflow_flag() will return false until a new overflow occurs.

Definition at line 67 of file queuedReturn.I.

◆ set_max_queue_size()

template<class Thing >
void QueuedReturn< Thing >::set_max_queue_size ( int  max_size)

Sets the maximum size the queue is allowed to grow to.

This is primarily for a sanity check; this is a limit beyond which we can assume something bad has happened.

It's also a crude check against unfortunate seg faults due to the queue filling up and quietly consuming all available memory.

Definition at line 24 of file queuedReturn.I.


The documentation for this class was generated from the following files: