Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Class coroutine<>::push_type

#include <boost/coroutine/coroutine.hpp>

template< typename Arg >
class coroutine<>::push_type
{
public:
    push_type();

    template<
        typename Fn,
        typename StackAllocator = stack_allocator,
        typename Allocator = std::allocator< coroutine >
    >
    push_type( Fn fn, attributes const& attr = attributes(),
               StackAllocator const& stack_alloc = StackAllocator(),
               Allocator const& alloc = Allocator() );

    template<
        typename Fn,
        typename StackAllocator = stack_allocator,
        typename Allocator = std::allocator< coroutine >
    >
    push_type( Fn && fn, attributes const& attr = attributes(),
               StackAllocator stack_alloc = StackAllocator(),
               Allocator const& alloc = Allocator() );

    push_type( push_type && other);

    push_type & operator=( push_type && other);

    operator unspecified-bool-type() const;

    bool operator!() const;

    void swap( push_type & other);

    bool empty() const;

    push_type & operator()( Arg&& arg);
};

template< typename Arg >
void swap( push_type< Arg > & l, push_type< Arg > & r);

template< typename Arg >
range_iterator< push_type< Arg > >::type begin( push_type< Arg > &);

template< typename Arg >
range_iterator< push_type< Arg > >::type end( push_type< Arg > &);
push_type()

Effects:

Creates a coroutine representing not-a-coroutine.

Throws:

Nothing.

template< typename Fn, typename StackAllocator, typename Allocator > push_type( Fn fn, attributes const& attr, StackAllocator const& stack_alloc, Allocator const& alloc)

Preconditions:

size > minimum_stacksize(), size < maximum_stacksize() when ! is_stack_unbound().

Effects:

Creates a coroutine which will execute fn. Argument attr determines stack clean-up and preserving floating-point registers. For allocating/deallocating the stack stack_alloc is used and internal data are allocated by Allocator.

template< typename Fn, typename StackAllocator, typename Allocator > push_type( Fn && fn, attributes const& attr, StackAllocator const& stack_alloc, Allocator const& alloc)

Preconditions:

size > minimum_stacksize(), size < maximum_stacksize() when ! is_stack_unbound().

Effects:

Creates a coroutine which will execute fn. Argument attr determines stack clean-up and preserving floating-point registers. For allocating/deallocating the stack stack_alloc is used and internal data are allocated by Allocator.

push_type( push_type && other)

Effects:

Moves the internal data of other to *this. other becomes not-a-coroutine.

Throws:

Nothing.

push_type & operator=( push_type && other)

Effects:

Destroys the internal data of *this and moves the internal data of other to *this. other becomes not-a-coroutine.

Throws:

Nothing.

operator unspecified-bool-type() const

Returns:

If *this refers to not-a-coroutine or the coroutine-function has returned (completed), the function returns false. Otherwise true.

Throws:

Nothing.

bool operator!() const

Returns:

If *this refers to not-a-coroutine or the coroutine-function has returned (completed), the function returns true. Otherwise false.

Throws:

Nothing.

bool empty()

Returns:

If *this refers to not-a-coroutine, the function returns true. Otherwise false.

Throws:

Nothing.

push_type<> & operator()(Arg&& arg)
push_type& coroutine<Arg>::push_type::operator()(const Arg&);
push_type& coroutine<Arg>::push_type::operator()(Arg&&);
push_type& coroutine<Arg&>::push_type::operator()(Arg&);
push_type& coroutine<void>::push_type::operator()();

Preconditions:

operator unspecified-bool-type() returns true for *this.

Effects:

Execution control is transferred to coroutine-function and the argument arg is passed to the coroutine-function.

Throws:

Exceptions thrown inside coroutine-function.

void swap( push_type & other)

Effects:

Swaps the internal data from *this with the values of other.

Throws:

Nothing.

T caller_type::operator()( R)

Effects:

Gives execution control back to calling context by returning a value of type R. The return type of this function is a boost::tuple<> containing the arguments passed to boost::coroutines::coroutine<>::operator().

Throws:

Nothing.

Non-member function swap()
template< typename Arg >
void swap( push_type< Arg > & l, push_type< Arg > & r);

Effects:

As if 'l.swap( r)'.

Non-member function begin( push_type< Arg > &)
template< typename Arg >
range_iterator< push_type< Arg > >::type begin( push_type< Arg > &);

Returns:

Returns a range-iterator (output-iterator).

Non-member function end( push_type< Arg > &)
template< typename Arg >
range_iterator< push_type< Arg > >::type end( push_type< Arg > &);

Returns:

Returns a end range-iterator (output-iterator).


PrevUpHomeNext