当前位置: 首页>>代码示例>>C++>>正文


C++ INSTANCE_METHOD_INJECTION_BUILTIN函数代码示例

本文整理汇总了C++中INSTANCE_METHOD_INJECTION_BUILTIN函数的典型用法代码示例。如果您正苦于以下问题:C++ INSTANCE_METHOD_INJECTION_BUILTIN函数的具体用法?C++ INSTANCE_METHOD_INJECTION_BUILTIN怎么用?C++ INSTANCE_METHOD_INJECTION_BUILTIN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了INSTANCE_METHOD_INJECTION_BUILTIN函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: INSTANCE_METHOD_INJECTION_BUILTIN

bool c_Memcache::t_set(CStrRef key, CVarRef var, int flag /*= 0*/,
                       int expire /*= 0*/) {
  INSTANCE_METHOD_INJECTION_BUILTIN(Memcache, Memcache::set);
  if (key.empty()) {
    raise_warning("Key cannot be empty");
    return false;
  }

  String serialized = memcache_prepare_for_storage(var, flag);

  memcached_return_t ret = memcached_set(&m_memcache,
                                        key.c_str(), key.length(),
                                        serialized.c_str(),
                                        serialized.length(),
                                        expire, flag);

  if (ret == MEMCACHED_SUCCESS) {
    return true;
  }

  return false;
}
开发者ID:ArPharazon,项目名称:hiphop-php,代码行数:22,代码来源:ext_memcache.cpp

示例2: INSTANCE_METHOD_INJECTION_BUILTIN

void c_MutableArrayIterator::t___construct(VRefParam array) {
  INSTANCE_METHOD_INJECTION_BUILTIN(MutableArrayIterator, MutableArrayIterator::__construct);
  if (m_valid) {
    MIterCtx& mi = marr();
    mi.~MIterCtx();
    m_valid = false;
  }
  Variant var(strongBind(array));
  TypedValue* tv = (TypedValue*)(&var);
  ASSERT(tv->m_type == KindOfRef);
  TypedValue* rtv = tv->m_data.pref->tv();
  if (rtv->m_type == KindOfArray) {
    MIterCtx& mi = marr();
    (void) new (&mi) MIterCtx(tv->m_data.pref);
    m_valid = mi.mArray().advance();
    if (!m_valid) mi.~MIterCtx();
  } else if (rtv->m_type == KindOfObject) {
    CStrRef ctxStr = hhvm
                     ? g_vmContext->getContextClassName()
                     : FrameInjection::GetClassName(true);
    if (rtv->m_data.pobj->isCollection()) {
      raise_error("Collection elements cannot be taken by reference");
    }
    bool isIterator;
    Object obj = rtv->m_data.pobj->iterableObject(isIterator);
    if (isIterator) {
      raise_error("An iterator cannot be used with foreach by reference");
    }
    Array iterArray = obj->o_toIterArray(ctxStr, true);
    ArrayData* ad = iterArray.detach();
    MIterCtx& mi = marr();
    (void) new (&mi) MIterCtx(ad);
    m_valid = mi.mArray().advance();
    if (!m_valid) mi.~MIterCtx();
  } else {
    raise_warning("Invalid argument supplied for foreach()");
  }
}
开发者ID:D-Ne0,项目名称:hiphop-php,代码行数:38,代码来源:ext_iterator.cpp

示例3: INSTANCE_METHOD_INJECTION_BUILTIN

/* SRC: classes/splobjectstorage.php line 102 */
bool c_SplObjectStorage::t_contains(CVarRef v_obj) {
  INSTANCE_METHOD_INJECTION_BUILTIN(SplObjectStorage, SplObjectStorage::contains);
  Variant v_object;

  ObjectData *obj_tmp UNUSED;
  if (x_is_object(v_obj)) {
    {
      {
        LOOP_COUNTER(1);
        ArrayIter iter3;
        {
          Variant map2 = m_storage;
          iter3.begin(map2, s_class_name);
          try {
            if (iter3.end()) goto break1;
          } catch (...) {
            iter3.reset();
            throw;
          }
        }
        do {
          LOOP_COUNTER_CHECK(1);
          iter3.second(v_object);
          {
            if (same(v_object, v_obj)) {
              {
                return true;
              }
            }
          }
        } while(iter3.next(), !iter3.end());
        break1:;
      }
    }
  }
  return false;
}
开发者ID:Hshun,项目名称:hiphop-php,代码行数:38,代码来源:splobjectstorage.cpp

示例4: ExtObjectData

c_Continuation::c_Continuation(const ObjectStaticCallbacks *cb) :
    ExtObjectData(cb),
#ifndef HHVM
    LABEL_INIT,
