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


C++ checkIndex函数代码示例

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


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

示例1: checkIndex

void GBufferedImage::fillRegion(double x, double y, double width, double height, int rgb) {
    checkIndex("fillRegion", x, y);
    checkIndex("fillRegion", x + width - 1, y + height - 1);
    checkColor("fillRegion", rgb);
    for (int r = (int) y; r < y + height; r++) {
        for (int c = (int) x; c < x + width; c++) {
            m_pixels[r][c] = rgb;
        }
    }
    pp->gbufferedimage_fillRegion(this, x, y, width, height, rgb);
}
开发者ID:Maximbndrnk,项目名称:cs-b-homework-1,代码行数:11,代码来源:gbufferedimage.cpp

示例2: require

const unsigned char* SqlStatement::ResultRow::getBlobField(int nField, int& nLen) const {
	require(mpParent->mpVM);
	checkIndex(nField);

	nLen = sqlite3_column_bytes(mpParent->mpVM, nField);
	return (const unsigned char*)sqlite3_column_blob(mpParent->mpVM, nField);
}
开发者ID:ibrman,项目名称:sqlite-marmalade,代码行数:7,代码来源:CppSqlWrapper.cpp

示例3: checkIndex

QModelIndex TreeModel::indexFromItemHelper(const TreeItem *needle,
    TreeItem *parentItem, const QModelIndex &parentIndex) const
{
    checkIndex(parentIndex);
    if (needle == parentItem)
        return parentIndex;
    for (int i = parentItem->rowCount(); --i >= 0; ) {
        TreeItem *childItem = parentItem->child(i);
        QModelIndex childIndex = index(i, 0, parentIndex);
        QModelIndex idx = indexFromItemHelper(needle, childItem, childIndex);
        checkIndex(idx);
        if (idx.isValid())
            return idx;
    }
    return QModelIndex();
}
开发者ID:OnlineCop,项目名称:qt-creator,代码行数:16,代码来源:treemodel.cpp

示例4: checkIndex

/*
 * Removes the element at the given index from the list,
 * shifting elements left to make room.
 * Throws a string exception if the index is out of bounds.
 */
void ArrayIntList::remove(int index) {
    checkIndex(index, 0, mysize - 1);
    for (int i = index; i < mysize - 1; i++) {
        elements[i] = elements[i + 1];
    }
    mysize--;
}
开发者ID:stepp,项目名称:stanford-cpp-library,代码行数:12,代码来源:ArrayIntList.cpp

示例5: checkIndex

NOX::Abstract::MultiVector&
LOCA::Extended::MultiVector::setBlock(
				   const LOCA::Extended::MultiVector& source, 
				   const std::vector<int>& index)
{
  // Verify dimensions are consistent
  if (source.numMultiVecRows != numMultiVecRows || 
      source.numScalarRows != numScalarRows) 
    globalData->locaErrorCheck->throwError(
	"LOCA::Extended::MultiVector::setBlock()",
	"Size of supplied multivector is incompatible with this multivector");
  if (static_cast<unsigned int>(source.numColumns) != index.size()) {
   globalData->locaErrorCheck->throwError(
	"LOCA::Extended::MultiVector::setBlock()",
	"Size of supplied index vector is incompatible with this multivector");
  }

  // Set block in each multivec
  for (int i=0; i<numMultiVecRows; i++)
    multiVectorPtrs[i]->setBlock(*(source.multiVectorPtrs[i]),index);

  // Set scalar vectors
  for (unsigned int j=0; j<index.size(); j++) {
    checkIndex("LOCA::Extended::MultiVector::augment()", index[j]);
    for (int i=0; i<numScalarRows; i++)
      (*scalarsPtr)(i,index[j]) = (*source.scalarsPtr)(i,j);
  }

  return *this;
}
开发者ID:gitter-badger,项目名称:quinoa,代码行数:30,代码来源:LOCA_Extended_MultiVector.C

示例6: isOpen

	bool Joystick::isOpen(int index)
	{
		if (!checkIndex(index))
			return false;

		return joysticks[index] != 0 ? true : false;
	}
开发者ID:PaulForey,项目名称:lovepd,代码行数:7,代码来源:Joystick.cpp

示例7: getTypeAt

