Esempio n. 1
0
int main()
{
  function2 f2;
  const function2 cf2;
  function3 f3;

  handler2 h2;
  const handler2 ch2;
  handler3 h3;

  std::experimental::loop_scheduler scheduler;
  std::experimental::executor ex = scheduler.get_executor();

  ex = std::experimental::system_executor();
  assert(&ex.context() == &std::experimental::system_executor().context());

  invoke(std::experimental::chain(ex.wrap(function1)));
  invoke(std::experimental::chain(ex.wrap(function1), handler1));
  invoke(std::experimental::chain(ex.wrap(function1), &handler1));
  invoke(std::experimental::chain(ex.wrap(function1), handler2()));
  invoke(std::experimental::chain(ex.wrap(function1), h2));
  invoke(std::experimental::chain(ex.wrap(function1), ch2));
  invoke(std::experimental::chain(ex.wrap(function1), handler3()));
  invoke(std::experimental::chain(ex.wrap(function1), std::move(h3)));

  invoke(std::experimental::chain(ex.wrap(&function1)));
  invoke(std::experimental::chain(ex.wrap(&function1), handler1));
  invoke(std::experimental::chain(ex.wrap(&function1), &handler1));
  invoke(std::experimental::chain(ex.wrap(&function1), handler2()));
  invoke(std::experimental::chain(ex.wrap(&function1), h2));
  invoke(std::experimental::chain(ex.wrap(&function1), ch2));
  invoke(std::experimental::chain(ex.wrap(&function1), handler3()));
  invoke(std::experimental::chain(ex.wrap(&function1), std::move(h3)));

  invoke(std::experimental::chain(ex.wrap(function2())));
  invoke(std::experimental::chain(ex.wrap(function2()), handler1));
  invoke(std::experimental::chain(ex.wrap(function2()), &handler1));
  invoke(std::experimental::chain(ex.wrap(function2()), handler2()));
  invoke(std::experimental::chain(ex.wrap(function2()), h2));
  invoke(std::experimental::chain(ex.wrap(function2()), ch2));
  invoke(std::experimental::chain(ex.wrap(function2()), handler3()));
  invoke(std::experimental::chain(ex.wrap(function2()), std::move(h3)));

  invoke(std::experimental::chain(ex.wrap(f2)));
  invoke(std::experimental::chain(ex.wrap(f2), handler1));
  invoke(std::experimental::chain(ex.wrap(f2), &handler1));
  invoke(std::experimental::chain(ex.wrap(f2), handler2()));
  invoke(std::experimental::chain(ex.wrap(f2), h2));
  invoke(std::experimental::chain(ex.wrap(f2), ch2));
  invoke(std::experimental::chain(ex.wrap(f2), handler3()));
  invoke(std::experimental::chain(ex.wrap(f2), std::move(h3)));

  invoke(std::experimental::chain(ex.wrap(cf2)));
  invoke(std::experimental::chain(ex.wrap(cf2), handler1));
  invoke(std::experimental::chain(ex.wrap(cf2), &handler1));
  invoke(std::experimental::chain(ex.wrap(cf2), handler2()));
  invoke(std::experimental::chain(ex.wrap(cf2), h2));
  invoke(std::experimental::chain(ex.wrap(cf2), ch2));
  invoke(std::experimental::chain(ex.wrap(cf2), handler3()));
  invoke(std::experimental::chain(ex.wrap(cf2), std::move(h3)));

  invoke(std::experimental::chain(ex.wrap(function3())));
  invoke(std::experimental::chain(ex.wrap(function3()), handler1));
  invoke(std::experimental::chain(ex.wrap(function3()), &handler1));
  invoke(std::experimental::chain(ex.wrap(function3()), handler2()));
  invoke(std::experimental::chain(ex.wrap(function3()), h2));
  invoke(std::experimental::chain(ex.wrap(function3()), ch2));
  invoke(std::experimental::chain(ex.wrap(function3()), handler3()));
  invoke(std::experimental::chain(ex.wrap(function3()), std::move(h3)));

  invoke(std::experimental::chain(ex.wrap(std::move(f3))));
  invoke(std::experimental::chain(ex.wrap(std::move(f3)), handler1));
  invoke(std::experimental::chain(ex.wrap(std::move(f3)), &handler1));
  invoke(std::experimental::chain(ex.wrap(std::move(f3)), handler2()));
  invoke(std::experimental::chain(ex.wrap(std::move(f3)), h2));
  invoke(std::experimental::chain(ex.wrap(std::move(f3)), ch2));
  invoke(std::experimental::chain(ex.wrap(std::move(f3)), handler3()));
  invoke(std::experimental::chain(ex.wrap(std::move(f3)), std::move(h3)));

  assert(function_count == 56);
  assert(handler_count == 49);
}
Esempio n. 2
0
// Invoke the slot on behalf of C++.
PyQtSlot::Result PyQtSlot::invoke(void **qargs, bool no_receiver_check) const
{
    return invoke(qargs, 0, 0, no_receiver_check);
}
Esempio n. 3
0
File: engine.cpp Progetto: jch/mongo
 int Scope::invoke( const char* code , const BSONObj& args, int timeoutMs ){
     ScriptingFunction func = createFunction( code );
     uassert( 10207 ,  "compile failed" , func );
     return invoke( func , args, timeoutMs );
 }
