本文整理汇总了C++中PropertyBag::add方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertyBag::add方法的具体用法?C++ PropertyBag::add怎么用?C++ PropertyBag::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertyBag
的用法示例。
在下文中一共展示了PropertyBag::add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: decomposeProperty
void decomposeProperty(const Sample<T>& sample, PropertyBag& targetbag)
{
std::string tname = detail::DataSourceTypeInfo<T>::getType();
targetbag.setType("Sample");
//std::string str;
assert( targetbag.empty() );
bool result =true;
//std::stringstream out;
//out << i+1;
//str = out.str();
Property<PropertyBag>* el_bag = new Property<PropertyBag>("SampleValue", "Sample Value");
Property<T> el("SampleValue" , "Sample value ",sample.ValueGet()) ;
if( el.getTypeInfo()->decomposeType(el.getDataSource(),el_bag->value()) )
{
//log(Debug)<<"Element type "<<el.getType()<<" is a bag"<<endlog();
targetbag.add( el_bag ); // Put variables in the bag
}
else
{
//log(Debug)<<"Element type "<<el.getType()<<" is not a bag"<<endlog();
//For Property
targetbag.add( new Property<T>("SampleValue" ,"Sample Value",sample.ValueGet() )); // Put variables in the bag
}
};
示例2: toXml
PropertyBag Light::toXml(void)
{
PropertyBag xml;
xml.add("constantAttenuation", constantAttenuation);
xml.add("linearAttenuation", linearAttenuation);
xml.add("quadraticAttenuation", quadraticAttenuation);
xml.add("lightPosition", lightPosition);;
xml.add("pointLight", pointLight);
xml.add("lightDirection", lightDirection);
xml.add("spotAngle", spotAngle);
xml.add("spotExponent", spotExponent);
xml.add("enable", enable);
return xml;
}
示例3: save
PropertyBag ActorSet::save(void) const
{
PropertyBag xml;
for(const_iterator i = begin(); i != end(); ++i)
{
Actor &a = *(i->second);
// Do not save Creatures. We are saving spawns instead and the player data is separate
if(!instanceof(a, Creature))
{
xml.add("object", a.save());
}
}
return xml;
}