Type Stack::getTypeAt(int index) const {
	if (!checkIndex(index)) {
		return kTypeNone;
	}

	switch (lua_type(&_luaState, index)) {
		case LUA_TNONE:
			return kTypeNone;
		case LUA_TNIL:
			return kTypeNil;
		case LUA_TBOOLEAN:
			return kTypeBoolean;
		case LUA_TNUMBER:
			return kTypeNumber;
		case LUA_TSTRING:
			return kTypeString;
		case LUA_TTABLE:
			return kTypeTable;
		case LUA_TFUNCTION:
			return kTypeFunction;
		case LUA_TUSERDATA:
			return kTypeUserType;
		default:
			warning("Unhandled Lua type: %s", lua_typename(&_luaState, index));
			return kTypeNone;
	}
}
开发者ID:ImperatorPrime,项目名称:xoreos,代码行数:27,代码来源:stack.cpp

示例8: checkIndex

bool LinkedList::addAll(int index, LinkedList* ll)
{
  checkIndex(index);
  
  void** new_ptr = static_cast<void**>(calloc(reserve_size + ll->reserve_size, PTR_SIZE));


  for ( int i = 0; i < index; ++i )
    {
      new_ptr[i] = ptr[i];
    }

  for ( int i = 0; i < ll->reserve_size; ++i )
    {
      new_ptr[i + index] = ll->ptr[i];
    }

  for ( int i = 0; i < reserve_size - index; ++i )
    {
      new_ptr[i + index + ll->reserve_size] = ptr[i + index];
    }

  free(ptr);

  ptr = new_ptr;

  reserve_size += ll->reserve_size;
}
开发者ID:KT1138,项目名称:LinkedList,代码行数:28,代码来源:LinkedList.cpp

示例9: checkIndex

 inline const AzTree *tree(int tx) const {
   checkIndex(tx, "tree"); 
   if (t[tx] == NULL) {
     return &empty_tree; 
   }
   return t[tx]; 
 }
开发者ID:0x0all,项目名称:Kaggle_CrowdFlower,代码行数:7,代码来源:AzTreeEnsemble.hpp

示例10: checkRow

// Return a copy of the column data specified by its index starting at 0
// (use the Column copy-constructor)
Column Statement::getColumn(const int aIndex)
{
    checkRow();
    checkIndex(aIndex);

    // Share the Statement Object handle with the new Column created
    return Column(mStmtPtr, aIndex);
}
开发者ID:ncorgan,项目名称:libpkmn,代码行数:10,代码来源:Statement.cpp

示例11: checkIndex

void LinkedList<T>::pop_front(){
    checkIndex(1);
    ListNode * temp = head->next;
    temp->next->prev = head;
    head->next = temp->next;
    delete temp;
    theSize--;
}
开发者ID:friketrike,项目名称:5421_A1,代码行数:8,代码来源:LinkedList.cpp

示例12: checkIndex

	uint32 Matrix::getBytePos(uint16 row, uint16 col) const
	{
		//check the row and column indicies
		checkIndex(row, col);

		//byte position = (row * (bytes per column * # columns)) + (column * bytes per column)
		return (row * (m_valuesTypeSize * m_numColumns)) + (col * m_valuesTypeSize);
	}
开发者ID:estump,项目名称:MSCL,代码行数:8,代码来源:Matrix.cpp

示例13: checkIndex

 virtual 
 inline T *tree_u(int tx) const {
   checkIndex(tx, "tree_u"); 
   if (t[tx] == NULL) {
     throw new AzException("AzTrTreeEnsemble::tree_u", "there is no tree"); 
   }
   return t[tx]; 
 }
开发者ID:NavinManaswi,项目名称:RGF_Hadoop,代码行数:8,代码来源:AzTrTreeEnsemble.hpp

示例14: checkIndex

int OnlineSession::normalizeDataSet(int index)
{
    checkIndex(index);

    dataSets[index]->normalize();

    return 0;
}
开发者ID:rahsan,项目名称:ONEX-Code,代码行数:8,代码来源:OnlineSession.cpp

示例15: checkLocked

void LinkedIntList::set(int index, int value) {
    checkLocked("set");
    checkIndex(index, 0, size() - 1);
    ListNode* current = front;
    for (int i = 0; i < index; i++) {
        current = current->next;
    }
    current->data = value;
}
开发者ID:ChenXuJasper,项目名称:stanford-cpp-library,代码行数:9,代码来源:LinkedIntList.cpp


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