Class activation_queue_base

poet::activation_queue_base — Base class for activation queues.


class activation_queue_base {
  // types
  typedef unsigned long size_type;

  // construct/copy/destruct
  virtual ~activation_queue_base();

  // public member functions
  virtual void push_back(const boost::shared_ptr<method_request_base> &) ;
  virtual boost::shared_ptr<method_request_base> get_request() ;
  void wake();
  virtual size_type size() const;
  virtual bool empty() const;


An activation queue is responsible for thread-safely transporting method requests from the threads making asynchronous function calls to a scheduler thread for execution. libpoet provides two activation queues derived from activation_queue_base: out_of_order_activation_queue and in_order_activation_queue.

activation_queue_base public construct/copy/destruct

  1. virtual ~activation_queue_base();

activation_queue_base public member functions

  1. virtual void 
    push_back(const boost::shared_ptr<method_request_base> & request) ;

    Called to adds a new method request to the activation queue.

  2. virtual boost::shared_ptr<method_request_base> get_request() ;

    get_request blocks until the next method request is ready to run, then pops the request off the queue and returns it. The get_request call may be forced to return early by a call to wake. get_request is called by schedulers to obtain method requests for execution.


    A method request which is ready to be run. If get_request was interrupted by a wake call before any method requests became ready, it should return an empty shared_ptr.

  3. void wake();

    A call to wake should cause any get_request calls which are waiting for a ready method request to wake up immediately and return an empty shared_ptr.

  4. virtual size_type size() const;


    the number of method requests waiting in the queue.

  5. virtual bool empty() const;


    true if size() is zero.