Esempio n. 4
0
 static void invoke( char const uplo, VectorAP& ap, VectorTAU& tau,
         MatrixQ& q, integer_t& info, minimal_workspace work ) {
     traits::detail::array< value_type > tmp_work( min_size_work(
             traits::matrix_num_columns(q) ) );
     invoke( uplo, ap, tau, q, info, workspace( tmp_work ) );
 }
Esempio n. 5
0
vm_obj trace_fmt(vm_obj const &, vm_obj const & fmt, vm_obj const & fn) {
    tout() << to_format(fmt) << "\n";
    return invoke(fn, mk_vm_unit());
}
Esempio n. 6
0
var var::call (const Identifier method, const var& arg1, const var& arg2) const
{
    var args[] = { arg1, arg2 };
    return invoke (method, args, 2);
}
Esempio n. 7
0
var var::call (const Identifier method, const var& arg1, const var& arg2, const var& arg3, const var& arg4, const var& arg5) const
{
    var args[] = { arg1, arg2, arg3, arg4, arg5 };
    return invoke (method, args, 5);
}
Esempio n. 8
0
/*!
    Request the presentation state of caller id information on
    incoming calls.  The state will be returned via the
    callerIdPresentation() signal.

    On AT-based modems, this will typically use the \c{AT+CLIP} command.

    \sa callerIdPresentation()
*/
void QCallSettings::requestCallerIdPresentation()
{
    invoke( SLOT(requestCallerIdPresentation()) );
}
Esempio n. 9
0
/*!
    Request the presentation state of connected line identification
    information (COLP).  The state will be returned via the
    connectedIdPresentation() signal.

    On AT-based modems, this will typically use the \c{AT+COLP} command.

    \sa connectedIdPresentation()
*/
void QCallSettings::requestConnectedIdPresentation()
{
    invoke( SLOT(requestConnectedIdPresentation()) );
}
Esempio n. 10
0
/*!
    Request the transport that is being used to send SMS messages.
    The service responds by emitting the smsTransport() signal.

    On AT-based modems, this will typically use the \c{AT+CGSMS} command.

    \sa smsTransport()
*/
void QCallSettings::requestSmsTransport()
{
    invoke( SLOT(requestSmsTransport()) );
}
Esempio n. 11
0
/*!
    Sets the \a transport to be used for sending SMS messages.  The service responds
    by emitting the setSmsTransportResult() signal.

    On AT-based modems, this will typically use the \c{AT+CGSMS} command.

    \sa setSmsTransportResult()
*/
void QCallSettings::setSmsTransport( QCallSettings::SmsTransport transport )
{
    invoke( SLOT(setSmsTransport(QCallSettings::SmsTransport)),
            qVariantFromValue( transport ) );
}
Esempio n. 12
0
/*!
    Sets the caller ID restriction state to \a clir.  The service responds
    by emitting the setCallerIdRestrictionResult() signal.

    On AT-based modems, this will typically use the \c{AT+CLIR} command.

    \sa setCallerIdRestrictionResult()
*/
void QCallSettings::setCallerIdRestriction
        ( QCallSettings::CallerIdRestriction clir )
{
    invoke( SLOT(setCallerIdRestriction(QCallSettings::CallerIdRestriction)),
            qVariantFromValue( clir ) );
}
Esempio n. 13
0
/*!
    Request the current state of the caller ID restriction service.
    The service responds by emitting the callerIdRestriction() signal.

    On AT-based modems, this will typically use the \c{AT+CLIR} command.

    \sa callerIdRestriction()
*/
void QCallSettings::requestCallerIdRestriction()
{
    invoke( SLOT(requestCallerIdRestriction()) );
}
Esempio n. 14
0
/*!
    Request the current call waiting flags.  The service responds by
    emitting the callWaiting() signal.

    On AT-based modems, this will typically use the \c{AT+CCWA} command.

    \sa callWaiting()
*/
void QCallSettings::requestCallWaiting()
{
    invoke( SLOT(requestCallWaiting()) );
}
Esempio n. 15
0
var var::call (const Identifier method) const
{
    return invoke (method, nullptr, 0);
}
Esempio n. 16
0
 static constexpr decltype(auto) dispatch_(true_type, F f, Vs... vs) {
   return invoke(static_cast<F>(f)(meta::size_t<Is>{}...),
                 unsafe::get<Is>(static_cast<Vs>(vs))...);
 }
