Boost-Geometry-Utils

 view release on metacpan or  search on metacpan

src/boost/python/detail/caller.hpp  view on Meta::CPAN

template <class F, class CallPolicies, class Sig>
struct caller
    : caller_base_select<F,CallPolicies,Sig>::type
{
    typedef typename caller_base_select<
        F,CallPolicies,Sig
        >::type base;

    typedef PyObject* result_type;
    
    caller(F f, CallPolicies p) : base(f,p) {}

};

}}} // namespace boost::python::detail

# endif // CALLER_DWA20021121_HPP

#else

# define N BOOST_PP_ITERATION()

src/boost/python/object/py_function.hpp  view on Meta::CPAN

    virtual PyObject* operator()(PyObject*, PyObject*) = 0;
    virtual unsigned min_arity() const = 0;
    virtual unsigned max_arity() const;
    virtual python::detail::py_func_sig_info signature() const = 0;
};

template <class Caller>
struct caller_py_function_impl : py_function_impl_base
{
    caller_py_function_impl(Caller const& caller)
        : m_caller(caller)
    {}
    
    PyObject* operator()(PyObject* args, PyObject* kw)
    {
        return m_caller(args, kw);
    }
    
    virtual unsigned min_arity() const
    {
        return m_caller.min_arity();
    }
    
    virtual python::detail::py_func_sig_info signature() const
    {
        return m_caller.signature();
    }

 private:
    Caller m_caller;
};

template <class Caller, class Sig>
struct signature_py_function_impl : py_function_impl_base
{
    signature_py_function_impl(Caller const& caller)
        : m_caller(caller)
    {}
    
    PyObject* operator()(PyObject* args, PyObject* kw)
    {
        return m_caller(args, kw);
    }
    
    virtual unsigned min_arity() const
    {
        return mpl::size<Sig>::value - 1;
    }
    
    virtual python::detail::py_func_sig_info signature() const
    {
        python::detail::signature_element const* sig = python::detail::signature<Sig>::elements();

src/boost/python/object/py_function.hpp  view on Meta::CPAN

    }

 private:
    Caller m_caller;
};

template <class Caller, class Sig>
struct full_py_function_impl : py_function_impl_base
{
    full_py_function_impl(Caller const& caller, unsigned min_arity, unsigned max_arity)
      : m_caller(caller)
      , m_min_arity(min_arity)
      , m_max_arity(max_arity > min_arity ? max_arity : min_arity)
    {}
    
    PyObject* operator()(PyObject* args, PyObject* kw)
    {
        return m_caller(args, kw);
    }
    
    virtual unsigned min_arity() const
    {
        return m_min_arity;
    }
    
    virtual unsigned max_arity() const
    {
        return m_max_arity;

src/boost/test/impl/cpp_main.ipp  view on Meta::CPAN


//____________________________________________________________________________//

#ifdef BOOST_NO_STDC_NAMESPACE
namespace std { using ::getenv; using ::strerror; }
#endif

namespace {

struct cpp_main_caller {
    cpp_main_caller( int (*cpp_main_func)( int argc, char* argv[] ), int argc, char** argv ) 
    : m_cpp_main_func( cpp_main_func )
    , m_argc( argc )
    , m_argv( argv ) {}
    
    int operator()() { return (*m_cpp_main_func)( m_argc, m_argv ); }
  
private:
    // Data members    
    int (*m_cpp_main_func)( int argc, char* argv[] );
    int      m_argc;

src/boost/test/impl/cpp_main.ipp  view on Meta::CPAN

{
    int result = 0;

    try {
        boost::unit_test::const_string p( std::getenv( "BOOST_TEST_CATCH_SYSTEM_ERRORS" ) );
        ::boost::execution_monitor ex_mon;

        ex_mon.p_catch_system_errors.value = p != "no";
        
        result = ex_mon.execute( 
            ::boost::unit_test::callback0<int>( cpp_main_caller( cpp_main, argc, argv ) ) );
        
        if( result == 0 )
            result = ::boost::exit_success;
        else if( result != ::boost::exit_success ) {
            std::cout << "\n**** error return code: " << result << std::endl;
            result = ::boost::exit_failure;
        }
    }
    catch( ::boost::execution_exception const& exex ) {
        std::cout << "\n**** exception(" << exex.code() << "): " << exex.what() << std::endl;

src/boost/test/impl/framework.ipp  view on Meta::CPAN


namespace unit_test {

// ************************************************************************** //
// **************            test_start calls wrapper          ************** //
// ************************************************************************** //

namespace ut_detail {

struct test_start_caller {
    test_start_caller( test_observer* to, counter_t tc_amount )
    : m_to( to )
    , m_tc_amount( tc_amount )
    {}

    int operator()()
    {
        m_to->test_start( m_tc_amount );
        return 0;
    }

private:
    // Data members
    test_observer*  m_to;
    counter_t       m_tc_amount;
};

//____________________________________________________________________________//

struct test_init_caller {
    explicit    test_init_caller( init_unit_test_func init_func ) 
    : m_init_func( init_func )
    {}
    int         operator()()
    {
#ifdef BOOST_TEST_ALTERNATIVE_INIT_API
        if( !(*m_init_func)() )
            throw std::runtime_error( "test module initialization failed" );
#else
        test_suite*  manual_test_units = (*m_init_func)( framework::master_test_suite().argc, framework::master_test_suite().argv );

src/boost/test/impl/framework.ipp  view on Meta::CPAN

    bool    call_start_finish   = !continue_test || !s_frk_impl().m_test_in_progress;
    bool    was_in_progress     = s_frk_impl().m_test_in_progress;

    s_frk_impl().m_test_in_progress = true;

    if( call_start_finish ) {
        BOOST_TEST_FOREACH( test_observer*, to, s_frk_impl().m_observers ) {
            boost::execution_monitor em;

            try {
                em.execute( ut_detail::test_start_caller( to, tcc.p_count ) );
            }
            catch( execution_exception const& ex )  {
                throw setup_error( ex.what() );
            }
        }
    }

    switch( runtime_config::random_seed() ) {
    case 0:
        break;

src/boost/test/impl/test_main.ipp  view on Meta::CPAN

// Boost
#include <boost/cstdlib.hpp>

#include <boost/test/detail/suppress_warnings.hpp>

//____________________________________________________________________________//

extern int test_main( int argc, char* argv[] );    // prototype for user's test_main()

struct test_main_caller {
    test_main_caller( int argc, char** argv ) : m_argc( argc ), m_argv( argv ) {}
    
    void operator()() {
        int test_main_result = test_main( m_argc, m_argv );

        // translate a test_main non-success return into a test error
        BOOST_CHECK( test_main_result == 0 || test_main_result == boost::exit_success );
    }
  
private:
    // Data members    

src/boost/test/impl/test_main.ipp  view on Meta::CPAN

// ************************************************************************** //
// **************                   test main                  ************** //
// ************************************************************************** //

::boost::unit_test::test_suite*
init_unit_test_suite( int argc, char* argv[] ) {
    using namespace ::boost::unit_test;
    
    framework::master_test_suite().p_name.value = "Test Program";
    
    framework::master_test_suite().add( BOOST_TEST_CASE( test_main_caller( argc, argv ) ) );
    
    return 0;
}

//____________________________________________________________________________//

#include <boost/test/detail/enable_warnings.hpp>

#endif // BOOST_TEST_TEST_MAIN_IPP_012205GER



( run in 0.338 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )