| 
    KiCad PCB EDA Suite
    
   | 
 
Synchronized, locking queue. More...
#include <sync_queue.h>
Public Member Functions | |
| SYNC_QUEUE () | |
| void | push (T const &aValue) | 
| Push a value onto the queue.   | |
| void | move_push (T &&aValue) | 
| Move a value onto the queue.   | |
| bool | pop (T &aReceiver) | 
| Pop a value if the queue into the provided variable.   | |
| bool | empty () const | 
| Return true if the queue is empty.   | |
| size_t | size () const | 
| Return the size of the queue.   | |
| void | clear () | 
| Clear the queue.   | |
Private Types | |
| typedef std::lock_guard< std::mutex > | GUARD | 
Private Attributes | |
| std::queue< T > | m_queue | 
| std::mutex | m_mutex | 
Synchronized, locking queue.
Safe for multiple producer/multiple consumer environments with nontrivial data (though bear in mind data needs to be copied in and out).
Definition at line 31 of file sync_queue.h.
      
  | 
  private | 
Definition at line 111 of file sync_queue.h.
      
  | 
  inline | 
Definition at line 34 of file sync_queue.h.
      
  | 
  inline | 
      
  | 
  inline | 
Return true if the queue is empty.
Definition at line 82 of file sync_queue.h.
      
  | 
  inline | 
Move a value onto the queue.
Useful for e.g. unique_ptr.
Definition at line 50 of file sync_queue.h.
References m_mutex, m_queue, and T.
Referenced by FOOTPRINT_LIST_IMPL::loadFootprints().
      
  | 
  inline | 
Pop a value if the queue into the provided variable.
If the queue is empty, the variable is not touched.
Definition at line 63 of file sync_queue.h.
References m_mutex, m_queue, and T.
Referenced by FOOTPRINT_LIST_IMPL::loadFootprints().
      
  | 
  inline | 
Push a value onto the queue.
Definition at line 41 of file sync_queue.h.
      
  | 
  inline | 
Return the size of the queue.
Definition at line 91 of file sync_queue.h.
      
  | 
  mutableprivate | 
Definition at line 114 of file sync_queue.h.
Referenced by clear(), empty(), move_push(), pop(), push(), and size().
      
  | 
  private | 
Definition at line 113 of file sync_queue.h.
Referenced by clear(), empty(), move_push(), pop(), push(), and size().