Esempio n. 17
0
var var::call (const Identifier method, const var& arg1) const
{
    return invoke (method, &arg1, 1);
}
Esempio n. 18
0
 static constexpr decltype(auto) dispatch_(false_type, F f, Vs... vs) {
   return invoke(static_cast<F>(f), unsafe::get<Is>(static_cast<Vs>(vs))...);
 }
Esempio n. 19
0
var var::call (const Identifier method, const var& arg1, const var& arg2, const var& arg3)
{
    var args[] = { arg1, arg2, arg3 };
    return invoke (method, args, 3);
}
Esempio n. 20
0
void UserDirectory::close() {
  // void dir_closedir()
  invoke(m_DirClose, s_dir_closedir, Array::Create());
}
Esempio n. 21
0
Variant f_hphp_invoke(CStrRef name, CArrRef params) {
  return invoke(name.data(), params);
}
Esempio n. 22
0
        void ISemaphore::reducePermits(int reduction) {
            std::auto_ptr<protocol::ClientMessage> request =
                    protocol::codec::SemaphoreReducePermitsCodec::RequestParameters::encode(getName(), reduction);

            invoke(request, partitionId);
        }
Esempio n. 23
0
 static void invoke( char const uplo, VectorAP& ap, VectorTAU& tau,
         MatrixQ& q, integer_t& info, optimal_workspace work ) {
     invoke( uplo, ap, tau, q, info, minimal_workspace() );
 }
Esempio n. 24
0
        void ISemaphore::release(int permits) {
            std::auto_ptr<protocol::ClientMessage> request =
                    protocol::codec::SemaphoreReleaseCodec::RequestParameters::encode(getName(), permits);

            invoke(request, partitionId);
        }
Esempio n. 25
0
void DelayCaller::callAfterDelay( int delay )
{
    QTimer::singleShot( delay, this, SLOT(invoke()) );
}
Esempio n. 26
0
 int call(lua_State* L, invoke_context& ctx) const
 {
     return invoke(L, *this, ctx, f, Signature(), policies);
 }
Esempio n. 27
0
// Invoke the slot on behalf of C++.
bool PyQtSlot::invoke(void **qargs, PyObject *self, void *result) const
{
    return (invoke(qargs, self, result, false) != PyQtSlot::Failed);
}
Esempio n. 28
0
int pseudo_main_Concord(const VersatileEncodingConfig* vec,
                        const char* index_file,const char* font,int fontsize,
                        int left_context,int right_context,const char* sort_order,
                        const char* output,const char* directory,const char* alphabet,
                        int thai,int only_ambiguous,int only_matches) {
ProgramInvoker* invoker=new_ProgramInvoker(main_Concord,"main_Concord");
char tmp[256];
{
    tmp[0]=0;
    get_reading_encoding_text(tmp,sizeof(tmp)-1,vec->mask_encoding_compatibility_input);
    if (tmp[0] != '\0') {
        add_argument(invoker,"-k");
        add_argument(invoker,tmp);
    }

    tmp[0]=0;
    get_writing_encoding_text(tmp,sizeof(tmp)-1,vec->encoding_output,vec->bom_output);
    if (tmp[0] != '\0') {
        add_argument(invoker,"-q");
        add_argument(invoker,tmp);
    }
}
if (font!=NULL) {
   add_argument(invoker,"-f");
   add_argument(invoker,font);
   sprintf(tmp,"%d",fontsize);
   add_argument(invoker,"-s");
   add_argument(invoker,tmp);
}
sprintf(tmp,"%d",left_context);
add_argument(invoker,"-l");
add_argument(invoker,tmp);
sprintf(tmp,"%d",right_context);
add_argument(invoker,"-r");
add_argument(invoker,tmp);
if (sort_order==NULL) {
   add_argument(invoker,"--TO");
} else {
   add_argument(invoker,sort_order);
}
add_argument(invoker,output);
if (directory!=NULL) {
   add_argument(invoker,"-d");
   add_argument(invoker,directory);
}
if (alphabet!=NULL) {
   add_argument(invoker,"-a");
   add_argument(invoker,alphabet);
}
if (thai) {
   add_argument(invoker,"-T");
}
if (only_ambiguous) {
   add_argument(invoker,"--only_ambiguous");
}
if (only_matches) {
   add_argument(invoker,"--only_matches");
}
add_argument(invoker,index_file);
int ret=invoke(invoker);
free_ProgramInvoker(invoker);
return ret;
}
Esempio n. 29
0
 static std::ptrdiff_t invoke( const char norm, const MatrixAB& ab,
         optimal_workspace ) {
     namespace bindings = ::boost::numeric::bindings;
     typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
     return invoke( norm, ab, minimal_workspace() );
 }
Esempio n. 30
0
 static void invoke( MatrixA& a, VectorD& d, VectorE& e, VectorTAU& tau,
         integer_t& info, minimal_workspace work ) {
     traits::detail::array< value_type > tmp_work( min_size_work(  ) );
     invoke( a, d, e, tau, info, workspace( tmp_work ) );
 }