本文整理汇总了C++中Property::CreateElelmentAccessor方法的典型用法代码示例。如果您正苦于以下问题:C++ Property::CreateElelmentAccessor方法的具体用法?C++ Property::CreateElelmentAccessor怎么用?C++ Property::CreateElelmentAccessor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Property
的用法示例。
在下文中一共展示了Property::CreateElelmentAccessor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Create
Property* Property::Create(const char* typeName, const char* fullName, bool bIsStatic, const char* arrayIndexStr)
{
BEHAVIAC_UNUSED_VAR(bIsStatic);
char instanceName[kInstanceLength];
char agentType[kInstanceLength];
const char* variableName = ParseInstanceNameProperty(fullName, instanceName, agentType);
Property* pProperty = AgentProperties::GetProperty(agentType, variableName);
if (pProperty != 0)
{
BEHAVIAC_ASSERT(pProperty != 0);
if (strcmp(pProperty->GetInstanceName(), instanceName) != 0)
{
//Properties().insert(std::pair<Property*, bool>(pProperty, true));
BEHAVIAC_ASSERT(strcmp(pProperty->Name(), variableName) == 0);
Property* pNew = pProperty->clone();
pNew->SetInstanceName(instanceName);
pProperty = pNew;
AgentProperties::AddPropertyInstance(agentType, pNew);
}
else
{
}
BEHAVIAC_ASSERT(pProperty->m_bIsStatic == bIsStatic);
if (arrayIndexStr)
{
Property* vectorAccessor = pProperty->CreateElelmentAccessor(arrayIndexStr);
return vectorAccessor;
}
}
else
{
//BEHAVIAC_ASSERT(false, "accessing a not declared local variable");
const char* valueStr = 0;
pProperty = AgentProperties::AddLocal(agentType, typeName, variableName, valueStr);
}
return pProperty;
}