#ifndef VCZH_REFLECTION_GUITYPEDESCRIPTORBUILDER
#define VCZH_REFLECTION_GUITYPEDESCRIPTORBUILDER
#include "GuiTypeDescriptorPredefined.h"
namespace
{
namespace
{
template
<
typename
>
class
;
}
namespace
{
namespace
{
#ifndef VCZH_DEBUG_NO_REFLECTION
#define DECL_TYPE_INFO(TYPENAME) template<>struct TypeInfo<TYPENAME>{ static const TypeInfoContent content; };
#define IMPL_VL_TYPE_INFO(TYPENAME) const TypeInfoContent TypeInfo<TYPENAME>::content = { L ## #TYPENAME, nullptr, TypeInfoContent::VlppType };
#define IMPL_CPP_TYPE_INFO(TYPENAME) const TypeInfoContent TypeInfo<TYPENAME>::content = { L ## #TYPENAME, nullptr, TypeInfoContent::CppType };
#define IMPL_TYPE_INFO_RENAME(TYPENAME, EXPECTEDNAME) const TypeInfoContent TypeInfo<TYPENAME>::content = { L ## #EXPECTEDNAME, L ## #TYPENAME, TypeInfoContent::Renamed };
struct
{
enum
{
,
,
,
};
const
wchar_t
*
;
const
wchar_t
*
;
;
};
template
<
typename
>
struct
{
};
template
<
typename
>
*
()
{
static
= -
1
;
static
*
=
nullptr
;
if
(
auto
=
())
{
auto
=
tm
->
();
if
(
typeVersion
!=
currentVersion
)
{
cached
=
(
<
>::
.typeName);
}
return
cached
;
}
else
{
typeVersion
= -
1
;
return
nullptr
;
}
}
#endif
#ifndef VCZH_DEBUG_NO_REFLECTION
class
:
public
,
public
{
protected
:
*
;
;
public
:
(
*
,
);
();
()
override
;
()
override
;
*
()
override
;
*
()
override
;
()
override
;
*
(
)
override
;
()
override
;
};
class
:
public
,
public
{
protected
:
<
>
;
public
:
(
<
>
);
();
()
override
;
*
()
override
;
*
()
override
;
()
override
;
*
(
)
override
;
};
class
:
public
{
public
:
(
<
>
);
();
()
override
;
()
override
;
};
class
:
public
{
public
:
(
<
>
);
();
()
override
;
()
override
;
};
class
:
public
{
public
:
(
<
>
);
();
()
override
;
()
override
;
};
class
:
public
{
protected
:
collections
::
<
<
>>
;
public
:
(
<
>
);
();
()
override
;
()
override
;
*
(
)
override
;
()
override
;
void
(
<
>
);
};
#endif
#ifndef VCZH_DEBUG_NO_REFLECTION
class
:
public
,
public
,
private
::
{
private
:
;
const
*
;
;
;
const
&
()
override
;
protected
:
const
*
GetTypeInfoContentInternal
();
public
:
(
,
const
*
);
();
::
*
()
override
;
()
override
;
const
&
()
override
;
};
class
:
public
{
protected
:
bool
;
<
>
;
<
>
;
<
>
;
virtual
void
();;
void
();
public
:
(
,
const
*
);
();
bool
()
override
;
*
()
override
;
*
()
override
;
*
()
override
;
GetBaseTypeDescriptorCount
()
override
;
*
(
)
override
;
bool
(
*
)
override
;
()
override
;
*
(
)
override
;
bool
(
const
&
,
bool
)
override
;
*
(
const
&
,
bool
)
override
;
()
override
;
*
(
)
override
;
bool
(
const
&
,
bool
)
override
;
*
(
const
&
,
bool
)
override
;
()
override
;
*
(
)
override
;
bool
(
const
&
,
bool
)
override
;
*
(
const
&
,
bool
)
override
;
*
()
override
;
};
template
<
typename
,
>
class
TypedValueTypeDescriptorBase
:
public
{
public
:
TypedValueTypeDescriptorBase
()
:
(
, &
<
>::
)
{
}
};
class
:
public
,
public
{
protected
:
*
;
;
<
>
;
public
:
(
*
,
const
&
,
<
>
);
();
*
()
override
;
const
&
()
override
;
*
()
override
;
*
()
override
;
};
class
:
public
,
public
{
friend
class
;
protected
:
*
;
*
;
collections
::
<
<
>>
;
<
>
;
bool
;
virtual
(
const
&
,
collections
::
<
>&
)=
0
;
virtual
CreateFunctionProxyInternal
(
const
&
) =
0
;
public
:
(
*
,
<
>
,
bool
);
();
*
()
override
;
*
()
override
;
const
&
()
override
;
*
()
override
;
()
override
;
*
(
)
override
;
*
()
override
;
bool
()
override
;
void
(
collections
::
<
>&
)
override
;
(
const
&
,
collections
::
<
>&
)
override
;
(
const
&
)
override
;
bool
(
<
>
);
bool
(
*
);
};
class
:
public
,
public
{
protected
:
*
;
;
collections
::
<
<
>>
;
public
:
(
*
,
const
&
);
();
*
()
override
;
const
&
()
override
;
()
override
;
*
(
)
override
;
bool
(
<
>
);
};
class
:
public
,
public
{
friend
class
;
protected
:
*
;
collections
::
<
*>
;
;
<
>
;
virtual
<
>
(
*
,
<
>
)=
0
;
virtual
bool
(
*
,
<
>
)=
0
;
virtual
void
(
*
,
<
>
)=
0
;
virtual
<
>
()=
0
;
public
:
(
*
,
const
&
);
();
*
()
override
;
const
&
()
override
;
*
()
override
;
GetObservingPropertyCount
()
override
;
*
(
)
override
;
<
>
(
const
&
,
<
>
)
override
;
bool
(
const
&
,
<
>
)
override
;
void
(
const
&
,
<
>
)
override
;
};
class
:
public
,
public
{
protected
:
*
;
;
<
>
;
*
;
*
;
*
;
public
:
(
*
,
const
&
,
*
,
*
,
*
);
();
*
()
override
;
const
&
()
override
;
::
*
()
override
;
bool
()
override
;
bool
()
override
;
*
()
override
;
*
()
override
;
*
()
override
;
*
()
override
;
(
const
&
)
override
;
void
(
&
,
const
&
)
override
;
};
class
PropertyInfoImpl_StaticCpp
:
public
,
private
::
{
private
:
;
const
&
()
override
;
public
:
PropertyInfoImpl_StaticCpp
(
*
,
const
&
,
*
,
*
,
*
,
const
&
);
~
PropertyInfoImpl_StaticCpp
();
::
*
()
override
;
};
class
:
public
,
public
{
protected
:
*
;
<
>
;
;
virtual
(
const
&
)=
0
;
virtual
void
(
&
,
const
&
)=
0
;
public
:
(
*
,
const
&
,
<
>
);
();
*
()
override
;
const
&
()
override
;
bool
()
override
;
bool
()
override
;
*
()
override
;
*
()
override
;
*
()
override
;
*
()
override
;
(
const
&
)
override
;
void
(
&
,
const
&
)
override
;
};
class
:
public
{
private
:
bool
;
collections
::
<
*>
;
collections
::
<
,
<
>>
;
collections
::
<
,
<
>>
;
collections
::
<
,
<
>>
;
<
>
;
protected
:
*
(
const
&
);
*
();
*
(
<
>
);
*
(
<
>
);
*
(
const
&
,
<
>
);
*
(
<
>
);
void
(
*
);
virtual
void
()=
0
;
void
();
public
:
(
,
const
*
);
();
bool
()
override
;
*
()
override
;
*
()
override
;
*
()
override
;
GetBaseTypeDescriptorCount
()
override
;
*
(
)
override
;
bool
(
*
)
override
;
()
override
;
*
(
)
override
;
bool
(
const
&
,
bool
)
override
;
*
(
const
&
,
bool
)
override
;
()
override
;
*
(
)
override
;
bool
(
const
&
,
bool
)
override
;
*
(
const
&
,
bool
)
override
;
()
override
;
*
(
)
override
;
bool
(
const
&
,
bool
)
override
;
*
(
const
&
,
bool
)
override
;
*
()
override
;
};
#endif
enum
class
{
=
0
,
=
1
<<
0
,
=
1
<<
1
,
=
1
<<
2
,
=
1
<<
3
,
=
1
<<
4
,
=
1
<<
5
,
=
1
<<
6
,
};
template
<
typename
>
struct
{
*
;
};
template
<
typename
>
struct
<
&>
{
*
;
};
template
<
typename
,
>
struct
{
static
const
=
::
;
};
template
<
typename
>
struct
<
,
::
>
{
template
<
typename
>
static
void
*
(
const
<
>*
){
return
{}; }
static
char
(
void
*
){
return
{}; }
static
char
(
const
void
*
){
return
{}; }
static
const
=
sizeof
(
(((
<
>*)
0
)->
))==
sizeof
(
void
*)?
::
:
::
;
};
template
<
typename
>
struct
<
,
::
>
{
template
<
typename
>
static
void
*
(
const
collections
::
<
>*
){
return
{}; }
static
char
(
void
*
){
return
{}; }
static
char
(
const
void
*
){
return
{}; }
static
const
=
sizeof
(
(((
<
>*)
0
)->
))==
sizeof
(
void
*)?
::
:
::
;
};
template
<
typename
>
struct
<
,
::
>
{
template
<
typename
>
static
void
*
(
const
collections
::
<
>*
){
return
{}; }
static
char
(
void
*
){
return
{}; }
static
char
(
const
void
*
){
return
{}; }
static
const
=
sizeof
(
(((
<
>*)
0
)->
))==
sizeof
(
void
*)?
::
:
::
;
};
template
<
typename
>
struct
<
,
::
>
{
template
<
typename
>
static
void
*
(
collections
::
<
>*
){
return
{}; }
static
char
(
void
*
){
return
{}; }
static
char
(
const
void
*
){
return
{}; }
static
const
=
sizeof
(
(((
<
>*)
0
)->
))==
sizeof
(
void
*)?
::
:
::
;
};
template
<
typename
>
struct
<
,
::
>
{
template
<
typename
>
static
void
*
(
collections
::
<
>*
) {
return
{}; }
static
char
(
void
*
) {
return
{}; }
static
char
(
const
void
*
) {
return
{}; }
static
const
=
sizeof
(
(((
<
>*)
0
)->
)) ==
sizeof
(
void
*) ?
::
:
::
;
};
template
<
typename
>
struct
<
,
::
>
{
template
<
typename
,
typename
>
static
void
*
(
const
collections
::
<
,
>*
){
return
{}; }
static
char
(
void
*
){
return
{}; }
static
char
(
const
void
*
){
return
{}; }
static
const
=
sizeof
(
(((
<
>*)
0
)->
))==
sizeof
(
void
*)?
::
:
::
;
};
template
<
typename
>
struct
<
,
::
>
{
template
<
typename
,
typename
>
static
void
*
(
collections
::
<
,
>*
){
return
{}; }
static
char
(
void
*
){
return
{}; }
static
char
(
const
void
*
){
return
{}; }
static
const
=
sizeof
(
(((
<
>*)
0
)->
))==
sizeof
(
void
*)?
::
:
::
;
};
template
<
typename
,
>
struct
{
static
const
=
::
;
};
template
<
typename
>
struct
<
, (
)((
)
::
)>
{
static
const
=
::
;
};
template
<
typename
>
struct
<
, (
)((
)
::
|(
)
::
)>
{
static
const
=
::
;
};
template
<
typename
>
struct
<
, (
)((
)
::
|(
)
::
|(
)
::
)>
{
static
const
=
::
;
};
template
<
typename
>
struct
<
, (
)((
)
::
|(
)
::
)>
{
static
const
=
::
;
};
template
<
typename
>
struct
<
, (
)((
)
::
|(
)
::
|(
)
::
)>
{
static
const
=
::
;
};
template
<
typename
>
struct
<
, (
)((
)
::
)>
{
static
const
=
::
;
};
template
<
typename
>
struct
<
, (
)((
)
::
|(
)
::
|(
)
::
|(
)
::
)>
{
static
const
=
::
;
};
template
<
typename
>
struct
<
, (
)((
)
::
|(
)
::
)>
{
static
const
=
::
;
};
template
<
typename
>
struct
{
static
const
=
<
,
(
)
( (
)
<
,
::
>::
| (
)
<
,
::
>::
| (
)
<
,
::
>::
| (
)
<
,
::
>::
| (
)
<
,
::
>::
| (
)
<
,
::
>::
| (
)
<
,
::
>::
)
>::
;
};
template
<
typename
>
struct
{
static
const
=
::
;
};
template
<
>
struct
TypeHintTesterForReference
{
static
const
=
::
NativeCollectionReference
;
};
template
<>
struct
TypeHintTesterForReference
<
::
>
{
static
const
=
::
;
};
template
<>
struct
TypeHintTesterForReference
<
::
>
{
static
const
=
::
;
};
template
<
typename
>
struct
<
*>
{
static
const
=
<
>::
;
};
template
<
typename
>
struct
<
&>
{
static
const
=
<
>::
==
::
?
TypeHintTesterForReference
<
<
&>::
>::
:
<
>::
;
};
template
<
typename
>
struct
<
const
>
{
static
const
=
<
>::
;
};
template
<
typename
>
struct
<
collections
::
<
>>
{
static
const
=
::
;
};
template
<
typename
>
struct
<
collections
::
<
>>
{
static
const
=
::
;
};
template
<
typename
>
struct
<
collections
::
<
>>
{
static
const
=
::
;
};
template
<
typename
>
struct
<
collections
::
<
>>
{
static
const
=
::
;
};
template
<
typename
>
struct
<
collections
::
<
>>
{
static
const
=
::
;
};
template
<
typename
,
typename
>
struct
<
collections
::
<
,
>>
{
static
const
=
::
;
};
template
<
typename
,
>
struct
{
static
const
::
=
::
;
typedef
void
;
typedef
void
;
typedef
void
;
typedef
void
;
};
template
<
typename
>
struct
{
static
const
=
<
>::
;
static
const
=
<
>::
;
static
const
::
=
<
,
>::
;
typedef
typename
<
,
>::
;
typedef
typename
<
,
>::
;
typedef
typename
<
,
>::
;
typedef
typename
<
,
>::
;
#ifndef VCZH_DEBUG_NO_REFLECTION
static
<
>
()
{
return
<
typename
<
>::
,
>::
(
);
}
#endif
};
template
<
typename
,
::
>
struct
{
};
template
<
typename
>
(
const
&
,
*
=
0
)
{
using
=
typename
<
>::
;
return
<
,
<
>::
>::
(
,
);
}
template
<
typename
>
(
const
&
,
*
=
0
,
const
&
=
L"value"
)
{
using
=
typename
<
>::
;
return
<
,
<
>::
>::
(
,
,
);
}
template
<
typename
,
>
struct
{
};
template
<
typename
>
(
typename
<
>::
,
*
=
0
)
{
return
<
typename
<
>::
,
<
>::
>::
(
,
);
}
template
<
typename
>
void
(
const
&
,
&
,
*
=
0
,
const
&
=
L"value"
)
{
<
,
<
>::
>::
(
,
,
,
);
}
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
class
{
protected
:
collections
::
<
>
;
public
:
()
{
}
template
<
typename
>
&
(
&
)
{
.
(
.
() +
1
);
.
() -
1
]
<
>(
);
return
*
this
;
}
template
<
typename
>
&
(
const
&
)
{
.
(
.
() +
1
);
.
() -
1
]
<
const
>(
);
return
*
this
;
}
&
(
const
&
)
{
.
(
.
()+
1
);
.
()-
1
]
;
return
*
this
;
}
collections
::
<
>&()
{
return
;
}
};
template
<
typename
,
typename
>
class
:
public
{
protected
:
::*
;
(
const
&
)
override
{
*
=
<
*>(
);
if
(
object
)
{
return
<
>(
object
->*
,
()->
());
}
return
();
}
void
(
&
,
const
&
)
override
{
*
=
<
*>(
);
if
(
object
)
{
<
>(
,
object
->*
,
()->
(),
L"newValue"
);
}
}
public
:
(
*
,
const
&
,
::*
)
:
(
,
,
<
>::
())
, fieldRef(
)
{
}
::
*
()
override
{
return
nullptr
;
}
};
#endif
#ifndef VCZH_DEBUG_NO_REFLECTION
template
<
typename
>
class
:
public
,
public
virtual
{
public
:
()
override
{
return
<
>(
TypedValueSerializerProvider
<
>::
());
}
::
(
const
&
,
const
&
)
override
{
auto
=
<
>(
);
auto
=
<
>(
);
return
TypedValueSerializerProvider
<
>::
(
va
,
vb
);
}
};
template
<
typename
>
class
:
public
,
public
virtual
{
public
:
bool
(
const
&
,
&
)
override
{
return
TypedValueSerializerProvider
<
>::
(
<
>(
),
);
}
bool
(
const
&
,
&
)
override
{
;
if
(!
TypedValueSerializerProvider
<
>::
(
,
value
))
{
return
false
;
}
<
>(
value
);
return
true
;
}
};
#endif
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
template
<
typename
>
class
:
public
TypedValueTypeDescriptorBase
<
,
::
>
{
protected
:
void
()
override
{
this
->
new
<
>();
this
->
new
<
>();
}
};
template
<
typename
>
class
:
public
,
public
virtual
{
public
:
()
override
{
return
<
>(
static_cast
<
>(
0
));
}
::
(
const
&
,
const
&
)
override
{
auto
=
static_cast
<
>(
<
>(
));
auto
=
static_cast
<
>(
<
>(
));
if
(
ea
<
eb
)
return
::
;
if
(
ea
>
eb
)
return
::
;
return
::
;
}
};
template
<
typename
,
bool
>
class
:
public
,
public
virtual
{
protected
:
collections
::
<
,
>
;
public
:
void
(
,
)
{
.
(
,
);
}
bool
()
override
{
return
;
}
()
override
{
return
.
();
}
(
)
override
{
if
(
<
0
||
>=
.
())
{
return
L""
;
}
return
.
()
];
}
(
)
override
{
if
(
<
0
||
>=
.
())
{
return
0
;
}
return
static_cast
<
>(
.
()
]);
}
(
)
override
{
return
.
().
(
);
}
(
)
override
{
return
<
>(
static_cast
<
>(
));
}
(
const
& )
override
{
return
static_cast
<
>(
<
>(
));
}
};
template
<
typename
,
>
class
:
public
TypedValueTypeDescriptorBase
<
,
>
{
using
=
<
,
==
::
>;
protected
:
<
>
;
void
()
override
{
this
->
=
new
;
this
->
new
<
>();
TypedValueTypeDescriptorBase
<
,
>::
=
;
}
};
template
<
typename
>
class
:
public
,
public
virtual
{
public
:
()
override
{
return
<
>(
{});
}
::
(
const
&
,
const
&
)
override
{
return
::
;
}
};
template
<
typename
,
>
class
:
public
TypedValueTypeDescriptorBase
<
,
>
{
protected
:
template
<
typename
>
class
:
public
{
protected
:
::*
;
(
const
&
)
override
{
auto
=
.
().
<
::
<
>>();
if
(!
structValue
)
{
throw
ArgumentTypeMismtatchException
(
L"thisObject"
,
(),
::
,
);
}
return
<
>(
structValue
.*
);
}
void
(
&
,
const
&
)
override
{
auto
=
.
().
<
::
<
>>();
if
(!
structValue
)
{
throw
ArgumentTypeMismtatchException
(
L"thisObject"
,
(),
::
,
);
}
(
structValue
.*
) =
<
>(
);
}
public
:
(
*
,
::*
,
const
&
)
:field(
)
,
(
,
,
<
>::
())
{
}
::
*
()
override
{
return
nullptr
;
}
};
protected
:
collections
::
<
,
<
>>
;
public
:
()
{
this
->
new
<
>();
}
()
override
{
this
->
();
return
.
();
}
*
(
)
override
{
this
->
();
if
(
<
0
||
>=
.
())
{
return
nullptr
;
}
return
.
()
].
();
}
bool
(
const
&
,
bool
)
override
{
this
->
();
return
.
().
(
);
}
*
(
const
&
,
bool
)
override
{
this
->
();
=
.
().
(
);
if
(
index
== -
1
)
return
nullptr
;
return
.
()
index
].
();
}
};
#endif
}
}
}
#endif