• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ ValueSet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1:

bool 
UserManager::Logout( User *pUser, SsapiResponder *pResponder ){
	
	pUser->BuildYourselfFromYourValueSet();

	DesignatorId		id =  pUser->GetDesignatorId();
	User				*pManagedObject = (User *)GetManagedObject( &id );
	U32					rc;
	ValueSet			*pReturnSet = new ValueSet;

	if( pManagedObject ){
		rc = SSAPI_RC_SUCCESS;
		pManagedObject->DeleteOpenSession( pResponder->GetSessionID() );
		//TBDGAI if we want to show who is present, we need an event here
	}
	else
		rc = SSAPI_EXCEPTION_SECURITY;

	ValueSet	*pRc = new ValueSet;
	pRc->AddInt(rc, SSAPI_RETURN_STATUS );
	if( rc != SSAPI_RC_SUCCESS )
		pRc->AddInt( CTS_SSAPI_USER_WAS_NOT_LOGGED_IN, SSAPI_EXCEPTION_STRING_ID );
	pReturnSet->AddValue( pRc, SSAPI_RETURN_STATUS_SET );

	pResponder->Respond( pReturnSet, TRUE );

	// username as a parameter
	LogEvent( CTS_SSAPI_EVENT_USER_LOGGED_OUT, pManagedObject->GetUserName() );

	delete pReturnSet;
	delete pRc;
	return true;
}
开发者ID:JoeAltmaier,项目名称:Odyssey,代码行数:33,代码来源:UserManager.cpp


示例2: findAllFunctionPointersInValue

void FPInferredTargetsAnalysis::findAllFunctionPointersInValue(Value* V, ValueContextPairList& worklist, ValueSet& visited) {
  if (!visited.count(V)) {
    visited.insert(V);
    if (GlobalVariable* G = dyn_cast<GlobalVariable>(V)) {
      SDEBUG("soaap.analysis.infoflow.fp.infer", 3, dbgs() << INDENT_1 << "Global var: " << G->getName() << "\n");
      // don't look in the llvm.global.annotations array
      if (G->getName() != "llvm.global.annotations" && G->hasInitializer()) {
        findAllFunctionPointersInValue(G->getInitializer(), worklist, visited);
      }
    }
    else if (ConstantArray* CA = dyn_cast<ConstantArray>(V)) {
      SDEBUG("soaap.analysis.infoflow.fp.infer", 3, dbgs() << INDENT_1 << "Constant array, num of operands: " << CA->getNumOperands() << "\n");
      for (int i=0; i<CA->getNumOperands(); i++) {
        Value* V2 = CA->getOperand(i)->stripInBoundsOffsets();
        findAllFunctionPointersInValue(V2, worklist, visited);
      }
    }
    else if (Function* F = dyn_cast<Function>(V)) {
      fpTargetsUniv.insert(F);
      SDEBUG("soaap.analysis.infoflow.fp.infer", 3, dbgs() << INDENT_1 << "Func: " << F->getName() << "\n");
      setBitVector(state[ContextUtils::NO_CONTEXT][V], F);
      addToWorklist(V, ContextUtils::NO_CONTEXT, worklist);
    }
    else if (ConstantStruct* S = dyn_cast<ConstantStruct>(V)) {
      SDEBUG("soaap.analysis.infoflow.fp.infer", 3, dbgs() << INDENT_1 << "Struct, num of fields: " << S->getNumOperands() << "\n");
      for (int j=0; j<S->getNumOperands(); j++) {
        Value* V2 = S->getOperand(j)->stripInBoundsOffsets();
        findAllFunctionPointersInValue(V2, worklist, visited);
      }
    }
  }
}
开发者ID:CTSRD-SOAAP,项目名称:soaap,代码行数:32,代码来源:FPInferredTargetsAnalysis.cpp


示例3: test_set_diff

