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


C++ NValue::castAsBigIntAndGetValue方法代码示例

本文整理汇总了C++中NValue::castAsBigIntAndGetValue方法的典型用法代码示例。如果您正苦于以下问题:C++ NValue::castAsBigIntAndGetValue方法的具体用法?C++ NValue::castAsBigIntAndGetValue怎么用?C++ NValue::castAsBigIntAndGetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NValue的用法示例。


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

示例1: getPrimaryKey

int64_t TupleTrackerManager::getPrimaryKey(std::string tableName, uint32_t tupleId){

	Table* table = voltDBEngine->getTable(tableName);

	TableTuple tuple = TableTuple(table->schema());

	tuple.move(table->dataPtrForTuple(tupleId));

	TableIndex *m_index = table->primaryKeyIndex();

	std::vector<int> column_indices_vector = m_index->getColumnIndices();

	std::vector<int>::iterator it = column_indices_vector.begin();
	NValue colValue;

	int i = 0;

	while (it != column_indices_vector.end()) // this is for non composite key
	{
		colValue = tuple.getNValue(*it);
		it++;
		i++;
	}

	return colValue.castAsBigIntAndGetValue();
	//return i;
	//return colValue.isNull();

	/*

	it = std::find(column_indices_vector.begin(), column_indices_vector.end(), tupleId);

		return (int) std:: distance(column_indices_vector.begin(), it);


	TableTuple outputTuple = ... // tuple for your output table
   TableTuple inputTuple = ... // tuple from your tracking table
   TableTuple origTuple = ... // tuple from the original PersistantTable

    foreach (inputTuple in tracking table) {
    // (1) Get offset from inputTuple and move the origTuple to that location
    origTuple.move(table->dataPtrForTuple(tupleId));

    // (2) Now iterate over the pkey column offsets and copy the values into the inputTuple
    int col_idx = 0;
    for (pkey_offset in m_index->getColumnIndices()) {
        NValue colValue = origTuple.getNValue(pkey_offset);
        outputTuple.setNValue(col_idx, colValue);
        col_idx++;
    }

    // (3) Insert outputTuple into output table
     }



	int colCount = (int)column_indices_vector.size();



	if (colCount < tupleId)
		return -1;


	return column_indices_vector[tupleId];




   //*/
}
开发者ID:jennieduggan,项目名称:h-store,代码行数:71,代码来源:TupleTracker.cpp

示例2: peekAsBigInt

 // cast as big int and peek at value. this is used by
 // index code that need a real number from a tuple.
 static inline int64_t peekAsBigInt(const NValue value) {
     return value.castAsBigIntAndGetValue();
 }
开发者ID:ifcharming,项目名称:voltdb2.1,代码行数:5,代码来源:ValuePeeker.hpp


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