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


C++ dub_checksdata_n函数代码示例

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


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

示例1: b2SolverData__set_

/** Set attributes (key, value)
 * 
 */
static int b2SolverData__set_(lua_State *L) {

  b2SolverData *self = *((b2SolverData **)dub_checksdata_n(L, 1, "b2.SolverData"));
  const char *key = luaL_checkstring(L, 2);
  int key_h = dub_hash(key, 4);
  switch(key_h) {
    case 0: {
      if (DUB_ASSERT_KEY(key, "step")) break;
      self->step = **((b2TimeStep **)dub_checksdata_n(L, 3, "b2.TimeStep"));
      return 0;
    }
    case 2: {
      if (DUB_ASSERT_KEY(key, "positions")) break;
      dub_protect(L, 1, 3, "positions");
      self->positions = *((b2Position **)dub_checksdata_n(L, 3, "b2.Position"));
      return 0;
    }
    case 3: {
      if (DUB_ASSERT_KEY(key, "velocities")) break;
      dub_protect(L, 1, 3, "velocities");
      self->velocities = *((b2Velocity **)dub_checksdata_n(L, 3, "b2.Velocity"));
      return 0;
    }
  }
  if (lua_istable(L, 1)) {
    lua_rawset(L, 1);
  } else {
    luaL_error(L, KEY_EXCEPTION_MSG, key);
  }
  return 0;
}
开发者ID:lubyk,项目名称:b2,代码行数:34,代码来源:b2_SolverData.cpp

示例2: b2Manifold__set_

/** Set attributes (key, value)
 * 
 */
static int b2Manifold__set_(lua_State *L) {

  b2Manifold *self = *((b2Manifold **)dub_checksdata_n(L, 1, "b2.Manifold"));
  const char *key = luaL_checkstring(L, 2);
  int key_h = dub_hash(key, 9);
  switch(key_h) {
    case 3: {
      if (DUB_ASSERT_KEY(key, "localNormal")) break;
      self->localNormal = **((b2Vec2 **)dub_checksdata_n(L, 3, "b2.Vec2"));
      return 0;
    }
    case 8: {
      if (DUB_ASSERT_KEY(key, "localPoint")) break;
      self->localPoint = **((b2Vec2 **)dub_checksdata_n(L, 3, "b2.Vec2"));
      return 0;
    }
    case 0: {
      if (DUB_ASSERT_KEY(key, "type")) break;
      self->type = (b2Manifold::Type)luaL_checkint(L, 3);
      return 0;
    }
    case 7: {
      if (DUB_ASSERT_KEY(key, "pointCount")) break;
      self->pointCount = luaL_checkint(L, 3);
      return 0;
    }
  }
  if (lua_istable(L, 1)) {
    lua_rawset(L, 1);
  } else {
    luaL_error(L, KEY_EXCEPTION_MSG, key);
  }
  return 0;
}
开发者ID:lubyk,项目名称:b2,代码行数:37,代码来源:b2_Manifold.cpp

示例3: b2CircleShape__set_

/** Set attributes (key, value)
 * 
 */
static int b2CircleShape__set_(lua_State *L) {

  b2CircleShape *self = *((b2CircleShape **)dub_checksdata_n(L, 1, "b2.CircleShape"));
  const char *key = luaL_checkstring(L, 2);
  int key_h = dub_hash(key, 7);
  switch(key_h) {
    case 1: {
      if (DUB_ASSERT_KEY(key, "m_p")) break;
      self->m_p = **((b2Vec2 **)dub_checksdata_n(L, 3, "b2.Vec2"));
      return 0;
    }
    case 2: {
      if (DUB_ASSERT_KEY(key, "m_type")) break;
      self->m_type = (b2Shape::Type)luaL_checkint(L, 3);
      return 0;
    }
    case 4: {
      if (DUB_ASSERT_KEY(key, "m_radius")) break;
      self->m_radius = luaL_checknumber(L, 3);
      return 0;
    }
  }
  if (lua_istable(L, 1)) {
    lua_rawset(L, 1);
  } else {
    luaL_error(L, KEY_EXCEPTION_MSG, key);
  }
  return 0;
}
开发者ID:lubyk,项目名称:b2,代码行数:32,代码来源:b2_CircleShape.cpp

示例4: ofKeyEventArgs__get_

/** Get attributes (key)
 * 
 */
