- Aldebaran documentation |
- C++ Libraries |
- index

libqi-api 2.8.7.4

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Namespaces | Macros
strand.hpp File Reference
`#include <deque>`
`#include <atomic>`
`#include <memory>`
`#include <ka/functional.hpp>`
`#include <ka/mutablestore.hpp>`
`#include <qi/assert.hpp>`
`#include <qi/config.hpp>`
`#include <qi/detail/executioncontext.hpp>`
`#include <qi/detail/futureunwrap.hpp>`
`#include <boost/enable_shared_from_this.hpp>`
`#include <boost/shared_ptr.hpp>`
`#include <boost/function.hpp>`
`#include <boost/noncopyable.hpp>`
`#include <boost/type_traits/function_traits.hpp>`
`#include <qi/async.hpp>`

Go to the source code of this file.

## Classes
struct | qi::detail::Stranded< F >
struct | qi::detail::StrandedUnwrapped< F >
class | qi::StrandPrivate
class | qi::Strand
struct | qi::detail::Stranded< F >
struct | qi::detail::StrandedUnwrapped< F >

## Namespaces
| qi
| Deprecated in 2.5. Use int8_t from <cstdint>.
| qi::detail

## Macros
#define | _QI_STRAND_HPP_
#define | genCall(n, ATYPEDECL, ATYPES, ADECL, AUSE, comma)
#define | typedefi(z, n, _)
#define | placeholders(z, n, __) , BOOST_PP_CAT(_, BOOST_PP_INC(n))
#define | genCall(n, ATYPEDECL, ATYPES, ADECL, AUSE, comma)

## Macro Definition Documentation

#define _QI_STRAND_HPP_

Definition at line 8 of file strand.hpp.

#define genCall | ( |  | n,
|  |  | ATYPEDECL,
|  |  | ATYPES,
|  |  | ADECL,
|  |  | AUSE,
|  |  | comma
| ) |  |

Value:
template <typename T, typename F, typename ARG0 comma ATYPEDECL> \
QI_API_DEPRECATED_MSG(Use generic 'schedulerFor' overload instead) boost::function<T> schedulerFor( \
const F& func, const ARG0& arg0 comma ADECL, \
const boost::function<void()>& fallbackCb = boost::function<void()>()) \
{ \
boost::function<T> funcbind = qi::bind<T>(func, arg0 comma AUSE); \
return qi::trackWithFallback( \
fallbackCb, \
SchedulerHelper<boost::function_traits<T>::arity, T>::_scheduler( \
funcbind, this), \
arg0); \
}
qi::trackWithFallback
auto trackWithFallback(boost::function< void()> onFail, F &&f, T &&toTrack) -> decltype(detail::BindTransform< T >::wrap(std::forward< T >(toTrack), std::forward< F >(f), std::move(onFail)))
Definition: trackable.hxx:413
QI_API_DEPRECATED_MSG
#define QI_API_DEPRECATED_MSG(msg__)
Compiler flags to mark a function as deprecated. It will generate a compiler warning.
Definition: macro.hpp:55

Definition at line 286 of file strand.hpp.

#define genCall | ( |  | n,
|  |  | ATYPEDECL,
|  |  | ATYPES,
|  |  | ADECL,
|  |  | AUSE,
|  |  | comma
| ) |  |

Value:
template <typename T> \
struct SchedulerHelper<n, T> \
{ \
BOOST_PP_REPEAT(n, typedefi, _); \
typedef typename boost::function_traits<T>::result_type R; \
static boost::function<T> _scheduler(const boost::function<T>& f, \
Strand* strand) \
{ \
return qi::bind<T>(&_asyncCall, strand, \
f BOOST_PP_REPEAT(n, placeholders, _)); \
} \
static qi::Future<R> _asyncCall(Strand* strand, \
const boost::function<T>& func comma \
ADECL) \
{ \
/* use qi::bind again since first arg may be a Trackable */ \
return ((qi::ExecutionContext*)strand) \
->async(qi::bind<R()>(func comma AUSE)); \
} \
};
typedefi
#define typedefi(z, n, _)
Definition: strand.hpp:282
qi::Future
Definition: executioncontext.hpp:20
qi::ExecutionContext
Definition: executioncontext.hpp:63
placeholders
#define placeholders(z, n, __)
Definition: strand.hpp:285
qi::bind
std::enable_if< std::is_function< RF >::value, boost::function< RF > >::type bind(AF &&fun, Arg0 &&arg0, Args &&...args)
Definition: trackable.hxx:308

Definition at line 286 of file strand.hpp.

#define placeholders | ( |  | z,
|  |  | n,
|  |  | __
| ) |  | , BOOST_PP_CAT(_, BOOST_PP_INC(n))

Definition at line 285 of file strand.hpp.

#define typedefi | ( |  | z,
|  |  | n,
|  |  | _
| ) |  |

Value:
typedef typename boost::function_traits<T>::BOOST_PP_CAT( \
BOOST_PP_CAT(arg, BOOST_PP_INC(n)), _type) BOOST_PP_CAT(P, n);

Definition at line 282 of file strand.hpp.