void test_set_diff(Ardb& db)
{
	DBID dbid = 0;
	db.SClear(dbid, "myset1");
	db.SClear(dbid, "myset2");
	db.SClear(dbid, "myset3");
	db.SAdd(dbid, "myset1", "a");
	db.SAdd(dbid, "myset1", "b");
	db.SAdd(dbid, "myset1", "c");
	db.SAdd(dbid, "myset1", "d");
	db.SAdd(dbid, "myset2", "c");
	db.SAdd(dbid, "myset3", "a");
	db.SAdd(dbid, "myset3", "c");
	db.SAdd(dbid, "myset3", "e");

	std::string str;
	SliceArray keys;
	keys.push_back("myset1");
	keys.push_back("myset2");
	keys.push_back("myset3");
	ValueSet values;
	db.SDiff(dbid, keys, values);
	CHECK_FATAL(values.size() != 2, "Sdiff failed:");
	CHECK_FATAL(values.begin()->ToString(str) != "b", "Sdiff store failed:");
	//CHECK_FATAL(FATAL, values[1] != "d") << "Sdiff store failed:";
	int len = db.SDiffStore(dbid, "myset2", keys);
	CHECK_FATAL(len != 2, "SDiffStore myset2 failed:%d", len);
	len = db.SCard(dbid, "myset2");
	CHECK_FATAL(len != 2, "SDiffStore myset2 failed:%d", len);
}
开发者ID:ericcapricorn,项目名称:ardb,代码行数:30,代码来源:sets_testcase.cpp


示例4: test_set_inter

void test_set_inter(Ardb& db)
{
	DBID dbid = 0;
	db.SClear(dbid, "myset1");
	db.SClear(dbid, "myset2");
	db.SClear(dbid, "myset3");
	db.SAdd(dbid, "myset1", "a");
	db.SAdd(dbid, "myset1", "b");
	db.SAdd(dbid, "myset1", "c");
	db.SAdd(dbid, "myset1", "d");
	db.SAdd(dbid, "myset2", "c");
	db.SAdd(dbid, "myset3", "a");
	db.SAdd(dbid, "myset3", "c");
	db.SAdd(dbid, "myset3", "e");

	SliceArray keys;
	keys.push_back("myset1");
	keys.push_back("myset2");
	keys.push_back("myset3");
	ValueSet values;
	db.SInter(dbid, keys, values);
	std::string str;
	CHECK_FATAL( values.size() != 1, "Sinter failed:");
	CHECK_FATAL(values.begin()->ToString(str) != "c", "Sinter store failed:");
	db.SInterStore(dbid, "myset2", keys);
	CHECK_FATAL( db.SCard(dbid, "myset2") != 1, "SInterStore myset2 failed:");
}
开发者ID:ericcapricorn,项目名称:ardb,代码行数:27,代码来源:sets_testcase.cpp


示例5: mParamUnits

/*! TODO:
*/
MHIModule::MHIModule()
	:Module(MODULE_NAME, MODULE_DISPLAY_NAME, MHIMODULE_VERSION),
	mParamUnits(PARAMETER_NAME_UNITS, Variable::eVariableTypeString, "Duration units", "Units are either seconds or frames", false),
	mParamDuration(PARAMETER_NAME_DURATION, Variable::eVariableTypeDouble, "Duration", "Duration parameter for MHI, in seconds or in frames", true)
{
	mShortDescription = "Module for computing motion history image";
	mLongDescription = "This module computes a motion history image from binary images";

	ValueSet lUnitsValues;
	lUnitsValues.insert(Value("frames", "Frames", "Elapsed time is counted in frames"));
	lUnitsValues.insert(Value("seconds", "Seconds", "Elapsed time is counted in seconds"));

	mParamUnits.setPossibleValues(lUnitsValues);

	mParamUnits.setValueStr("frames");
	mParamDuration.setValue(100);
	mParamDuration.setMinValue("0");
	mParamDuration.setMaxValue("10000");

	newParameter(mParamUnits);
	newParameter(mParamDuration);

	mInputSlotMask = newSlot(new ModuleSlot(this, INPUT_SLOT_NAME_MASK, INPUT_SLOT_DISPLAYNAME_MASK, "Input mask image used to compute MHI"));
	mOutputSlotMHI = newSlot(new ModuleSlot(this, OUTPUT_SLOT_NAME_MHI, OUTPUT_SLOT_DISPLAYNAME_MHI, "Output MHI image (floating point)", &mOutputMHI));
	mOutputSlotMHIGray = newSlot(new ModuleSlot(this, OUTPUT_SLOT_NAME_MHI_GRAY, OUTPUT_SLOT_DISPLAYNAME_MHI_GRAY, "Output MHI image (gray scale image)", &mOutputMHIGray));

  mOutputMHIIpl = NULL;
  mOutputMHIGrayIpl = NULL;
	mOutputMHI = NULL;
	mOutputMHIGray = NULL;
	mEllapsedTime = 0;
}
开发者ID:fjean,项目名称:vipers,代码行数:34,代码来源:MHI.cpp