static int ofKeyEventArgs__get_(lua_State *L) {

  ofKeyEventArgs *self = *((ofKeyEventArgs **)dub_checksdata_n(L, 1, "ofKeyEventArgs", true));
  const char *key = luaL_checkstring(L, 2);
  // <self> "key" <mt>
  // rawget(mt, key)
  lua_pushvalue(L, 2);
  // <self> "key" <mt> "key"
  lua_rawget(L, -2);
  if (!lua_isnil(L, -1)) {
    // Found method.
    return 1;
  } else {
    // Not in mt = attribute access.
    lua_pop(L, 2);
  }
  int key_h = dub_hash(key, 2);
  switch(key_h) {
    case 0: {
      if (DUB_ASSERT_KEY(key, "type")) break;
      dub_pushudata(L, &self->type, "enum ofKeyEventArgs::Type", false);
      return 1;
    }
    case 1: {
      if (DUB_ASSERT_KEY(key, "key")) break;
      lua_pushnumber(L, self->key);
      return 1;
    }
  }
  return 0;
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:34,代码来源:ofKeyEventArgs.cpp

示例5: lua_pushnumber

QVariant DataSource::headerData(int section, Qt::Orientation orientation, int role) const {
  lua_State *L = const_cast<lua_State*>(dub_L);
  if (role == Qt::DisplayRole) {
    if (!dub_pushcallback("header")) return QVariant();
    lua_pushnumber(L, section + 1);
    lua_pushnumber(L, orientation);
    // <func> <self> <section> <orientation>
    if (!dub_call(3, 1)) {
      return QVariant();
    }
    QVariant res = variantFromLua(L, -1);
    lua_pop(L, 1);
    return res;
  } else if (role == Qt::BackgroundRole || role == Qt::ForegroundRole) {
    if (!dub_pushcallback(
         role == Qt::BackgroundRole ? "background" : "foreground"
        )) return QVariant();
    lua_pushnumber(L, section + 1);
    // <func> <self> <section>
    if (!dub_call(2, 1)) {
      return QVariant();
    }
    if (!lua_isnil(L, -1)) {
      try {
        Color *color = *((Color **)dub_checksdata_n(L, -1, "mimas.Color"));
        QVariant res = *color;
        lua_pop(L, 1);
        return res;
      } catch(dub::Exception) {
        return QVariant();
      }
    }
  }
  return QVariant();
}
开发者ID:lubyk,项目名称:mimas,代码行数:35,代码来源:DataSource.cpp

示例6: b2Color__set_

/** Set attributes (key, value)
 *
 */
static int b2Color__set_(lua_State *L) {

    b2Color *self = *((b2Color **)dub_checksdata_n(L, 1, "b2.Color"));
    const char *key = luaL_checkstring(L, 2);
    int key_h = dub_hash(key, 3);
    switch(key_h) {
    case 0: {
        if (DUB_ASSERT_KEY(key, "r")) break;
        self->r = luaL_checknumber(L, 3);
        return 0;
    }
    case 1: {
        if (DUB_ASSERT_KEY(key, "g")) break;
        self->g = luaL_checknumber(L, 3);
        return 0;
    }
    case 2: {
        if (DUB_ASSERT_KEY(key, "b")) break;
        self->b = luaL_checknumber(L, 3);
        return 0;
    }
    }
    if (lua_istable(L, 1)) {
        lua_rawset(L, 1);
    } else {
        luaL_error(L, KEY_EXCEPTION_MSG, key);
    }
    return 0;
}
开发者ID:lubyk,项目名称:b2,代码行数:32,代码来源:b2_Color.cpp

示例7: TableView__cast_

/** Cast (class_name)
 * 
 */
static int TableView__cast_(lua_State *L) {

  TableView *self = *((TableView **)dub_checksdata_n(L, 1, "mimas.TableView"));
  const char *key = luaL_checkstring(L, 2);
  void **retval__ = (void**)lua_newuserdata(L, sizeof(void*));
  int key_h = dub_hash(key, 3);
  switch(key_h) {
    case 0: {
      if (DUB_ASSERT_KEY(key, "mimas.QTableView")) break;
      *retval__ = static_cast<QTableView *>(self);
      return 1;
    }
    case 1: {
      if (DUB_ASSERT_KEY(key, "mimas.QWidget")) break;
      *retval__ = static_cast<QWidget *>(self);
      return 1;
    }
    case 2: {
      if (DUB_ASSERT_KEY(key, "mimas.QObject")) break;
      *retval__ = static_cast<QObject *>(self);
      return 1;
    }
  }
  return 0;
}
开发者ID:lubyk,项目名称:mimas,代码行数:28,代码来源:mimas_TableView.cpp

示例8: ofVideoGrabber__cast_

/** Cast (class_name)
 * 
 */
static int ofVideoGrabber__cast_(lua_State *L) {

  ofVideoGrabber *self = *((ofVideoGrabber **)dub_checksdata_n(L, 1, "ofVideoGrabber"));
  const char *key = luaL_checkstring(L, 2);
  void **retval__ = (void**)lua_newuserdata(L, sizeof(void*));
  int key_h = dub_hash(key, 7);
  switch(key_h) {
    case 3: {
      if (DUB_ASSERT_KEY(key, "ofBaseVideoGrabber")) break;
      *retval__ = static_cast<ofBaseVideoGrabber *>(self);
      return 1;
    }
    case 5: {
      if (DUB_ASSERT_KEY(key, "ofBaseVideo")) break;
      *retval__ = static_cast<ofBaseVideo *>(self);
      return 1;
    }
    case 1: {
      if (DUB_ASSERT_KEY(key, "ofBaseUpdates")) break;
      *retval__ = static_cast<ofBaseUpdates *>(self);
      return 1;
    }
    case 6: {
      if (DUB_ASSERT_KEY(key, "ofBaseVideoDraws")) break;
      *retval__ = static_cast<ofBaseVideoDraws *>(self);
      return 1;
    }
  }
  return 0;
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:33,代码来源:ofVideoGrabber.cpp

示例9: MenuBar__cast_

/** Cast (class_name)
 * 
 */
static int MenuBar__cast_(lua_State *L) {

  MenuBar *self = *((MenuBar **)dub_checksdata_n(L, 1, "mimas.MenuBar"));
  const char *key = luaL_checkstring(L, 2);
  void **retval__ = (void**)lua_newuserdata(L, sizeof(void*));
  int key_h = dub_hash(key, 8);
  switch(key_h) {
    case 6: {
      if (DUB_ASSERT_KEY(key, "mimas.QMenuBar")) break;
      *retval__ = static_cast<QMenuBar *>(self);
      return 1;
    }
    case 2: {
      if (DUB_ASSERT_KEY(key, "mimas.QWidget")) break;
      *retval__ = static_cast<QWidget *>(self);
      return 1;
    }
    case 5: {
      if (DUB_ASSERT_KEY(key, "mimas.QObject")) break;
      *retval__ = static_cast<QObject *>(self);
      return 1;
    }
  }
  return 0;
}
开发者ID:lubyk,项目名称:mimas,代码行数:28,代码来源:mimas_MenuBar.cpp

示例10: b2ClipVertex__get_

/** Get attributes (key)
 * 
 */
static int b2ClipVertex__get_(lua_State *L) {

  b2ClipVertex *self = *((b2ClipVertex **)dub_checksdata_n(L, 1, "b2.ClipVertex", true));
  const char *key = luaL_checkstring(L, 2);
  // <self> "key" <mt>
  // rawget(mt, key)
  lua_pushvalue(L, 2);
  // <self> "key" <mt> "key"
  lua_rawget(L, -2);
  if (!lua_isnil(L, -1)) {
    // Found method.
    return 1;
  } else {
    // Not in mt = attribute access.
    lua_pop(L, 2);
  }
  int key_h = dub_hash(key, 2);
  switch(key_h) {
    case 0: {
      if (DUB_ASSERT_KEY(key, "v")) break;
      dub_pushudata(L, &self->v, "b2.Vec2", false);
      return 1;
    }
    case 1: {
      if (DUB_ASSERT_KEY(key, "id")) break;
      dub_pushudata(L, &self->id, "b2.ContactID", false);
      return 1;
    }
  }
  return 0;
}
开发者ID:lubyk,项目名称:b2,代码行数:34,代码来源:b2_ClipVertex.cpp

示例11: ofVideoGrabber__get_

/** Get attributes (key)
 * 
 */
static int ofVideoGrabber__get_(lua_State *L) {

  ofVideoGrabber *self = *((ofVideoGrabber **)dub_checksdata_n(L, 1, "ofVideoGrabber", true));
  const char *key = luaL_checkstring(L, 2);
  // <self> "key" <mt>
  // rawget(mt, key)
  lua_pushvalue(L, 2);
  // <self> "key" <mt> "key"
  lua_rawget(L, -2);
  if (!lua_isnil(L, -1)) {
    // Found method.
    return 1;
  } else {
    // Not in mt = attribute access.
    lua_pop(L, 2);
  }
  int key_h = dub_hash(key, 2);
  switch(key_h) {
    case 1: {
      if (DUB_ASSERT_KEY(key, "height")) break;
      lua_pushnumber(L, self->height);
      return 1;
    }
    case 0: {
      if (DUB_ASSERT_KEY(key, "width")) break;
      lua_pushnumber(L, self->width);
      return 1;
    }
  }
  return 0;
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:34,代码来源:ofVideoGrabber.cpp

示例12: b2Shape__get_

/** Get attributes (key)
 * 
 */
static int b2Shape__get_(lua_State *L) {

  b2Shape *self = *((b2Shape **)dub_checksdata_n(L, 1, "b2.Shape", true));
  const char *key = luaL_checkstring(L, 2);
  // <self> "key" <mt>
  // rawget(mt, key)
  lua_pushvalue(L, 2);
  // <self> "key" <mt> "key"
  lua_rawget(L, -2);
  if (!lua_isnil(L, -1)) {
    // Found method.
    return 1;
  } else {
    // Not in mt = attribute access.
    lua_pop(L, 2);
  }
  int key_h = dub_hash(key, 5);
  switch(key_h) {
    case 2: {
      if (DUB_ASSERT_KEY(key, "m_type")) break;
      lua_pushnumber(L, self->m_type);
      return 1;
    }
    case 0: {
      if (DUB_ASSERT_KEY(key, "m_radius")) break;
      lua_pushnumber(L, self->m_radius);
      return 1;
    }
  }
  return 0;
}
开发者ID:lubyk,项目名称:b2,代码行数:34,代码来源:b2_Shape.cpp

示例13: HBoxLayout__cast_

/** Cast (class_name)
 * 
 */
static int HBoxLayout__cast_(lua_State *L) {

  HBoxLayout *self = *((HBoxLayout **)dub_checksdata_n(L, 1, "mimas.HBoxLayout"));
  const char *key = luaL_checkstring(L, 2);
  void **retval__ = (void**)lua_newuserdata(L, sizeof(void*));
  int key_h = dub_hash(key, 4);
  switch(key_h) {
    case 3: {
      if (DUB_ASSERT_KEY(key, "mimas.QBoxLayout")) break;
      *retval__ = static_cast<QBoxLayout *>(self);
      return 1;
    }
    case 0: {
      if (DUB_ASSERT_KEY(key, "mimas.QLayout")) break;
      *retval__ = static_cast<QLayout *>(self);
      return 1;
    }
    case 1: {
      if (DUB_ASSERT_KEY(key, "mimas.QObject")) break;
      *retval__ = static_cast<QObject *>(self);
      return 1;
    }
  }
  return 0;
}
开发者ID:lubyk,项目名称:mimas,代码行数:28,代码来源:mimas_HBoxLayout.cpp

示例14: b2ContactID__get_

/** Get attributes (key)
 * 
 */
static int b2ContactID__get_(lua_State *L) {

  b2ContactID *self = *((b2ContactID **)dub_checksdata_n(L, 1, "b2.ContactID", true));
  const char *key = luaL_checkstring(L, 2);
  // <self> "key" <mt>
  // rawget(mt, key)
  lua_pushvalue(L, 2);
  // <self> "key" <mt> "key"
  lua_rawget(L, -2);
  if (!lua_isnil(L, -1)) {
    // Found method.
    return 1;
  } else {
    // Not in mt = attribute access.
    lua_pop(L, 2);
  }
  int key_h = dub_hash(key, 5);
  switch(key_h) {
    case 3: {
      if (DUB_ASSERT_KEY(key, "cf")) break;
      dub_pushudata(L, &self->cf, "b2.ContactFeature", false);
      return 1;
    }
    case 0: {
      if (DUB_ASSERT_KEY(key, "key")) break;
      lua_pushnumber(L, self->key);
      return 1;
    }
  }
  return 0;
}
开发者ID:lubyk,项目名称:b2,代码行数:34,代码来源:b2_ContactID.cpp

示例15: btPolyhedralConvexShape__cast_

/** Cast (class_name)
 *
 */
static int btPolyhedralConvexShape__cast_(lua_State *L) {

    btPolyhedralConvexShape *self = *((btPolyhedralConvexShape **)dub_checksdata_n(L, 1, "bt.PolyhedralConvexShape"));
    const char *key = luaL_checkstring(L, 2);
    void **retval__ = (void**)lua_newuserdata(L, sizeof(void*));
    int key_h = dub_hash(key, 3);
    switch(key_h) {
    case 0: {
        if (DUB_ASSERT_KEY(key, "bt.ConvexInternalShape")) break;
        *retval__ = static_cast<btConvexInternalShape *>(self);
        return 1;
    }
    case 1: {
        if (DUB_ASSERT_KEY(key, "bt.ConvexShape")) break;
        *retval__ = static_cast<btConvexShape *>(self);
        return 1;
    }
    case 2: {
        if (DUB_ASSERT_KEY(key, "bt.CollisionShape")) break;
        *retval__ = static_cast<btCollisionShape *>(self);
        return 1;
    }
    }
    return 0;
}
开发者ID:lubyk,项目名称:old_bt,代码行数:28,代码来源:bt_PolyhedralConvexShape.cpp


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