#endif
    m_index(-1LL),
    m_value(Variant::nullInit), m_received(Variant::nullInit),
    m_done(false), m_running(false), m_should_throw(false),
    m_isMethod(false), m_callInfo(NULL), m_extra(NULL)
#ifdef HHVM
    ,LABEL_INIT
#endif
{
  CPP_BUILTIN_CLASS_INIT(Continuation);
}
#undef LABEL_INIT

c_Continuation::~c_Continuation() {}

void c_Continuation::t___construct(
    int64 func, int64 extra, bool isMethod,
    CStrRef origFuncName, CVarRef obj, CArrRef args) {
  INSTANCE_METHOD_INJECTION_BUILTIN(Continuation, Continuation::__construct);
  m_callInfo     = (const CallInfo*) func;
  m_extra        = (void*) extra;
  m_isMethod     = isMethod;
  m_origFuncName = origFuncName;

  if (!obj.isNull()) {
    m_obj = obj.toObject();
    ASSERT(!m_obj.isNull());
  } else {
    ASSERT(m_obj.isNull());
  }
  m_args = args;
  ASSERT(m_callInfo);
}
开发者ID:hashaash,项目名称:hiphop-php,代码行数:37,代码来源:ext_continuation.cpp

示例5: INSTANCE_METHOD_INJECTION_BUILTIN

bool c_SQLite3::t_createfunction(CStrRef name, CVarRef callback,
                                 int64 argcount /* = -1 */) {
  INSTANCE_METHOD_INJECTION_BUILTIN(SQLite3, SQLite3::createfunction);
  validate();
  if (name.empty()) {
    return false;
  }
  if (!f_is_callable(callback)) {
    raise_warning("Not a valid callback function %s",
                  callback.toString().data());
    return false;
  }

  UserDefinedFuncPtr udf(new UserDefinedFunc());
  if (sqlite3_create_function(m_raw_db, name.data(), argcount, SQLITE_UTF8,
                              udf.get(), php_sqlite3_callback_func,
                              NULL, NULL) == SQLITE_OK) {
    udf->func = callback;
    udf->argc = argcount;
    m_udfs.push_back(udf);
    return true;
  }
  return false;
}
开发者ID:AviMoto,项目名称:hiphop-php,代码行数:24,代码来源:ext_sqlite3.cpp

示例6: INSTANCE_METHOD_INJECTION_BUILTIN

String c_Continuation::t_getorigfuncname() {
  INSTANCE_METHOD_INJECTION_BUILTIN(Continuation, Continuation::getorigfuncname);
  if (hhvm) {
    c_GenericContinuation* self = static_cast<c_GenericContinuation*>(this);
    VM::Class* vmClass = self->getVMCalledClass();
    if (vmClass != NULL && m_called_class.size() == 0) {
      m_called_class = vmClass->name()->data();
    }
  }
  if (m_called_class.size() == 0) {
    return m_origFuncName;
  }

  /*
    Replace the class name in m_origFuncName with the LSB class.  This
    produces more useful traces.
   */
  size_t method_pos = m_origFuncName.find("::");
  if (method_pos != std::string::npos) {
    return concat3(m_called_class, "::", m_origFuncName.substr(method_pos+2));
  } else {
    return m_origFuncName;
  }
}
开发者ID:hashaash,项目名称:hiphop-php,代码行数:24,代码来源:ext_continuation.cpp

示例7: INSTANCE_METHOD_INJECTION_BUILTIN

Variant c_Normalizer::t___destruct() {
  INSTANCE_METHOD_INJECTION_BUILTIN(Normalizer, Normalizer::__destruct);
  return null;
}
开发者ID:cdnewbee,项目名称:hiphop-php,代码行数:4,代码来源:ext_intl.cpp

示例8: INSTANCE_METHOD_INJECTION_BUILTIN

bool c_Memcache::t_pconnect(CStrRef host, int port /*= 0*/,
                            int timeout /*= 0*/,
                            int timeoutms /*= 0*/) {
  INSTANCE_METHOD_INJECTION_BUILTIN(Memcache, Memcache::pconnect);
  return t_connect(host, port, timeout, timeoutms);
}
开发者ID:sandrikaaa,项目名称:hiphop-php,代码行数:6,代码来源:ext_memcache.cpp

示例9: INSTANCE_METHOD_INJECTION_BUILTIN

/* SRC: classes/directory.php line 20 */
void c_Directory::t_close() {
  INSTANCE_METHOD_INJECTION_BUILTIN(Directory, Directory::close);
  x_closedir(toObject(m_handle));
}
开发者ID:canerdogan,项目名称:hiphop-php,代码行数:5,代码来源:directory.cpp


注:本文中的INSTANCE_METHOD_INJECTION_BUILTIN函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。