本文整理汇总了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];
//*/
}
示例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();
}