示例6: if

bool 
UserManager::ChangePassword( ValueSet &requestParms, SsapiResponder *pResponder ){

	DesignatorId				id;
	UnicodeString				oldPassword, newPassword, password;
	bool						rc = true;
	ManagedObject				*pManagedObject;
	
	if( !requestParms.GetGenericValue( (char *)&id, sizeof(id), SSAPI_USER_MANAGER_CHANGE_PASSWORD_OBJECT_ID ) )
		rc = false;
	else if( !requestParms.GetString( SSAPI_USER_MANAGER_CHANGE_PASSWORD_OLD_PASSWORD, &oldPassword ) )
		rc = false;
	else if(!requestParms.GetString( SSAPI_USER_MANAGER_CHANGE_PASSWORD_NEW_PASSWORD, &newPassword ) )
		rc = false;

	if( !rc )
		return pResponder->RespondToRequest( SSAPI_EXCEPTION_INVALID_PARAMETER, CTS_SSAPI_INVALID_PARAM_EXCEPTION );

	if( !( pManagedObject = GetManagedObject( &id ) ) )
		return pResponder->RespondToRequest( SSAPI_EXCEPTION_INVALID_PARAMETER, CTS_SSAPI_OBJECT_DOES_NOT_EXIST_EXCEPTION );
	
	pManagedObject->BuildYourValueSet();
	pManagedObject->GetString( SSAPI_USER_FID_PASSWORD, &password );
	pManagedObject->Clear();
	if( (password == oldPassword) == false )
		return pResponder->RespondToRequest( SSAPI_EXCEPTION_SECURITY, CTS_SSAPI_SECURITY_INVALID_PASSWORD );

	User *pUser = new User(0);
	pUser->AddString( &newPassword, SSAPI_USER_FID_PASSWORD );
	pUser->AddGenericValue( (char *)&id, sizeof(id), SSAPI_OBJECT_FID_ID );
	rc = ModifyUser( pUser, pResponder );
	delete pUser;

	return rc;
}
开发者ID:JoeAltmaier,项目名称:Odyssey,代码行数:35,代码来源:UserManager.cpp


示例7: join

PointerAnalysis::ValueSet PointerAnalysis::join(PointerAnalysis::ValueSet a, PointerAnalysis::ValueSet b)
{
	ValueSet r;
	for (auto i : a)
		if (b.count(i))
			r.insert(i);
	return r;
}
开发者ID:cwz920716,项目名称:Combining-Static-and-Dynamic-Bound-Checking-Using-LLVM-Framework-and-SoftBound,代码行数:8,代码来源:PointerAnalysis.cpp


示例8: merge

PointerAnalysis::ValueSet PointerAnalysis::merge(PointerAnalysis::ValueSet a, PointerAnalysis::ValueSet b)
{
	ValueSet r;
	for (auto i : a)
		r.insert(i);
	for (auto i : b)
		r.insert(i);
	return r;
}
开发者ID:cwz920716,项目名称:Combining-Static-and-Dynamic-Bound-Checking-Using-LLVM-Framework-and-SoftBound,代码行数:9,代码来源:PointerAnalysis.cpp


示例9: unEqual

bool PointerAnalysis::unEqual (const ValueSet &a, const ValueSet &b) {
	if (a.size() != b.size())
		return true;

	for (auto const& e : a)
		if (b.count(e) == 0)
			return true;

	return false;
}
开发者ID:cwz920716,项目名称:Combining-Static-and-Dynamic-Bound-Checking-Using-LLVM-Framework-and-SoftBound,代码行数:10,代码来源:PointerAnalysis.cpp


示例10:

bool 
StatusReporterInterface::BuildYourselfFromYourValueSet( ValueSet &vs ){

	int		rc = 1;

	rc &= vs.GetInt( SSAPI_OBJECT_FID_STATE, &m_state );
	rc &= vs.GetU32( SSAPI_OBJECT_FID_STATE_STRING, &m_stateString );

	return rc? true : false;
}
开发者ID:JoeAltmaier,项目名称:Odyssey,代码行数:10,代码来源:StatusReporterInterface.cpp


示例11: CallArgsFromVp

bool
SetObject::construct(JSContext* cx, unsigned argc, Value* vp)
{
    CallArgs args = CallArgsFromVp(argc, vp);

    if (!ThrowIfNotConstructing(cx, args, "Set"))
        return false;

    RootedObject proto(cx);
    RootedObject newTarget(cx, &args.newTarget().toObject());
    if (!GetPrototypeFromConstructor(cx, newTarget, &proto))
        return false;

    Rooted<SetObject*> obj(cx, SetObject::create(cx, proto));
    if (!obj)
        return false;

    if (!args.get(0).isNullOrUndefined()) {
        RootedValue iterable(cx, args[0]);
        bool optimized = false;
        if (!IsOptimizableInitForSet<GlobalObject::getOrCreateSetPrototype, isBuiltinAdd>(cx, obj, iterable, &optimized))
            return false;

        if (optimized) {
            RootedValue keyVal(cx);
            Rooted<HashableValue> key(cx);
            ValueSet* set = obj->getData();
            ArrayObject* array = &iterable.toObject().as<ArrayObject>();
            for (uint32_t index = 0; index < array->getDenseInitializedLength(); ++index) {
                keyVal.set(array->getDenseElement(index));
                MOZ_ASSERT(!keyVal.isMagic(JS_ELEMENTS_HOLE));

                if (!key.setValue(cx, keyVal))
                    return false;
                if (!WriteBarrierPost(cx->runtime(), obj, keyVal) ||
                    !set->put(key))
                {
                    ReportOutOfMemory(cx);
                    return false;
                }
            }
        } else {
            FixedInvokeArgs<1> args2(cx);
            args2[0].set(args[0]);

            RootedValue thisv(cx, ObjectValue(*obj));
            if (!CallSelfHostedFunction(cx, cx->names().SetConstructorInit, thisv, args2, args2.rval()))
                return false;
        }
    }

    args.rval().setObject(*obj);
    return true;
}
开发者ID:bitwiseworks,项目名称:mozilla-os2,代码行数:54,代码来源:MapObject.cpp


示例12:

bool
SetObject::keys(JSContext* cx, HandleObject obj, JS::MutableHandle<GCVector<JS::Value>> keys)
{
    ValueSet* set = obj->as<SetObject>().getData();
    if (!set)
        return false;

    for (ValueSet::Range r = set->all(); !r.empty(); r.popFront()) {
        if (!keys.append(r.front().get()))
            return false;
    }

    return true;
}
开发者ID:cstipkovic,项目名称:gecko-dev,代码行数:14,代码来源:MapObject.cpp


示例13: replaceUndefsWithNull

void Preparer::replaceUndefsWithNull(User *I, ValueSet &Replaced) {
  if (Replaced.count(I))
    return;
  Replaced.insert(I);
  for (User::op_iterator OI = I->op_begin(); OI != I->op_end(); ++OI) {
    Value *V = OI->get();
    if (isa<UndefValue>(V) && V->getType()->isPointerTy()) {
      OI->set(ConstantPointerNull::get(cast<PointerType>(V->getType())));
    }
    if (User *I2 = dyn_cast<User>(V)) {
      replaceUndefsWithNull(I2, Replaced);
    }
  }
}
开发者ID:alias-checker,项目名称:dyn-aa,代码行数:14,代码来源:Preparer.cpp


示例14: ReportOutOfMemory

SetObject*
SetObject::create(JSContext* cx)
{
    SetObject* obj = NewBuiltinClassInstance<SetObject>(cx);
    if (!obj)
        return nullptr;

    ValueSet* set = cx->new_<ValueSet>(cx->runtime());
    if (!set || !set->init()) {
        js_delete(set);
        ReportOutOfMemory(cx);
        return nullptr;
    }
    obj->setPrivate(set);
    return obj;
}
开发者ID:paulmadore,项目名称:luckyde,代码行数:16,代码来源:MapObject.cpp


示例15: test

bool PointerAnalysis::test(Value *v, ValueSet &set)
{
	if (set.count(v) == 0) {
		return false;
	}

	return true;
}
开发者ID:cwz920716,项目名称:Combining-Static-and-Dynamic-Bound-Checking-Using-LLVM-Framework-and-SoftBound,代码行数:8,代码来源:PointerAnalysis.cpp


示例16: key

bool
SetObject::add(JSContext* cx, HandleObject obj, HandleValue k)
{
    ValueSet* set = obj->as<SetObject>().getData();
    if (!set)
        return false;

    Rooted<HashableValue> key(cx);
    if (!key.setValue(cx, k))
        return false;

    if (!set->put(key)) {
        ReportOutOfMemory(cx);
        return false;
    }
    WriteBarrierPost(cx->runtime(), set, key.value());
    return true;
}
开发者ID:cstipkovic,项目名称:gecko-dev,代码行数:18,代码来源:MapObject.cpp


示例17: mParamMode

/*! TODO:
*/
TranslucencyModule::TranslucencyModule()
	:Module(MODULE_NAME, MODULE_DISPLAY_NAME, TRANSLUCENCYMODULE_VERSION),
	mParamMode(PARAMETER_NAME_MODE, Variable::eVariableTypeString, "Translucency mode", "The type of translucency to perform", false),
	mParamAlpha(PARAMETER_NAME_ALPHA, Variable::eVariableTypeDouble, "Translucency alpha", "Percentage of translucency (0=opaque, 1=invisible)", true),
	mParamInvert(PARAMETER_NAME_INVERT, Variable::eVariableTypeBool, "Invert mask", "Invert plain or alpha mask", true)
{
	mShortDescription = "Module for embedding a color image in another one with translucency effect";
	mLongDescription = "This module embeds an image into another one using an alpha mask (translucency)";

	ValueSet lModeName;
	lModeName.insert(Value("image", "Whole Image", "Whole image is made translucent using the specified alpha value"));
	lModeName.insert(Value("plainmask", "Plain Mask", "Only the image pixels where the provided mask is non zero are made translucent using the specified alpha value"));
	lModeName.insert(Value("alphamask", "Alpha Mask", "Each pixel of the mask specify the alpha value to apply to the corresponding image pixel"));
	mParamMode.setPossibleValues(lModeName);

  NameSet lDependentParameterSet;
  lDependentParameterSet.insert(PARAMETER_NAME_ALPHA);
  lDependentParameterSet.insert(PARAMETER_NAME_INVERT);
  mParamMode.setDependentParameterNameSet(lDependentParameterSet);

	mParamMode.setValueStr("plainmask");
	mParamAlpha.setValue(0.5);
	mParamAlpha.setMinValue("0");
	mParamAlpha.setMaxValue("1");
	mParamInvert.setValue(false);

	newParameter(mParamMode);
	newParameter(mParamAlpha);
	newParameter(mParamInvert);

	mInputSlotBackgroundColorImage  = newSlot(new ModuleSlot(this, INPUT_SLOT_NAME_BGIMAGE, INPUT_SLOT_DISPLAYNAME_BGIMAGE, "Background image on which embedding with be performed"));
	mInputSlotTranslucencyColorImage  = newSlot(new ModuleSlot(this, INPUT_SLOT_NAME_TRANSIMAGE, INPUT_SLOT_DISPLAYNAME_TRANSIMAGE, "Image that is going to be made translucent"));
	mInputSlotTranslucencyMaskImage  = newSlot(new ModuleSlot(this, INPUT_SLOT_NAME_ALPHAMASK, INPUT_SLOT_DISPLAYNAME_ALPHAMASK, "Alpha mask used to make translucent image"));

	mOutputSlot = newSlot(new ModuleSlot(this, OUTPUT_SLOT_NAME_IMAGE, OUTPUT_SLOT_DISPLAYNAME_IMAGE, "Output image", &mOutputFrame));

	mOutputFrameIpl = NULL;
	mOutputFrame = NULL;
	mTmpFrame1 = NULL;
	mTmpFrame2 = NULL;
	mTmpFrame3 = NULL;
	mTmpFrame4 = NULL;
	mTmpFrame5 = NULL;
}
开发者ID:fjean,项目名称:vipers,代码行数:46,代码来源:Translucency.cpp


