Implement instance variable "templates" for config objects.

Refs #5884
This commit is contained in:
Gunnar Beutner 2014-03-28 14:46:19 +01:00
parent 8ab39194f1
commit 0e79abb8f2
3 changed files with 8 additions and 0 deletions

View File

@ -5,6 +5,7 @@ abstract class DynamicObject
{
[config] String name (Name);
[config, get_protected] String type (TypeName);
[config, get_protected] Array::Ptr templates;
[config] Dictionary::Ptr methods;
[config] Dictionary::Ptr custom;
[config] Array::Ptr domains;

View File

@ -24,6 +24,10 @@
%require "type",
%attribute %string "type",
%attribute %array "templates" {
%attribute %string "*"
},
%attribute %dictionary "methods",
%attribute %dictionary "custom" {

View File

@ -86,6 +86,9 @@ ConfigItem::Ptr ConfigItemBuilder::Compile(void)
}
Array::Ptr exprs = make_shared<Array>();
Array::Ptr templateArray = make_shared<Array>();
templateArray->Add(m_Name);
exprs->Add(make_shared<AExpression>(&AExpression::OpSetPlus, "templates", make_shared<AExpression>(&AExpression::OpLiteral, templateArray, m_DebugInfo), m_DebugInfo));
exprs->Add(make_shared<AExpression>(&AExpression::OpSet, "type", make_shared<AExpression>(&AExpression::OpLiteral, m_Type, m_DebugInfo), m_DebugInfo));
exprs->Add(make_shared<AExpression>(&AExpression::OpDict, m_Expressions, true, m_DebugInfo));
exprs->Add(make_shared<AExpression>(&AExpression::OpSet, "name", make_shared<AExpression>(&AExpression::OpLiteral, m_Name, m_DebugInfo), m_DebugInfo));