#include "WfRuntime.h"
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
namespace
{
using
namespace
reflection
;
using
namespace
reflection
::
description
;
using
namespace
workflow
::
runtime
;
using
namespace
collections
;
namespace
{
namespace
{
::
(
<
>
)
:assembly(
)
{
new
;
.
(
.
());
if
(
)
{
(
this
);
}
}
::
()
{
if
(
)
{
(
nullptr
);
}
}
<
>
::
(
collections
::
<
>&
,
<
>
,
<
>&
)
{
if
(!
)
{
if
(!
)
{
<
,
>
;
FOREACH_INDEXER(WString, name, index, names)
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__
.
(
name
);
index
++)
{
map
.
(
name
,
index
]);
}
=
::
(
(
map
)
.Select([](
<
,
>
)
{
return
<
,
>(
(
pair
.
),
pair
.
);
})
);
}
else
{
::
();
}
}
return
;
}
::
()
{
}
::
(
*
,
const
&
)
{
->
;
=
.
;
=
.
-
1
;
auto
=
];
if
(
->
.
() >
0
)
{
->
;
}
.
;
if
(
function
.
() >
0
)
{
new
;
.
(
function
.
());
for
(
=
0
;
i
<
.
();
i
++)
{
i
]
->
.
+
i
];
}
}
if
(
function
.
()>
0
)
{
new
;
.
(
function
.
());
for
(
=
0
;
i
<
.
();
i
++)
{
i
]
->
.
+
function
.
() +
i
];
}
}
}
::
()
{
}
<
>
::
()
{
return
(
]
,
,
);
}
<
>
::
()
{
return
(
]
,
,
);
}
<
>
::
()
{
return
(
]
,
,
);
}
<
>
::
()
{
return
(
,
,
);
}
::
()
{
if
(!
)
{
return
L"<EXTERNAL CODE>"
;
}
return
]
;
}
::
GetSourceCodeBeforeCodegen
()
{
if
(!
)
{
return
L""
;
}
const
auto
&
=
];
if
(
range
.
== -
1
)
{
return
L""
;
}
return
range
.
];
}
::
GetSourceCodeAfterCodegen
()
{
if
(!
)
{
return
L""
;
}
const
auto
&
=
];
if
(
range
.
== -
1
)
{
return
L""
;
}
return
range
.
];
}
::
()
{
if
(!
)
{
return
-
1
;
}
const
auto
&
=
];
return
range
.
.
;
}
::
()
{
if
(!
)
{
return
-
1
;
}
const
auto
&
=
];
return
range
.
.
;
}
::
(
const
&
,
bool
)
:message(
)
, fatal(
)
{
}
::
()
{
}
#pragma push_macro("GetMessage")
#if defined GetMessage
#undef GetMessage
#endif
::
()
{
return
;
}
#pragma pop_macro("GetMessage")
bool
::
()
{
return
;
}
<
>
::
()
{
if
(!
)
{
=
::
(
(
)
.Cast<
>()
.Select([](
<
>
)
{
return
(
callStack
);
})
);
}
return
;
}
::
(
<
>
)
:globalContext(
)
{
.
(
false
);
.
(
false
);
}
::
(
<
>
)
:globalContext(
new
(
))
{
.
(
false
);
.
(
false
);
}
&
::
()
{
return
.
() -
1
];
}
WfRuntimeThreadContextError
::
(
,
,
<
>
)
{
if
(
.
() ==
0
)
{
if
(
.
() <
)
{
return
WfRuntimeThreadContextError
::
;
}
}
else
{
auto
&
=
();
if
(
.
() -
frame
.
<
)
{
return
WfRuntimeThreadContextError
::
;
}
}
if
(
<
0
||
>=
.
())
{
return
WfRuntimeThreadContextError
::
;
}
auto
=
];
if
(
meta
.
() !=
)
{
return
WfRuntimeThreadContextError
::
;
}
if
(
meta
.
() ==
0
)
{
if
(
)
{
return
WfRuntimeThreadContextError
::
WrongCapturedVariableCount
;
}
}
else
{
if
(!
||
.
() !=
meta
.
())
{
return
WfRuntimeThreadContextError
::
WrongCapturedVariableCount
;
}
}
;
frame
.
;
frame
.
=
;
frame
.
=
]
;
frame
.
=
.
() -
;
frame
.
=
meta
.
() +
meta
.
();
frame
.
=
frame
.
+
frame
.
;
.
(
frame
);
for
(
=
0
;
i
<
meta
.
();
i
++)
{
.
(
());
}
if
(
==
::
||
==
::
)
{
=
::
;
}
return
WfRuntimeThreadContextError
::
;
}
WfRuntimeThreadContextError
::
()
{
if
(
.
() ==
0
)
return
WfRuntimeThreadContextError
::
;
=
();
if
(
.
() >
0
)
{
&
=
();
if
(
trapFrame
.
==
.
() -
1
)
{
return
WfRuntimeThreadContextError
::
;
}
}
.
(
.
() -
1
);
if
(
.
() >
frame
.
)
{
.
(
frame
.
,
.
() -
frame
.
);
}
return
WfRuntimeThreadContextError
::
;
}
&
::
()
{
return
.
() -
1
];
}
WfRuntimeThreadContextError
::
(
)
{
;
frame
.
=
.
() -
1
;
frame
.
=
;
frame
.
=
.
();
.
(
frame
);
return
WfRuntimeThreadContextError
::
;
}
WfRuntimeThreadContextError
::
(
)
{
if
(
.
() ==
0
)
return
WfRuntimeThreadContextError
::
;
&
=
.
() -
1
];
if
(
frame
.
!=
.
() -
1
)
return
WfRuntimeThreadContextError
::
;
=
.
() -
frame
.
-
;
if
(
stackPopCount
<
0
)
{
return
WfRuntimeThreadContextError
::
;
}
else
if
(
stackPopCount
>
0
)
{
.
(
.
() -
stackPopCount
,
stackPopCount
);
}
.
(
.
() -
1
);
return
WfRuntimeThreadContextError
::
;
}
WfRuntimeThreadContextError
::
(
const
&
)
{
if
(
.
)
{
switch
(
.
)
{
case
::
:
return
(
(
.
));
case
::
:
CHECK_ERROR(value.typeDescriptor->GetEnumType(), L"WfRuntimeThreadContext::PushValue(const WfRuntimeValue&)#Missing typeDescriptor in WfRuntimeValue!");
do
{
if
(!(
.
->
()))
throw
(
L"WfRuntimeThreadContext::PushValue(const WfRuntimeValue&)#Missing typeDescriptor in WfRuntimeValue!"
);}
while
(
0
);
return
(
.
->
()->
(
.
));
}
CHECK_FAIL(L"WfRuntimeThreadContext::PushValue(const WfRuntimeValue&)#Unexpected type in WfRuntimeValue with typeDescriptor!");
do
{
throw
(
L"WfRuntimeThreadContext::PushValue(const WfRuntimeValue&)#Unexpected type in WfRuntimeValue with typeDescriptor!"
);}
while
(
0
);
}
else
{
switch
(
.
)
{
case
::
:
return
(
(
.
));
case
::
:
return
(
(
.
));
case
::
:
return
(
(
.
));
case
::
:
return
(
(
.
));
case
::
:
return
(
(
.
));
case
::
:
return
(
(
.
));
case
::
:
return
(
(
.
));
case
::
:
return
(
(
.
));
case
::
:
return
(
(
.
));
case
::
:
return
(
(
.
));
case
::
:
return
(
(
.
));
case
::
:
return
(
(
.
));
default
:
return
(
());
}
}
}
WfRuntimeThreadContextError
::
(
const
reflection
::
description
::
&
)
{
.
(
);
return
WfRuntimeThreadContextError
::
;
}
WfRuntimeThreadContextError
::
(
reflection
::
description
::
&
)
{
if
(
.
() ==
0
)
{
if
(
.
() ==
0
)
return
WfRuntimeThreadContextError
::
;
}
else
{
&
=
();
if
(
.
() <=
frame
.
)
return
WfRuntimeThreadContextError
::
;
}
.
() -
1
];
.
(
.
() -
1
);
return
WfRuntimeThreadContextError
::
;
}
WfRuntimeThreadContextError
::
(
const
&
,
bool
,
bool
)
{
auto
=
<
>(
,
);
return
(
info
,
);
}
WfRuntimeThreadContextError
::
(
<
>
,
bool
)
{
;
=
?
::
:
::
;
if
(
.
() ==
0
)
{
if
(
auto
=
GetDebuggerForCurrentThread
())
{
=
debugger
().
();
for
(
=
contextCount
-
1
;
i
>=
0
;
i
--)
{
auto
=
debugger
()
i
];
=
context
->
.
();
for
(
=
stackCount
-
1
;
j
>=
0
;
j
--)
{
const
auto
&
=
context
->
j
];
.
(
new
(
context
,
stackFrame
));
}
if
(
i
>
0
)
{
.
(
new
);
}
}
if
(!
)
{
if
(
auto
=
(
debugger
.
()))
{
if
(
callback
->
(
))
{
if
(!
callback
->
())
{
(
L"Internal error: Debugger stopped the program."
,
true
,
true
);
}
}
}
}
}
}
return
WfRuntimeThreadContextError
::
;
}
WfRuntimeThreadContextError
::
(
,
reflection
::
description
::
&
)
{
if
(
.
() ==
0
)
return
WfRuntimeThreadContextError
::
;
auto
=
();
if
(
<
frame
.
||
>=
.
())
{
return
WfRuntimeThreadContextError
::
;
}
];
return
WfRuntimeThreadContextError
::
;
}
WfRuntimeThreadContextError
::
(
,
reflection
::
description
::
&
)
{
if
(
<
0
||
>=
.
())
{
return
WfRuntimeThreadContextError
::
;
}
];
return
WfRuntimeThreadContextError
::
;
}
WfRuntimeThreadContextError
::
(
,
const
reflection
::
description
::
&
)
{
if
(
<
0
||
>=
.
())
{
return
WfRuntimeThreadContextError
::
;
}
]
;
return
WfRuntimeThreadContextError
::
;
}
WfRuntimeThreadContextError
::
(
,
reflection
::
description
::
&
)
{
if
(
.
() ==
0
)
return
WfRuntimeThreadContextError
::
;
auto
=
();
if
(
<
0
||
>=
frame
.
.
())
{
return
WfRuntimeThreadContextError
::
;
}
frame
.
];
return
WfRuntimeThreadContextError
::
;
}
WfRuntimeThreadContextError
::
(
,
const
reflection
::
description
::
&
)
{
if
(
.
() ==
0
)
return
WfRuntimeThreadContextError
::
;
auto
=
();
if
(
<
0
||
>=
frame
.
.
())
{
return
WfRuntimeThreadContextError
::
;
}
frame
.
]
;
return
WfRuntimeThreadContextError
::
;
}
WfRuntimeThreadContextError
::
(
,
reflection
::
description
::
&
)
{
if
(
.
() ==
0
)
return
WfRuntimeThreadContextError
::
;
auto
=
();
if
(
<
0
||
>=
frame
.
)
{
return
WfRuntimeThreadContextError
::
;
}
frame
.
+
];
return
WfRuntimeThreadContextError
::
;
}
WfRuntimeThreadContextError
::
(
,
const
reflection
::
description
::
&
)
{
if
(
.
() ==
0
)
return
WfRuntimeThreadContextError
::
;
auto
=
();
if
(
<
0
||
>=
frame
.
)
{
return
WfRuntimeThreadContextError
::
;
}
frame
.
+
]
;
return
WfRuntimeThreadContextError
::
;
}
void
::
()
{
auto
=
();
if
(
callback
)
{
callback
->
(
this
);
}
while
(
(
callback
) !=
::
);
if
(
callback
)
{
callback
->
(
this
);
}
}
}
}
}
#endif