#include <BufferManager.hpp>
A BufferManager has a queue-like interface to manage buffers. Since buffers can represent special DMA memory, the buffer manager is responsible for DMA hooks. 
 
  
  
      
        
          | Pothos::BufferManager::BufferManager  | 
          ( | 
          void  | 
           | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
 
  
  
      
        
          | virtual bool Pothos::BufferManager::empty  | 
          ( | 
          void  | 
           | ) | 
           const | 
         
       
   | 
  
pure virtual   | 
  
 
Is the manager empty? 
- Returns
 - true if no buffers are available 
 
 
 
Get a reference to the front buffer. front().address will be the start of a valid buffer, front().length will be the number of bytes available. The caller sets length to indicate bytes used. 
- Returns
 - the buffer at the queue head 
 
 
 
Init is called once at factory time to initialize the buffers. 
 
 
  
  
      
        
          | bool Pothos::BufferManager::isInitialized  | 
          ( | 
          void  | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Has this buffer manager been initialized? 
 
 
  
  
      
        
          | static Sptr Pothos::BufferManager::make  | 
          ( | 
          const std::string &  | 
          name | ) | 
           | 
         
       
   | 
  
static   | 
  
 
The BufferManager factory – makes a new BufferManager given the factory name. This factory call does not invoke init() on the buffer manager. Plugins for custom BufferManagers should be located in the plugin registry: /framework/buffer_manager/[name] 
- Exceptions
 - 
  
    | BufferManagerFactoryError | if the factory function fails.  | 
  
   
- Parameters
 - 
  
  
 
- Returns
 - a new shared pointer to a buffer manager 
 
 
 
The BufferManager factory – makes a new BufferManager given the factory name. Plugins for custom BufferManagers should be located in the plugin registry: /framework/buffer_manager/[name] 
- Exceptions
 - 
  
    | BufferManagerFactoryError | if the factory function fails.  | 
  
   
- Parameters
 - 
  
    | name | the name of a BufferManager factory in the plugin tree  | 
    | args | the buffer manager init arguments  | 
  
   
- Returns
 - a new shared pointer to a buffer manager 
 
 
 
  
  
      
        
          | virtual void Pothos::BufferManager::pop  | 
          ( | 
          const size_t  | 
          numBytes | ) | 
           | 
         
       
   | 
  
pure virtual   | 
  
 
Pop bytes from the front buffer. This operation removes available bytes from the manager. Calling pop removes a managed buffer from an internal queue; the bytes removed are only restored to the manager via push.
If this manager is responsible for DMA writes, the pop operation should cause a write operation. If this manager is responsible for DMA reads, this pop operation should cause a read operation.
- Parameters
 - 
  
    | numBytes | the number of bytes to remove  | 
  
   
 
 
  
  
      
        
          | virtual void Pothos::BufferManager::push  | 
          ( | 
          const ManagedBuffer &  | 
          buff | ) | 
           | 
         
       
   | 
  
pure virtual   | 
  
 
Push returns a buffer to the manager. The buffer may be available via a call to front() depending upon the implementation of the manager. 
- Exceptions
 - 
  
    | BufferPushError | if buffer does not belong to this manager.  | 
  
   
- Parameters
 - 
  
  
 
 
 
  
  
      
        
          | void Pothos::BufferManager::pushExternal  | 
          ( | 
          const ManagedBuffer &  | 
          buff | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Push external returns a buffer to the manager through a callback. This call is used to return a buffer from a different thread context. The callback implements the thread-safe delivery mechanism. 
 
 
      
        
          | void Pothos::BufferManager::setCallback  | 
          ( | 
          const std::function< void(const ManagedBuffer &)> &  | 
          callback | ) | 
           | 
        
      
 
Set the callback for use with the pushExternal API call. 
 
 
  
  
      
        
          | void Pothos::BufferManager::setFrontBuffer  | 
          ( | 
          const BufferChunk &  | 
          buff | ) | 
           | 
         
       
   | 
  
inlineprotected   | 
  
 
Called by derived classes to set the buffer for front() 
 
 
The documentation for this class was generated from the following file: