本文整理汇总了C++中Property函数的典型用法代码示例。如果您正苦于以下问题:C++ Property函数的具体用法?C++ Property怎么用?C++ Property使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Property函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddProperty
void INI::AddProperty(std::string key, std::string value)
{
if (sections.size() == 0)
globalProperties.push_back(Property(key, value));
else
sections.back().properties.push_back(Property(key, value));
}
示例2: Property
void Armor::onStateChange(GameObjectState oldState, GameObjectState newState)
{
if (oldState != newState)
{
if (newState == GOS_READY)
{
if (getOwner())
{
mRsEffect = EffectFactoryManager::getSingleton().createEffect(
"Ruestung");
if(mRsEffect == NULL)
return;
mRsEffect->setProperty(Armor::PROPERTY_G_BE, Property(mGBE));
mRsEffect->setProperty(Armor::PROPERTY_G_RS, Property(mGRS));
getOwner()->addEffect(mRsEffect);
}
}
else if (oldState == GOS_READY)
{
if (getOwner())
{
if(mRsEffect == NULL)
return;
getOwner()->removeEffect(mRsEffect);
delete mRsEffect;
}
}
}
}
示例3: DALI_LOG_TRACE_METHOD
AnimationPtr ModelActorFactory::CreateAnimation(
Actor& rootActor,
const ModelAnimationMap* animationData,
AlphaFunction alpha,
float durationSeconds)
{
DALI_LOG_TRACE_METHOD(Debug::Filter::gModel);
AnimationPtr animation(Animation::New(durationSeconds));
animation->SetDefaultAlphaFunction(alpha);
for(EntityAnimatorMapIter it = animationData->animators.begin(); it != animationData->animators.end(); ++it)
{
const EntityAnimatorMap& entityAnimator(*it);
// find actor for this animator
ActorPtr animatedActor = rootActor.FindChildByName(entityAnimator.GetEntityName());
if (!animatedActor)
{
// If we can't find the actor, it may not have been instantiated, may
// be a sibling or parent of rootActor or may have been removed.
continue;
}
Dali::Actor targetActor(animatedActor.Get());
Dali::KeyFrames posKFHandle = entityAnimator.GetPositionKeyFrames();
if(posKFHandle)
{
const KeyFrames& positionKeyFrames = GetImplementation(posKFHandle);
if(positionKeyFrames.GetKeyFramesBase()->GetNumberOfKeyFrames() > 0)
{
animation->AnimateBetween(Property(targetActor, Dali::Actor::POSITION),
positionKeyFrames, alpha, durationSeconds);
}
}
Dali::KeyFrames scaleKFHandle = entityAnimator.GetScaleKeyFrames();
if(scaleKFHandle)
{
const KeyFrames& scaleKeyFrames = GetImplementation(scaleKFHandle);
if(scaleKeyFrames.GetKeyFramesBase()->GetNumberOfKeyFrames() > 0)
{
animation->AnimateBetween(Property(targetActor, Dali::Actor::SCALE), scaleKeyFrames, alpha, durationSeconds);
}
}
Dali::KeyFrames rotationKFHandle = entityAnimator.GetRotationKeyFrames();
if(rotationKFHandle)
{
const KeyFrames& rotationKeyFrames = GetImplementation(rotationKFHandle);
if(rotationKeyFrames.GetKeyFramesBase()->GetNumberOfKeyFrames() > 0)
{
animation->AnimateBetween(Property(targetActor, Dali::Actor::ROTATION), rotationKeyFrames, alpha, durationSeconds);
}
}
}
return animation;
}
示例4: Property
void Renderer::addNextMesh() {
std::string model_filename = current_mesh->path().string();
std::cout << "selecting model: " << model_filename << std::endl;
config.GetScene().Parse(
Property("scene.shapes.subject.type")("mesh") <<
Property("scene.shapes.subject.ply")(model_filename));
config.GetScene().RemoveUnusedMeshes();
}
示例5: enumPropertiesTree
// 枚举所有属性,以树的形式
void TriggerObject::enumPropertiesTree(VTProperty &properties)const
{
NullObject::enumPropertiesTree(properties);
properties.push_back(Property( ID_Trigger , PT_GROUP , "触发器设置" , "触发器设置" , true , false , false));
properties.back().addChild(Property( ID_TriggerCondition , PT_BOOL , "满足条件" , "是否已经满足条件触发这个触发器,只有当条件满足时才可以触发" , true , true , true));
properties.back().addChild(Property( ID_TriggerOnEnterEvent , PT_STRING , "进入事件" , "当满足条件后进入触发器,就会触发这个事件" , true , true , true));
properties.back().addChild(Property( ID_TriggerOnLeaveEvent , PT_STRING , "退出事件" , "当触发了进入事件后退出触发器,就会触发这个事件" , true , true , true));
}
示例6: Property
PropertyGroupInstance SampleSensorFactory::GetSensorProperties( SampleSensor& sensor )
{
PropertyGroupInstance properties;
properties.push_back( Property( sensor.sendRate ) );
properties.push_back( Property( sensor.quality_factor ) );
return properties;
}
示例7: constraints
void constraints() {
function_requires< ReadablePropertyGraphConcept<G, X, Property> >();
function_requires< ReadWritePropertyMapConcept<Map, X> >();
Map pmap = get(Property(), g);
pval = get(Property(), g, x);
put(Property(), g, x, pval);
ignore_unused_variable_warning(pmap);
}
示例8: Property
void
CannaJRKanji::install_properties (void)
{
m_properties.clear ();
Property prop;
prop = Property (SCIM_PROP_INPUT_MODE,
_("Input mode"), String (""),
_("Input mode"));
m_properties.push_back (prop);
prop = Property (SCIM_PROP_INPUT_MODE_OFF,
_("Off"), String (""),
_("Off"));
m_properties.push_back (prop);
prop = Property (SCIM_PROP_INPUT_MODE_HIRAGANA,
_("Hiragana"), String (""),
_("Hiragana"));
m_properties.push_back (prop);
prop = Property (SCIM_PROP_INPUT_MODE_KATAKANA,
_("Katakana"), String (""),
_("Katakana"));
m_properties.push_back (prop);
prop = Property (SCIM_PROP_INPUT_MODE_HALF_KATAKANA,
_("Half width katakana"), String (""),
_("Half width katakana"));
m_properties.push_back (prop);
prop = Property (SCIM_PROP_INPUT_MODE_ALPHABET,
_("Alphabet"), String (""),
_("Alphabet"));
m_properties.push_back (prop);
prop = Property (SCIM_PROP_INPUT_MODE_WIDE_ALPHABET,
_("Wide alphabet"), String (""),
_("Wide alphabet"));
m_properties.push_back (prop);
prop = Property (SCIM_PROP_INPUT_MODE_KIGO,
_("Symbols"), String (""),
_("Search a symbol"));
m_properties.push_back (prop);
prop = Property (SCIM_PROP_INPUT_MODE_HEX,
_("Hex"), String (""),
_("Search a kanji by hex"));
m_properties.push_back (prop);
prop = Property (SCIM_PROP_INPUT_MODE_BUSHU,
_("Bushu"), String (""),
_("Search a kanji by bushu"));
m_properties.push_back (prop);
}
示例9: Property
QList<PipelineComponent::Property> CsvSourceComponent::getProperties()
{
QList<Property> l;
l << Property(this, "Spectrum", "Sets the spectrum", spectrum);
l << Property(this, "Step size", "Specifies the step size", stepSize, 0.0, 10000.0, "m");
l << Property(this, "Intensity", "Holds the path to the CSV file containing the intensity distribution. Can NOT be empty!", QFile(intensityDataPath));
l << Property(this, "Phase", "Holds the path to the CSV file containing the phase distribution. Can be empty!", QFile(phaseDataPath));
l << Property(this, "CSV separator", "Specifies the CSV separator", csvSeparator);
return l;
}
示例10: Validate
TBool CUPnPArgument::Validate(const RStringPool& aStringPool, const TStringTable& aStringTable ) const
{
TBool result=EFalse;
if( (Property(aStringPool.String(UPNPDESCRIPTIONXMLTAGS::EName, aStringTable)).Length()!=0) &&
(Property(aStringPool.String(UPNPDESCRIPTIONXMLTAGS::EArgumentDirection, aStringTable)).Length()!=0) &&
(Property(aStringPool.String(UPNPDESCRIPTIONXMLTAGS::ERelatedStateVar, aStringTable)).Length()!=0))
result = ETrue;
return result;
}
示例11: model
void Test_ormtool::createSqlScriptForTable()
{
SqlScriptBuilder builder;
builder.setDriverName("QMYSQL");
builder.fillTableTypesMySql();
Model model("Table");
model.addProperty(Property("QString", "name"));
model.addProperty(Property("int", "number"));
QCOMPARE(builder.createSqlScriptForTableMySql(model).simplified(), QString("CREATE TABLE Table(id BIGINT AUTO_INCREMENT, name TEXT, number INT, "
"PRIMARY KEY(id));").simplified());
}
示例12: SideSet
void DatabaseIO::create_group(EntityType type, const std::string & /*type_name*/,
const std::vector<std::string> &group_spec,
const SideSet * /*set_type*/)
{
// Not generalized yet... This only works for T == SideSet
if (type != SIDESET) {
return;
}
int64_t entity_count = 0;
int64_t df_count = 0;
// Create the new set...
auto new_set = new SideSet(this, group_spec[0]);
get_region()->add(new_set);
// Find the member SideSets...
for (size_t i = 1; i < group_spec.size(); i++) {
SideSet *set = get_region()->get_sideset(group_spec[i]);
if (set != nullptr) {
SideBlockContainer side_blocks = set->get_side_blocks();
for (auto &sbold : side_blocks) {
size_t side_count = sbold->get_property("entity_count").get_int();
auto sbnew = new SideBlock(this, sbold->name(), sbold->topology()->name(),
sbold->parent_element_topology()->name(), side_count);
int64_t id = sbold->get_property("id").get_int();
sbnew->property_add(Property("set_offset", entity_count));
sbnew->property_add(Property("set_df_offset", df_count));
sbnew->property_add(Property("id", id));
new_set->add(sbnew);
size_t old_df_count = sbold->get_property("distribution_factor_count").get_int();
if (old_df_count > 0) {
std::string storage = "Real[";
storage += Utils::to_string(sbnew->topology()->number_nodes());
storage += "]";
sbnew->field_add(
Field("distribution_factors", Field::REAL, storage, Field::MESH, side_count));
}
entity_count += side_count;
df_count += old_df_count;
}
}
else {
IOSS_WARNING << "WARNING: While creating the grouped surface '" << group_spec[0]
<< "', the surface '" << group_spec[i] << "' does not exist. "
<< "This surface will skipped and not added to the group.\n\n";
}
}
}
示例13: Item_Detail
int Vip::req_vip_daily_receive(void){
if(vip_detail_->has_receive_daily_reward) {
return ERROR_RECEIVED_VIP_DAILY;
}
const Vip_Daily_Item_Config_Vec *conf = CONFIG_CACHE_VIP->get_vip_daily_config(player_self()->vip());
if(conf) {
Item_Vec item_list; item_list.clear();
Money_Add_List money_add_list; money_add_list.clear();
uint32_t exp = 0;
MSG_81000102 acv_msg;
acv_msg.type = 0;
for(Vip_Daily_Item_Config_Vec::const_iterator it = conf->begin(); it != conf->end(); ++it) {
if(it->item_id == PT_EXP_CURRENT) {
exp += it->num;
} else {
if(it->item_id > 999999) {
Item_Detail item = Item_Detail(it->item_id, it->num, it->bind);
item_list.push_back(item);
Item_Basic_Info ibi;
item.set_item_basic_info(ibi);
acv_msg.item_info.push_back(ibi);
} else {
money_add_list.push_back(Money_Add_Info(Money_Type(it->item_id), it->num,Money_DM_Info(MONEY_ADD_VIP_DAILY)));
acv_msg.property.push_back(Property(it->item_id, it->num));
}
}
}
if(!item_list.empty()) {
int result = player_self()->pack_insert_item(PACK_T_PACKAGE_INDEX, item_list, Gain_Item_DM_Info(ITEM_GAIN_VIP_DAILY));
if(result) {
return result;
}
}
if(!money_add_list.empty()) {
player_self()->pack_add_money(money_add_list);
}
if(exp) {
const Exp_All exp_all = player_self()->modify_experience_inter(exp, false, false, true);
if (0 == exp_all.result) {
acv_msg.property.push_back(Property(PT_EXP_CURRENT, exp_all.all));
acv_msg.vip_exp = exp_all.vip_exp;
acv_msg.world_level = player_self()->get_world_level_add();
}
}
vip_detail_->has_receive_daily_reward = true;
vip_detail_->detail_change();
MSG_50106206 msg;
THIS_SEND_TO_CLIENT(msg);
THIS_SEND_TO_CLIENT(acv_msg);
}
return 0;
}
示例14: on_start
void Parser::parse_property( std::string const& tag )
{
std::vector<Property> propertys;
std::string::size_type pos = tag.find( ' ' );
if( pos == std::string::npos )
{
on_start( tag, propertys );
return;
}
std::string tag_name = tag.substr( 0, pos );
std::string::size_type p1 = tag.find( '=', pos + 1 );
while( p1 != std::string::npos
&& pos != std::string::npos )
{
std::string name = property_name( tag, pos, p1 );
std::string::size_type p2 = tag.find( '\x22', p1 );//find "
if( p2 != std::string::npos )
{
std::string::size_type p3 = tag.find( '\x22', p2 + 1 );
if( p3 != std::string::npos )
{
std::string value( tag.substr( p2 + 1, p3 - p2 - 1 ) );
propertys.push_back( Property( name, value ) );
pos = tag.find( ' ', p3 );
}
else
pos = tag.find( ' ', p2 );
}
else if( ( p2 = tag.find( '\x27', p1 ) ) != std::string::npos )//find '
{
std::string::size_type p3 = tag.find( '\x27', p2 + 1 );
if( p3 != std::string::npos )
{
std::string value( tag.substr( p2 + 1, p3 - p2 - 1 ) );
propertys.push_back( Property( name, value ) );
pos = tag.find( ' ', p3 );
}
else
pos = tag.find( ' ', p2 );
}
else
{
pos = tag.find( ' ', p1 );
}
p1 = tag.find( '=', pos + 1 );
}
on_start( tag_name, propertys );
}
示例15: switch
/** \brief Reverse Property. */
Property Property::operator ~ () const
{
switch (PROP2DIR(_property))
{
case Forward:
return Property(PROP2NODE(_property), Backward);
break;
case Backward:
return Property(PROP2NODE(_property), Forward);
break;
default:
return *this;
break;
}
}