示例18: findInputsOutputs

void CodeExtractor::findInputsOutputs(ValueSet &Inputs,
                                      ValueSet &Outputs) const {
  for (BasicBlock *BB : Blocks) {
    // If a used value is defined outside the region, it's an input.  If an
    // instruction is used outside the region, it's an output.
    for (Instruction &II : *BB) {
      for (User::op_iterator OI = II.op_begin(), OE = II.op_end(); OI != OE;
           ++OI)
        if (definedInCaller(Blocks, *OI))
          Inputs.insert(*OI);

      for (User *U : II.users())
        if (!definedInRegion(Blocks, U)) {
          Outputs.insert(&II);
          break;
        }
    }
  }
}
开发者ID:CSI-LLVM,项目名称:llvm,代码行数:19,代码来源:CodeExtractor.cpp


示例19: printX

void PointerAnalysis::printX(ValueSet &set) {
	int cnt = 0;
	outs() << "\tcnt=" << set.size() << " { ";
	for (auto v: set) {
		outs() << v->getName() << " ";
		if (!globals.count(v))
			cnt++;
	}
	outs() << "} local=" << cnt << "\n";
}
开发者ID:cwz920716,项目名称:Combining-Static-and-Dynamic-Bound-Checking-Using-LLVM-Framework-and-SoftBound,代码行数:10,代码来源:PointerAnalysis.cpp


示例20: MEASURE_FET

void ConditionEncoder::TransformINsOnLookup()
{
	MEASURE_FET("ConditionEncoder::TransformINsOnLookup(...)");
	static MIIterator mid(0);
	ValueSet valset;
    RCBString s;
    for(int i = 0; i < attr->dic->CountOfUniqueValues(); i++) {
        s = attr->dic->GetRealValue(i);
        if((static_cast<MultiValColumn*>(desc->val1.vc))->Contains(mid, s) == true)
			valset.Add64(i);
    }
    in_type = ColumnType(RC_NUM);
	desc->val1.vc = new InSetColumn(in_type, NULL, valset);
	desc->val1.vc_id = desc->table->AddVirtColumn(desc->val1.vc);
	if(static_cast<InSetColumn&>(*desc->val1.vc).IsEmpty(mid)) {
		if(desc->op == O_IN)
			desc->op = O_FALSE;
		else
			desc->op = O_NOT_NULL;
	}
}
开发者ID:Tsuiwiki,项目名称:infobright,代码行数:21,代码来源:ConditionEncoder.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ValueStack类代码示例发布时间:2022-05-31
下一篇:
C++ ValueRef类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap