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


C++ CTransaction::isFunction方法代码示例

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


在下文中一共展示了CTransaction::isFunction方法的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;
}
开发者ID:ahuachen,项目名称:ethslurp,代码行数:71,代码来源:ethslurp.cpp


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