#include "GuiInstanceLoader_WorkflowCodegen.h"
#include "../../Reflection/GuiInstanceCompiledWorkflow.h"
#include "../GuiInstanceLocalizedStrings.h"
namespace
{
namespace
{
using
namespace
parsing
;
using
namespace
workflow
;
using
namespace
workflow
::
analyzer
;
using
namespace
workflow
::
runtime
;
using
namespace
reflection
::
description
;
using
namespace
collections
;
using
namespace
controls
;
using
namespace
compositions
;
using
namespace
templates
;
template
<
typename
>
auto
(
<
>
,
,
const
&
,
)
->
typename
<
decltype
(
({}).
())>::
{
=
.
().
(
);
if
(
index
!= -
1
)
{
<
::
>
=
.
()
index
];
FOREACH(Ptr<GuiInstanceNamespace>, ns, namespaceInfo->namespaces)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
namespaceInfo
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
ns
);)
{
auto
=
::
(
ns
+
+
ns
);
if
(
auto
=
(
fullName
))
{
return
nullable
.
();
}
}
}
return
{};
}
FindInstanceLoadingSource
(
<
>
,
,
const
&
)
{
return
(
,
,
, [](
)->
<
>
{
if
(
auto
=
()->
(
fullName
))
{
return
{ {
loader
,
fullName
} };
}
return
{};
});
}
<
>
(
<
>
,
*
,
<
GuiResourceClassNameRecord
>
)
{
return
(
,
->
,
->
.
(), [=](
)->
<
<
>>
{
=
.
().
(
fullName
.
());
if
(
index
!= -
1
)
{
return
.
()
index
];
}
return
{};
});
}
FindInstanceLoadingSource
(
<
>
,
*
)
{
return
FindInstanceLoadingSource
(
,
->
,
->
.
());
}
<
workflow
::
>
Workflow_PrecompileInstanceContext
(
GuiResourcePrecompileContext
&
,
const
&
,
types
::
&
,
::
&
)
{
auto
=
Workflow_CreateModuleWithUsings
(
.
,
);
{
auto
=
Workflow_InstallCtorClass
(
,
module
);
Workflow_GenerateCreating
(
,
,
block
,
);
Workflow_GenerateBindings
(
,
,
block
,
);
}
return
module
;
}
class
WorkflowEventNamesVisitor
:
public
,
public
::
{
public
:
GuiResourcePrecompileContext
&
;
types
::
&
;
<
types
::
>&
candidatePropertyTypeInfos
;
<
>
;
::
&
;
::
;
WorkflowEventNamesVisitor
(
GuiResourcePrecompileContext
&
,
types
::
&
,
<
types
::
>&
_candidatePropertyTypeInfos
,
<
>
,
::
&
)
:precompileContext(
)
, resolvingResult(
)
, candidatePropertyTypeInfos(
_candidatePropertyTypeInfos
)
, instanceClass(
)
, errors(
)
{
}
<
>
(
<
::
>
,
)
{
if
(
auto
=
.
()->
(
.
(),
true
))
{
auto
=
Workflow_GenerateEventHandler
(
,
eventInfo
);
decl
=
::
;
decl
.
;
{
auto
=
<
>();
att
.
=
L"cpp"
;
att
.
=
L"Protected"
;
decl
.
(
att
);
}
{
auto
=
<
>();
att
.
=
L"cpp"
;
att
.
=
L"UserImpl"
;
decl
.
(
att
);
}
{
auto
=
<
>();
decl
block
;
auto
=
<
>();
stringExpr
.
=
L"Not Implemented: "
+
;
auto
=
<
WfRaiseExceptionStatement
>();
raiseStat
stringExpr
;
block
.
(
raiseStat
);
}
decl
<
>();
decl
=
::
;
return
decl
;
}
else
{
.
(
({
.
},
,
L"Precompile: Event \""
+
.
() +
L"\" cannot be found in type \""
+
.
.
() +
L"\"."
));
}
return
nullptr
;
}
void
(
*
)
override
{
}
void
(
*
)
override
{
FOREACH_INDEXER(Ptr<GuiAttSetterRepr::SetterValue>, setter, index, repr->setters.Values())
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
::
>>&
= ::
vl
::
collections
::
(
->
.
());
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
::
>
;
__foreach_iterator__
.
(
setter
);
index
++)
{
auto
=
()->
(
.
);
<
types
::
>
;
auto
=
->
.
()
index
];
;
if
(
Workflow_GetPropertyTypes
(
errorPrefix
,
,
loader
,
,
prop
,
setter
,
possibleInfos
,
))
{
if
(
setter
==
::
)
{
if
(
possibleInfos
0
].
==
::
)
{
auto
=
dynamic_cast
<
*>(
setter
0
].
());
<
types
::
>
;
WorkflowEventNamesVisitor
(
,
,
infos
,
,
);
auto
=
possibleInfos
0
].
0
];
visitor
.
.
::
(
typeInfo
()->
());
visitor
.
.
typeInfo
;
setTarget
->
(&
visitor
);
}
else
{
.
(
({
.
},
setter
,
errorPrefix
+
L" does not support the \"-set\" binding."
));
}
}
else
{
FOREACH(Ptr<GuiValueRepr>, value, setter->values)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
setter
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
value
);)
{
WorkflowEventNamesVisitor
(
,
,
possibleInfos
,
,
);
value
(&
visitor
);
}
}
}
}
FOREACH_INDEXER(Ptr<GuiAttSetterRepr::EventValue>, handler, index, repr->eventHandlers.Values())
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
::
>>&
= ::
vl
::
collections
::
(
->
.
());
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
::
>
;
__foreach_iterator__
.
(
handler
);
index
++)
{
if
(
handler
==
::
)
{
auto
=
->
.
()
index
];
if
(
auto
=
(
handler
,
propertyName
))
{
Workflow_RecordScriptPosition
(
,
handler
,
decl
);
.
(
decl
);
}
}
}
}
void
(
*
)
override
{
auto
=
.
;
bool
=
->
==
::
&&
->
==
::
;
bool
=
false
;
if
(
inferType
)
{
if
(
candidatePropertyTypeInfos
.
() ==
1
)
{
auto
=
candidatePropertyTypeInfos
0
].
;
if
(
info
.
() ==
1
)
{
auto
=
info
0
];
.
::
(
typeInfo
()->
());
.
typeInfo
;
}
else
if
(
info
.
() ==
0
)
{
noContextToInfer
=
true
;
}
}
else
if
(
candidatePropertyTypeInfos
.
() ==
0
)
{
noContextToInfer
=
true
;
}
}
else
{
if
(
==
context
.
())
{
auto
=
::
(
context
);
if
(
auto
=
()->
(
fullName
))
{
.
fullName
;
.
reprType
;
}
}
if
(!
.
)
{
auto
=
FindInstanceLoadingSource
(
context
,
);
.
source
.
;
.
()->
(
source
.
);
}
}
if
(
.
)
{
if
(
->
.
() ==
1
&&
->
.
()
0
] ==
::
)
{
auto
=
->
.
()
0
];
if
(
setter
.
() ==
1
)
{
if
(
auto
=
setter
0
].
<
>())
{
return
;
}
}
}
((
*)
);
}
else
if
(
inferType
)
{
if
(
noContextToInfer
)
{
.
(
({
.
},
->
,
L"Precompile: Unable to resolve type \"_\" without any context."
));
}
else
{
.
(
({
.
},
->
,
L"Precompile: Unable to resolve type \"_\" since the current property accepts multiple types."
));
}
}
else
{
.
(
({
.
},
->
,
L"Precompile: Failed to find type \""
+
(
->
==
::
?
->
.
()
:
->
.
() +
L":"
+
->
.
()
) +
L"\"."
));
}
}
};
class
:
public
empty_visitor
::
,
public
empty_visitor
::
VirtualCfeDeclarationVisitor
,
public
empty_visitor
::
VirtualCseDeclarationVisitor
{
public
:
<
<
>()>
;
<
<
>>&
;
(
<
<
>()>
,
<
<
>>&
)
:statCtor(
)
, unprocessed(
)
{
}
void
(
*
)
override
{
->
(
static_cast
<
::
*>(
this
));
}
void
(
*
)
override
{
->
(
static_cast
<
::
*>(
this
));
}
void
(
*
)
override
{
->
);
}
void
(
*
)
override
{
->
);
}
void
(
*
)
override
{
->
);
}
void
(
*
)
override
{
(
,
->
,
true
);
}
};
<
workflow
::
>
Workflow_GenerateInstanceClass
(
GuiResourcePrecompileContext
&
,
const
&
,
types
::
&
,
::
&
,
)
{
bool
=
false
;
bool
=
false
;
switch
(
)
{
case
IGuiResourceTypeResolver_Precompile
::
Instance_CollectInstanceTypes
:
needFunctionBody
=
false
;
needEventHandler
=
false
;
break
;
case
IGuiResourceTypeResolver_Precompile
::
Instance_CollectEventHandlers
:
needFunctionBody
=
false
;
needEventHandler
=
true
;
break
;
case
IGuiResourceTypeResolver_Precompile
::
Instance_GenerateInstanceClass
:
needFunctionBody
=
true
;
needEventHandler
=
true
;
break
;
}
auto
=
.
(
L"ClassNameRecord"
).Cast<
GuiResourceClassNameRecord
>();
<
>
;
<
>
;
<
>
;
<
>
;
auto
=
.
;
{
auto
=
FindInstanceLoadingSource
(
context
,
context
.
());
baseType
()->
(
source
.
);
if
(!
baseType
)
{
baseTypeResourceItem
=
(
context
,
context
.
(),
classNameRecord
);
}
if
(!
baseType
&& !
baseTypeResourceItem
)
{
.
(
({
.
},
context
,
L"Precompile: Failed to find type \""
+
(
context
==
::
?
context
.
()
:
context
.
() +
L":"
+
context
.
()
) +
L"\"."
));
return
nullptr
;
}
if
(
baseTypeResourceItem
&&
needEventHandler
)
{
.
(
({
.
},
context
,
L"[INTERNAL ERROR] Precompile: Failed to find compiled type in previous passes \""
+
(
context
==
::
?
context
.
()
:
context
.
() +
L":"
+
context
.
()
) +
L"\"."
));
return
nullptr
;
}
}
if
(
baseTypeResourceItem
)
{
baseTypeContext
baseTypeResourceItem
().
<
>();
<
>
;
(
baseTypeContext
,
fragments
);
for
(
=
0
;
i
<
fragments
.
();
i
++)
{
if
(
baseWfType
)
{
auto
=
<
>();
type
baseWfType
;
type
.
fragments
i
];
baseWfType
type
;
}
else
{
auto
=
<
>();
type
.
fragments
i
];
baseWfType
type
;
}
}
}
auto
=
Workflow_CreateModuleWithUsings
(
context
,
);
auto
=
(
context
,
module
);
{
if
(
baseWfType
)
{
instanceClass
.
(
baseWfType
);
}
else
{
auto
=
<
>(
baseType
(),
::
);
auto
=
(
typeInfo
.
());
instanceClass
.
(
baseType
);
}
if
(
context
)
{
auto
=
<
>();
value
.
instanceClass
.
;
auto
=
<
>();
att
.
=
L"cpp"
;
att
.
=
L"File"
;
att
value
;
instanceClass
.
(
att
);
}
}
if
(
needFunctionBody
)
{
auto
=
<
>();
baseConstructorType
.
=
instanceClass
.
+
L"Constructor"
;
instanceClass
.
(
baseConstructorType
);
{
auto
=
<
>();
value
(
baseConstructorType
);
auto
=
<
>();
att
.
=
L"cpp"
;
att
.
=
L"Friend"
;
att
value
;
instanceClass
.
(
att
);
}
}
auto
= [&](
const
&
,
const
&
,
<
<
>>&
,
)
{
=
L"module parse_members; class Class {\r\n"
+
code
+
L"\r\n}"
;
if
(
auto
=
(
, {
.
},
wrappedCode
,
position
,
, {
1
,
0
}))
{
(
memberDecls
,
module
0
].
<
>()
);
}
};
auto
= [=](
<
>
)
{
decl
<
>();
decl
=
::
;
instanceClass
.
(
decl
);
};
auto
= []()
{
auto
=
<
>();
auto
=
<
>();
stringExpr
.
=
L"Not Implemented"
;
auto
=
<
WfRaiseExceptionStatement
>();
raiseStat
stringExpr
;
block
.
(
raiseStat
);
return
block
;
};
auto
= [&](
const
&
)->
<
<
>,
>
{
auto
=
(
className
);
if
(!
paramTd
)
{
auto
=
FindInstanceLoadingSource
(
.
, {},
className
);
if
(
auto
=
()->
(
source
.
))
{
paramTd
=
typeInfo
();
}
}
if
(
paramTd
)
{
auto
=
Workflow_GetSuggestedParameterType
(
paramTd
);
switch
(
typeInfo
())
{
case
::
:
return
{
typeInfo
,
className
+
L"*"
};
case
::
:
return
{
typeInfo
,
className
+
L"^"
};
default
:
return
{
typeInfo
,
className
};
}
}
return
{
nullptr
,
className
};
};
if
(
context
!=
L""
)
{
<
<
>>
;
parseClassMembers
(
context
,
L"members of instance \""
+
context
+
L"\""
,
memberDecls
,
context
);
if
(!
needFunctionBody
)
{
<
<
>>
;
(
unprocessed
,
memberDecls
);
(
notImplemented
,
unprocessed
);
for
(
=
0
;
i
<
unprocessed
.
();
i
++)
{
unprocessed
i
]
(&
visitor
);
}
}
(
instanceClass
,
memberDecls
,
true
);
}
auto
=
<
>();
ctor
=
::
;
auto
= (!
needFunctionBody
?
notImplemented
() :
<
>());
ctor
ctorBlock
;
if
(
baseWfType
)
{
auto
=
<
>();
ctor
.
(
call
);
call
(
instanceClass
0
]);
baseTypeContext
baseTypeResourceItem
().
<
>();
FOREACH(Ptr<GuiInstanceParameter>, parameter, baseTypeContext->parameters)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
baseTypeContext
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
parameter
);)
{
auto
=
getDefaultType
(
parameter
.
());
auto
=
(
,
parameter
.
,
L"cast("
+
parameterTypeInfoTuple
.f1+
L") (null of object)"
,
parameter
,
,
{
0
,
5
}
);
if
(!
expression
)
{
auto
=
<
>();
nullExpr
=
::
;
expression
nullExpr
;
}
call
.
(
expression
);
}
}
else
if
(
auto
=
baseType
()->
())
{
auto
=
group
->
(
0
);
=
ctorInfo
->
();
if
(
count
>
0
)
{
if
(
needFunctionBody
)
{
if
(
auto
=
.
->
(
,
,
.
,
.
,
))
{
ctor
.
(
call
);
}
}
else
{
auto
=
<
>();
ctor
.
(
call
);
call
(
instanceClass
0
]);
for
(
=
0
;
i
<
count
;
i
++)
{
call
.
(
(
ctorInfo
->
(
i
)->
()));
}
}
}
}
FOREACH(Ptr<GuiInstanceLocalized>, localized, context->localizeds)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
context
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
localized
);)
{
if
(
auto
=
(
localized
.
()))
{
*
=
nullptr
;
if
(
auto
=
lsTd
->
(
L"Get"
,
false
))
{
=
group
->GetMethodCount();
for
(
=
0
;
i
<
count
;
i
++)
{
auto
=
group
->GetMethod(
i
);
if
(
method
->GetParameterCount() ==
1
)
{
auto
=
method
->GetParameter(
0
)->GetType()->GetTypeDescriptor();
if
(
paramTd
==
description
::
<
>())
{
lsiTd
=
method
->GetReturn()->GetTypeDescriptor();
break
;
}
}
}
}
if
(
lsiTd
)
{
auto
=
<
WfAutoPropertyDeclaration
>();
addDecl
(
prop
);
prop
.
localized
.
();
prop
(
Workflow_GetSuggestedParameterType
(
lsiTd
).
());
prop
=
::
;
prop
=
::
;
auto
=
<
>();
localeNameExpr
.
=
L"en-US"
;
auto
=
<
>();
defaultLocalExpr
=
::
;
defaultLocalExpr
(
<
>::
().
());
defaultLocalExpr
localeNameExpr
;
auto
=
<
>();
getExpr
GetExpressionFromTypeDescriptor
(
lsTd
);
getExpr
.
=
L"Get"
;
auto
=
<
>();
callExpr
getExpr
;
callExpr
.
(
defaultLocalExpr
);
prop
callExpr
;
}
else
{
.
(
({
.
},
localized
,
L"Precompile: Class \""
+
localized
.
() +
L"\" of localized strings \""
+
localized
.
() +
L"\" is not a correct localized strings class."
));
}
}
else
{
.
(
({
.
},
localized
,
L"Precompile: Class \""
+
localized
.
() +
L"\" of localized strings \""
+
localized
.
() +
L"\" cannot be found."
));
}
}
FOREACH(Ptr<GuiInstanceParameter>, parameter, context->parameters)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
context
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
parameter
);)
{
auto
=
getDefaultType
(
parameter
.
());
=
.
();
auto
=
(
, {
.
},
parameterTypeInfoTuple
.f1,
parameter
,
);
if
(!
needFunctionBody
&& !
parameterTypeInfoTuple
.f0 &&
errorCount
==
.
())
{
if
(!
type
||
type
.
<
>() ||
type
.
<
>() ||
type
.
<
>())
{
type
=
(
, {
.
},
parameter
.
() +
L"*"
,
parameter
,
);
}
}
if
(
type
)
{
if
(
needFunctionBody
)
{
auto
=
<
>();
addDecl
(
decl
);
decl
.
=
L"<parameter>"
+
parameter
.
();
decl
(
type
);
decl
(
parameterTypeInfoTuple
.f0.Obj());
Workflow_RecordScriptPosition
(
,
parameter
, (
<
>)
decl
);
}
{
auto
=
<
>();
addDecl
(
decl
);
decl
=
::
;
decl
.
=
L"Get"
+
parameter
.
();
decl
(
type
);
if
(
needFunctionBody
)
{
auto
=
<
>();
decl
block
;
auto
=
<
>();
ref
.
=
L"<parameter>"
+
parameter
.
();
auto
=
<
>();
returnStat
ref
;
block
.
(
returnStat
);
}
else
{
decl
=
notImplemented
();
}
Workflow_RecordScriptPosition
(
,
parameter
, (
<
>)
decl
);
}
{
auto
=
<
>();
addDecl
(
decl
);
decl
.
parameter
.
();
decl
type
;
decl
.
=
L"Get"
+
parameter
.
();
Workflow_RecordScriptPosition
(
,
parameter
, (
<
>)
decl
);
}
{
auto
=
<
>();
argument
.
=
L"<ctor-parameter>"
+
parameter
.
();
argument
(
type
);
ctor
.
(
argument
);
}
if
(
needFunctionBody
)
{
auto
=
<
>();
refLeft
.
=
L"<parameter>"
+
parameter
.
();
auto
=
<
>();
refRight
.
=
L"<ctor-parameter>"
+
parameter
.
();
auto
=
<
>();
assignExpr
=
::
;
assignExpr
refLeft
;
assignExpr
refRight
;
auto
=
<
>();
exprStat
assignExpr
;
ctorBlock
.
(
exprStat
);
Workflow_RecordScriptPosition
(
,
parameter
, (
<
>)
exprStat
);
}
}
}
if
(
needEventHandler
)
{
<
types
::
>
;
WorkflowEventNamesVisitor
(
,
,
infos
,
instanceClass
,
);
context
(&
visitor
);
}
addDecl
(
ctor
);
if
(
needFunctionBody
)
{
{
auto
=
<
>();
getRmExpr
GetExpressionFromTypeDescriptor
(
description
::
<
>());
getRmExpr
.
=
L"GetResourceManager"
;
auto
=
<
>();
call1Expr
getRmExpr
;
auto
=
<
>();
getResExpr
call1Expr
;
getResExpr
.
=
L"GetResourceFromClassName"
;
auto
=
<
>();
classNameExpr
.
context
;
auto
=
<
>();
call2Expr
getResExpr
;
call2Expr
.
(
classNameExpr
);
auto
=
<
>();
varDecl
.
=
L"<resource>"
;
varDecl
call2Expr
;
auto
=
<
>();
varStat
varDecl
;
ctorBlock
.
(
varStat
);
}
{
auto
=
<
>();
resRef
.
=
L"<resource>"
;
auto
=
<
>();
resRef2
.
=
L"<resource>"
;
auto
=
<
>();
wdRef
resRef2
;
wdRef
.
=
L"WorkingDirectory"
;
auto
=
<
>();
newClassExpr
(
<
<
>>::
().
());
newClassExpr
.
(
resRef
);
newClassExpr
.
(
wdRef
);
auto
=
<
>();
varDecl
.
=
L"<resolver>"
;
varDecl
newClassExpr
;
auto
=
<
>();
varStat
varDecl
;
ctorBlock
.
(
varStat
);
}
{
auto
=
<
>();
setRef
<
>();
setRef
.
=
L"SetResourceResolver"
;
auto
=
<
>();
resolverRef
.
=
L"<resolver>"
;
auto
=
<
>();
callExpr
setRef
;
callExpr
.
(
resolverRef
);
auto
=
<
>();
stat
callExpr
;
ctorBlock
.
(
stat
);
}
{
auto
=
<
>();
initRef
<
>();
{
<
>
;
(
.
,
fragments
);
initRef
.
=
L"<"
+
(
fragments
).Aggregate([](
const
&
,
const
&
) {
return
a
+
L"-"
+
b
; }) +
L">Initialize"
;
}
auto
=
<
>();
callExpr
initRef
;
callExpr
.
(
<
>());
auto
=
<
>();
stat
callExpr
;
ctorBlock
.
(
stat
);
}
}
if
(
context
!=
L""
)
{
if
(
auto
=
(
, {
.
},
context
,
context
,
))
{
if
(
needFunctionBody
)
{
if
(!
stat
.
<
>())
{
auto
=
<
>();
block
.
(
stat
);
stat
block
;
}
auto
=
<
>();
decl
=
::
;
decl
.
=
L"<instance-ctor>"
;
decl
(
<
void
>::
().
());
decl
stat
;
addDecl
(
decl
);
{
auto
=
<
>();
refCtor
.
=
L"<instance-ctor>"
;
auto
=
<
>();
callExpr
refCtor
;
auto
=
<
>();
exprStat
callExpr
;
ctorBlock
.
(
exprStat
);
}
}
}
}
auto
=
<
>();
auto
=
<
>();
dtor
dtorBlock
;
if
(
context
!=
L""
)
{
if
(
auto
=
(
, {
.
},
context
,
context
,
))
{
if
(
needFunctionBody
)
{
if
(!
stat
.
<
>())
{
auto
=
<
>();
block
.
(
stat
);
stat
block
;
}
auto
=
<
>();
decl
=
::
;
decl
.
=
L"<instance-dtor>"
;
decl
(
<
void
>::
().
());
decl
stat
;
addDecl
(
decl
);
{
auto
=
<
>();
refDtor
.
=
L"<instance-dtor>"
;
auto
=
<
>();
callExpr
refDtor
;
auto
=
<
>();
exprStat
callExpr
;
dtorBlock
.
(
exprStat
);
}
}
}
}
{
auto
=
<
>();
ref
.
=
L"FinalizeGeneralInstance"
;
<
>
=
<
>();
*
[] =
{
description
::
<
>(),
description
::
<
>(),
description
::
<
>(),
};
if
(!
baseType
)
{
auto
=
context
;
while
(!
baseType
)
{
auto
=
(
currentContext
,
currentContext
.
(),
classNameRecord
);
if
(!
item
)
break
;
currentContext
=
item
->GetContent().Cast<
>();
auto
=
FindInstanceLoadingSource
(
currentContext
,
currentContext
.
());
baseType
()->
(
source
.
);
}
}
if
(
baseType
)
{
for
(
auto
:
types
)
{
if
(
baseType
()->
(
td
))
{
ref
.
=
L"FinalizeInstanceRecursively"
;
<
>
=
<
>(
td
,
::
);
typeInfo
<
>(
typeInfo
);
auto
=
<
>();
inferExpr
(
typeInfo
.
());
inferExpr
thisExpr
;
thisExpr
inferExpr
;
break
;
}
}
}
auto
=
<
>();
call
ref
;
call
.
(
thisExpr
);
auto
=
<
>();
stat
call
;
dtorBlock
.
(
stat
);
}
addDecl
(
dtor
);
return
module
;
}
#undef ERROR_CODE_PREFIX
class
GuiWorkflowSharedManagerPlugin
;
GuiWorkflowSharedManagerPlugin
*
=
0
;
class
GuiWorkflowSharedManagerPlugin
:
public
,
public
{
protected
:
<
>
;
public
:
GUI_PLUGIN_NAME(GacUI_Compiler_WorkflowSharedManager)
vl
::
()
override
{
return
L"GacUI_Compiler_WorkflowSharedManager"
; }
void
(
vl
::
collections
::
<
>&
)
override
{
}
void
()
override
{
sharedManagerPlugin
=
this
;
}
void
()
override
{
sharedManagerPlugin
=
0
;
}
*
()
{
if
(!
)
{
=
new
(
()->
(
L"WORKFLOW"
));
}
return
.
();
}
<
>
()
{
auto
=
;
nullptr
;
return
result
;
}
};
GUI_REGISTER_PLUGIN(GuiWorkflowSharedManagerPlugin)
class
GuiRegisterPluginClass_GuiWorkflowSharedManagerPlugin
{
public
:
GuiRegisterPluginClass_GuiWorkflowSharedManagerPlugin
() {
vl
::
presentation
::
controls
::
()->
(
new
GuiWorkflowSharedManagerPlugin
); } }
instance_GuiRegisterPluginClass_GuiWorkflowSharedManagerPlugin
;
*
Workflow_GetSharedManager
()
{
return
sharedManagerPlugin
->
();
}
<
>
Workflow_TransferSharedManager
()
{
return
sharedManagerPlugin
->
();
}
}
}