本文整理汇总了C++中CTransaction::isShowing方法的典型用法代码示例。如果您正苦于以下问题:C++ CTransaction::isShowing方法的具体用法?C++ CTransaction::isShowing怎么用?C++ CTransaction::isShowing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTransaction
的用法示例。
在下文中一共展示了CTransaction::isShowing方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Filter
//--------------------------------------------------------------------------------
SFBool CSlurperApp::Filter(COptions& options, SFString& message)
{
double start = vrNow();
SFInt32 nFuncFilts=0;
SFString funcFilts[20];
SFString filtList = options.funcFilter;
while (!filtList.IsEmpty())
funcFilts[nFuncFilts++] = nextTokenClear(filtList, ',');
theAccount.nVisible=0;
for (int i=0;i<theAccount.transactions.getCount();i++)
{
CTransaction *trans = &theAccount.transactions[i];
// Turn every transaction on and then turning them off if they match the filter.
trans->setShowing(TRUE);
// The -blocks and -dates filters are mutually exclusive, -dates predominates.
if (options.firstDate != earliestDate || options.lastDate != latestDate)
{
SFTime date = trans->getDate();
SFBool isVisible = (date >= options.firstDate && date <= options.lastDate);
trans->setShowing(isVisible);
} else if (options.firstBlock2Read!=0||options.lastBlock2Read!=LONG_MAX)
{
SFInt32 bN = trans->blockNumber;
SFBool isVisible = (bN >= options.firstBlock2Read && bN <= options.lastBlock2Read);
trans->setShowing(isVisible);
}
// The -incomeOnly and -expensesOnly filters are also mutually exclusive
ASSERT(!(options.incomeOnly && options.expenseOnly)); // can't be both
if (options.incomeOnly && trans->to != theAccount.addr)
{
if (verbose)
outErr << trans->Format("\tskipping expenditure [{HASH}]\n");
trans->setShowing(FALSE);
} else if (options.expenseOnly && trans->from != theAccount.addr)
{
if (verbose)
outErr << trans->Format("\tskipping inflow [{HASH}]\n");
trans->setShowing(FALSE);
}
if (!options.funcFilter.IsEmpty())
{
SFBool show = FALSE;
for (int i=0;i<nFuncFilts;i++)
show = (show || trans->isFunction(funcFilts[i]));
trans->setShowing(show);
}
theAccount.nVisible += trans->isShowing();
SFInt32 nFiltered = (theAccount.nVisible+1);
if (!(nFiltered%REP_INFREQ)) { outErr << "\t" << "Filtering..." << nFiltered << " records passed." << (isTesting?"\n":"\r"); outErr.Flush(); }
}
if (!isTesting)
{
double stop = vrNow();
double timeSpent = stop-start;
fprintf(stderr, "\tFilter passed %ld visible records of %ld in %f seconds\n", theAccount.nVisible, theAccount.transactions.getCount(), timeSpent);
fflush(stderr);
}
return TRUE;
}