403Webshell
Server IP : 104.21.38.3  /  Your IP : 172.70.142.143
Web Server : Apache
System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /www/server/mysql/src/boost/boost_1_59_0/boost/statechart/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/boost/boost_1_59_0/boost/statechart/fifo_scheduler.hpp
#ifndef BOOST_STATECHART_FIFO_SCHEDULER_HPP_INCLUDED
#define BOOST_STATECHART_FIFO_SCHEDULER_HPP_INCLUDED
//////////////////////////////////////////////////////////////////////////////
// Copyright 2002-2006 Andreas Huber Doenni
// Distributed under the Boost Software License, Version 1.0. (See accompany-
// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//////////////////////////////////////////////////////////////////////////////



#include <boost/statechart/event_base.hpp>
#include <boost/statechart/fifo_worker.hpp>
#include <boost/statechart/processor_container.hpp>

#include <boost/intrusive_ptr.hpp>
#include <boost/noncopyable.hpp>
#include <boost/config.hpp> // BOOST_HAS_THREADS



namespace boost
{
namespace statechart
{



//////////////////////////////////////////////////////////////////////////////
template<
  class FifoWorker = fifo_worker<>,
  class Allocator = std::allocator< void > >
class fifo_scheduler : noncopyable
{
  typedef processor_container<
    fifo_scheduler, typename FifoWorker::work_item, Allocator > container;
  public:
    //////////////////////////////////////////////////////////////////////////
    #ifdef BOOST_HAS_THREADS
    fifo_scheduler( bool waitOnEmptyQueue = false ) :
      worker_( waitOnEmptyQueue )
    {
    }
    #endif

    typedef typename container::processor_handle processor_handle;
    typedef typename container::processor_context processor_context;

    template< class Processor >
    processor_handle create_processor()
    {
      processor_handle result;
      work_item item =
        container_.template create_processor< Processor >( result, *this );
      worker_.queue_work_item( item );
      return result;
    }

    template< class Processor, typename Arg1 >
    processor_handle create_processor( Arg1 arg1 )
    {
      processor_handle result;
      work_item item = container_.template create_processor< Processor >(
        result, *this, arg1 );
      worker_.queue_work_item( item );
      return result;
    }

    template< class Processor, typename Arg1, typename Arg2 >
    processor_handle create_processor( Arg1 arg1, Arg2 arg2 )
    {
      processor_handle result;
      work_item item = container_.template create_processor< Processor >(
        result, *this, arg1, arg2 );
      worker_.queue_work_item( item );
      return result;
    }

    template< class Processor, typename Arg1, typename Arg2, typename Arg3 >
    processor_handle create_processor( Arg1 arg1, Arg2 arg2, Arg3 arg3 )
    {
      processor_handle result;
      work_item item = container_.template create_processor< Processor >(
        result, *this, arg1, arg2, arg3 );
      worker_.queue_work_item( item );
      return result;
    }

    template<
      class Processor, typename Arg1, typename Arg2,
      typename Arg3, typename Arg4 >
    processor_handle create_processor(
      Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4 )
    {
      processor_handle result;
      work_item item = container_.template create_processor< Processor >(
        result, *this, arg1, arg2, arg3, arg4 );
      worker_.queue_work_item( item );
      return result;
    }

    template<
      class Processor, typename Arg1, typename Arg2,
      typename Arg3, typename Arg4, typename Arg5 >
    processor_handle create_processor(
      Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5 )
    {
      processor_handle result;
      work_item item = container_.template create_processor< Processor >(
        result, *this, arg1, arg2, arg3, arg4, arg5 );
      worker_.queue_work_item( item );
      return result;
    }

    template<
      class Processor, typename Arg1, typename Arg2,
      typename Arg3, typename Arg4, typename Arg5, typename Arg6 >
    processor_handle create_processor(
      Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5, Arg6 arg6 )
    {
      processor_handle result;
      work_item item = container_.template create_processor< Processor >(
        result, *this, arg1, arg2, arg3, arg4, arg5, arg6 );
      worker_.queue_work_item( item );
      return result;
    }

    void destroy_processor( const processor_handle & processor )
    {
      work_item item = container_.destroy_processor( processor );
      worker_.queue_work_item( item );
    }

    void initiate_processor( const processor_handle & processor )
    {
      work_item item = container_.initiate_processor( processor );
      worker_.queue_work_item( item );
    }

    void terminate_processor( const processor_handle & processor )
    {
      work_item item = container_.terminate_processor( processor );
      worker_.queue_work_item( item );
    }

    typedef intrusive_ptr< const event_base > event_ptr_type;

    void queue_event(
      const processor_handle & processor, const event_ptr_type & pEvent )
    {
      work_item item = container_.queue_event( processor, pEvent );
      worker_.queue_work_item( item );
    }

    typedef typename FifoWorker::work_item work_item;

    // We take a non-const reference so that we can move (i.e. swap) the item
    // into the queue, what avoids copying the (possibly heap-allocated)
    // implementation object inside work_item.
    void queue_work_item( work_item & item )
    {
      worker_.queue_work_item( item );
    }

    // Convenience overload so that temporary objects can be passed directly
    // instead of having to create a work_item object first. Under most
    // circumstances, this will lead to one unnecessary copy of the
    // function implementation object.
    void queue_work_item( const work_item & item )
    {
      worker_.queue_work_item( item );
    }

    void terminate()
    {
      worker_.terminate();
    }

    // Is not mutex-protected! Must only be called from the thread that also
    // calls operator().
    bool terminated() const
    {
      return worker_.terminated();
    }

    unsigned long operator()( unsigned long maxEventCount = 0 )
    {
      return worker_( maxEventCount );
    }

  private:
    //////////////////////////////////////////////////////////////////////////
    container container_;
    FifoWorker worker_;
};



} // namespace statechart
} // namespace boost



#endif

Youez - 2016 - github.com/yon3zu
LinuXploit