本文整理汇总了C++中TypeNode::addProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ TypeNode::addProperty方法的具体用法?C++ TypeNode::addProperty怎么用?C++ TypeNode::addProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TypeNode
的用法示例。
在下文中一共展示了TypeNode::addProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setup
void StatisicsPropertyintegration::setup()
{
m_char_type = new TypeNode("char_type");
m_char_property = new StatisticsProperty;
m_char_property->setFlags(flag_class);
m_char_type->addProperty("char_prop", m_char_property);
m_char1 = new Entity("1", 1);
m_char1->setType(m_char_type);
m_char_property->install(m_char1, "char_prop");
m_char_property->apply(m_char1);
m_char2 = new Entity("2", 2);
m_char2->setType(m_char_type);
m_char_property->install(m_char2, "char_prop");
m_char_property->apply(m_char2);
}
示例2: test_setAttr_type
void Entitytest::test_setAttr_type()
{
TestProperty * type_property = new TestProperty;
type_property->data() = 17;
type_property->flags() &= flag_class;
m_type->addProperty("test_int_property", type_property);
PropertyBase * pb = m_entity->setAttr("test_int_property", 24);
ASSERT_NOT_NULL(pb);
ASSERT_NOT_EQUAL(type_property, pb);
ASSERT_TRUE((pb->flags() & flag_class) == 0);
auto * int_property = dynamic_cast<TestProperty *>(pb);
ASSERT_NOT_NULL(int_property);
ASSERT_EQUAL(int_property->data(), 24);
ASSERT_TRUE(!m_TestProperty_install_called);
ASSERT_TRUE(m_TestProperty_apply_called);
}