Beispiel #1
0
int
matchrule(				/* check for a match on this rule */
	RULEHD	*rp
)
{
	ID	tmpid;
	int	gotmatch;
	int	i;

	if (rp->qflg & FL(Q_MTL)) {
		if (!matname[0])
			return(0);
		tmpid.number = 0;
		tmpid.name = matname;
		if (!matchid(&tmpid, &idm(rp)[Q_MTL]))
			return(0);
	}
	if (rp->qflg & FL(Q_MAP)) {
		if (!mapname[0])
			return(0);
		tmpid.number = 0;
		tmpid.name = mapname;
		if (!matchid(&tmpid, &idm(rp)[Q_MAP]))
			return(0);
	}
	if (rp->qflg & FL(Q_GRP)) {
		tmpid.number = 0;
		gotmatch = 0;
		for (i = 0; group[i][0]; i++) {
			tmpid.name = group[i];
			gotmatch |= matchid(&tmpid, &idm(rp)[Q_GRP]);
		}
		if (!gotmatch)
			return(0);
	}
	if (rp->qflg & FL(Q_OBJ)) {
		if (!objname[0])
			return(0);
		tmpid.number = 0;
		tmpid.name = objname;
		if (!matchid(&tmpid, &idm(rp)[Q_OBJ]))
			return(0);
	}
	if (rp->qflg & FL(Q_FAC)) {
		tmpid.name = NULL;
		tmpid.number = faceno;
		if (!matchid(&tmpid, &idm(rp)[Q_FAC]))
			return(0);
	}
	return(1);
}
Beispiel #2
0
int main(){
	IdMaster idm(10);
	while(true){
		auto ret = idm.GetId();
		if(ret != -1){
			std::cout << "Get Id " << ret << std::endl;
		}else{
			std::cout << "No To Use " << std::endl ;
			break;
		}
	}

	for(int i=0;i<10;i++){
		idm.PutId(i);
	}

	std::cout << "-================" << std::endl;

	while(true){
		auto ret = idm.GetId();
		if(ret != -1){
			std::cout << "Get Id " << ret << std::endl;
		}else{
			std::cout << "No To Use " << std::endl ;
			break;
		}
	}
}
void VwInvertedRootBox::DrawForeground(IVwGraphics * pvg, Rect rcSrc, Rect rcDst, int ysTopOfPage,
	int dysPageHeight, bool fDisplayPartialLines)
{
	VwInvertedDivMethods idm(this);
	idm.DrawForeground(pvg, rcSrc, rcDst, ysTopOfPage, dysPageHeight, fDisplayPartialLines);
}
void VwInvertedRootBox::AdjustInnerBoxes(IVwGraphics* pvg, VwSynchronizer * psync, BoxIntMultiMap * pmmbi,
	VwBox * pboxFirstNeedingInvalidate, VwBox * pboxLastNeedingInvalidate, bool fDoInvalidate)
{
	VwInvertedDivMethods idm(this);
	idm.AdjustInnerBoxes(pvg, psync, pmmbi, pboxFirstNeedingInvalidate, pboxLastNeedingInvalidate, fDoInvalidate);
}