#ifndef VCZH_REFLECTION_GUITYPEDESCRIPTOR
#define VCZH_REFLECTION_GUITYPEDESCRIPTOR
#include <VlppOS.h>
#if (defined VCZH_DEBUG_NO_REFLECTION) && (defined VCZH_DEBUG_METAONLY_REFLECTION)
static_assert(false, "Preprocessor VCZH_DEBUG_NO_REFLECTION and VCZH_DEBUG_METAONLY_REFLECTION could not be defined at the same time.")
#endif
#if !(defined VCZH_DEBUG_NO_REFLECTION) && !(defined VCZH_DEBUG_METAONLY_REFLECTION)
#define VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
#endif
namespace
{
namespace
{
namespace
{
class
;
class
;
class
;
class
;
class
;
class
;
class
;
class
;
class
;
class
;
class
;
class
;
class
;
class
;
class
;
class
;
class
;
class
;
class
;
class
;
template
<
typename
>
struct
TypedValueSerializerProvider
{
};
}
class
{
template
<
typename
T,
typename
Enabled>
friend
struct
vl
::
;
template
<
typename
T>
friend
class
Description;
typedef
collections
::
<
,
<
>>
;
typedef
bool
(*
)(
* obj,
bool
forceDisposing);
private
:
volatile
;
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
;
description
::
**
;
#endif
<
>
;
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
bool
;
**
;
;
#endif
protected
:
;
protected
:
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
bool
();
();
*
();
void
(
*
);
*
(
);
void
(
,
*
);
void
(
,
<
>&
);
void
(
);
#endif
void
();
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
template
<
typename
>
void
(
*&
)
{
auto
=
dynamic_cast
<
*>(
this
);
if
(
expected
)
{
CHECK_ERROR(result == nullptr, L"vl::reflection::DescriptableObject::SafeAggregationCast<T>()#Found multiple ways to do aggregation cast.");
do
{
if
(!(
==
nullptr
))
throw
(
L"vl::reflection::DescriptableObject::SafeAggregationCast<T>()#Found multiple ways to do aggregation cast."
);}
while
(
0
);
=
expected
;
}
if
(
())
{
for
(
=
0
;
i
<
;
i
++)
{
if
(
auto
=
(
i
))
{
parent
->
<
>(
);
}
}
}
}
#endif
public
:
();
virtual
();
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
description
::
*
();
#endif
<
>
(
const
&
);
void
(
const
&
,
<
>
);
bool
(
bool
);
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
*
();
#endif
template
<
typename
>
*
()
{
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
*
=
nullptr
;
()->
<
>(
result
);
return
result
;
#else
return dynamic_cast<T*>(this);
#endif
}
};
template
<
typename
>
class
:
public
virtual
{
protected
:
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
static
description
::
*
;
#endif
public
:
()
{
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
if
(
<
sizeof
(
))
{
=
sizeof
(
);
if
(!
|| !*
||
)
{
=&
;
}
}
#endif
}
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
static
description
::
*
GetAssociatedTypeDescriptor
()
{
return
;
}
static
void
SetAssociatedTypeDescriptor
(
description
::
*
)
{
=
;
}
#endif
};
template
<
typename
>
class
:
public
<
>
{
};
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
template
<
typename
>
description
::
*
<
>::
=
0
;
#endif
class
:
public
virtual
,
public
<
>
{
public
:
(){}
};
}
template
<
typename
>
struct
<
,
typename
<
,
reflection
::
>::
>
{
static
__forceinline
volatile
*
(
*
)
{
reflection
::
*
=
;
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
if
(
obj
->
())
{
if
(
auto
=
obj
->
())
{
return
&
root
->
;
}
}
#endif
return
&
obj
->
;
}
static
__forceinline
void
(
volatile
*
,
void
*
)
{
reflection
::
*
=(
*)
;
obj
->
(
false
);
}
};
namespace
{
namespace
{
class
:
public
virtual
,
public
<
>
{
public
:
enum
{
,
,
,
,
};
virtual
<
>
() =
0
;
virtual
(
<
>
) =
0
;
};
class
:
public
{
public
:
enum
{
,
,
,
,
};
protected
:
;
*
;
<
>
;
<
>
;
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
*
;
#endif
(
*
);
(
<
>
);
(
<
>
,
*
);
(
const
&
,
const
&
)
const
;
public
:
();
(
const
&
);
&
(
const
&
);
bool
(
const
&
)
const
{
return
(*
this
,
) ==
0
; }
bool
(
const
&
)
const
{
return
(*
this
,
) !=
0
; }
bool
(
const
&
)
const
{
return
(*
this
,
)<
0
; }
bool
(
const
&
)
const
{
return
(*
this
,
) <=
0
; }
bool
(
const
&
)
const
{
return
(*
this
,
)>
0
; }
bool
(
const
&
)
const
{
return
(*
this
,
) >=
0
; }
()
const
;
*
()
const
;
<
>
()
const
;
<
>
()
const
;
bool
()
const
;
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
*
()
const
;
()
const
;
bool
(
*
,
)
const
;
bool
(
*
)
const
;
#endif
static
(
*
);
static
(
<
>
);
static
(
<
>
,
*
);
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
static
*
(
*
,
collections
::
<
>&
);
static
(
*
);
static
(
*
,
collections
::
<
>&
);
static
(
const
&
);
static
(
const
&
,
collections
::
<
>&
);
static
(
const
&
,
const
&
);
static
(
const
&
,
const
&
,
collections
::
<
>&
);
(
const
&
)
const
;
void
(
const
&
,
const
&
);
(
const
&
)
const
;
(
const
&
,
collections
::
<
>&
)
const
;
<
>
(
const
&
,
const
&
)
const
;
bool
(
const
&
,
<
>
)
const
;
#endif
bool
();
};
class
:
public
virtual
,
public
<
>
{
public
:
template
<
typename
>
class
:
public
{
private
:
template
<
typename
=
>
static
(
const
&
,
const
&
,
typename
<
,
decltype
(&
TypedValueSerializerProvider
<
>::Compare)>::Type)
{
return
TypedValueSerializerProvider
<
>::
(
,
);
}
template
<
typename
=
>
static
(
const
&
,
const
&
,
double
)
{
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdynamic-class-memaccess"
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wclass-memaccess"
#endif
auto
=
(&
, &
,
sizeof
(
));
#if defined(__clang__)
#pragma clang diagnostic pop
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
if
(
result
<
0
)
return
::
;
if
(
result
>
0
)
return
::
;
return
::
;
}
public
:
;
()
:value{}
{
}
(
const
&
)
:value(
)
{
}
<
>
()
override
{
return
new
<
>(
);
}
(
<
>
)
override
{
if
(
auto
=
.
<
<
>>())
{
return
(
,
typedBox
, (
)
0
);
}
else
{
return
::
;
}
}
};
virtual
() =
0
;
virtual
::
(
const
&
,
const
&
) =
0
;
};
class
:
public
virtual
,
public
<
>
{
public
:
virtual
bool
() =
0
;
virtual
() =
0
;
virtual
(
) =
0
;
virtual
(
) =
0
;
virtual
(
) =
0
;
virtual
(
) =
0
;
virtual
(
const
& ) =
0
;
};
class
:
public
virtual
,
public
<
>
{
public
:
virtual
bool
(
const
&
,
&
) =
0
;
virtual
bool
(
const
&
,
&
) =
0
;
};
enum
class
{
,
,
,
,
,
,
,
NativeCollectionReference
,
};
class
:
public
virtual
,
public
<
>
{
public
:
enum
{
,
,
,
,
,
};
virtual
() =
0
;
virtual
() =
0
;
virtual
*
() =
0
;
virtual
*
() =
0
;
virtual
() =
0
;
virtual
*
(
) =
0
;
virtual
() =
0
;
};
class
:
public
virtual
,
public
<
>
{
public
:
virtual
*
()=
0
;
virtual
const
&
()=
0
;
};
class
:
public
virtual
,
public
<
>
{
public
:
virtual
bool
()=
0
;
};
class
:
public
virtual
,
public
<
>
{
public
:
class
:
public
virtual
,
public
<
>
{
public
:
virtual
const
&
() =
0
;
virtual
const
&
() =
0
;
virtual
const
&
() =
0
;
};
virtual
*
() =
0
;
virtual
*
()=
0
;
virtual
GetObservingPropertyCount
()=
0
;
virtual
*
(
)=
0
;
virtual
<
>
(
const
&
,
<
>
)=
0
;
virtual
bool
(
const
&
,
<
>
)=
0
;
virtual
void
(
const
&
,
<
>
)=
0
;
};
class
:
public
virtual
,
public
<
>
{
public
:
class
:
public
virtual
,
public
<
>
{
public
:
virtual
const
&
() =
0
;
};
virtual
*
() =
0
;
virtual
bool
()=
0
;
virtual
bool
()=
0
;
virtual
*
()=
0
;
virtual
*
()=
0
;
virtual
*
()=
0
;
virtual
*
()=
0
;
virtual
(
const
&
)=
0
;
virtual
void
(
&
,
const
&
)=
0
;
};
class
:
public
virtual
,
public
<
>
{
public
:
virtual
*
()=
0
;
virtual
*
()=
0
;
};
class
:
public
virtual
,
public
<
>
{
public
:
class
:
public
virtual
,
public
<
>
{
public
:
virtual
const
&
() =
0
;
virtual
const
&
() =
0
;
};
virtual
*
() =
0
;
virtual
*
()=
0
;
virtual
*
()=
0
;
virtual
()=
0
;
virtual
*
(
)=
0
;
virtual
*
()=
0
;
virtual
bool
()=
0
;
virtual
void
(
collections
::
<
>&
)=
0
;
virtual
(
const
&
,
collections
::
<
>&
)=
0
;
virtual
(
const
&
) =
0
;
};
class
:
public
virtual
,
public
<
>
{
public
:
virtual
()=
0
;
virtual
*
(
)=
0
;
};
enum
class
:
{
=
0
,
=
1
<<
0
,
=
1
<<
1
,
=
1
<<
2
,
=
1
<<
3
,
=
1
<<
4
,
=
1
<<
5
,
=
1
<<
6
,
=
1
<<
7
,
=
,
=
,
=
,
=
,
=
,
};
inline
(
,
)
{
return
(
)((
)
& (
)
);
}
inline
(
,
)
{
return
(
)((
)
| (
)
);
}
class
:
public
virtual
,
public
<
>
{
public
:
class
:
public
virtual
,
public
<
>
{
public
:
virtual
const
&
() =
0
;
};
virtual
*
() =
0
;
virtual
() =
0
;
virtual
bool
() =
0
;
virtual
const
&
() =
0
;
virtual
*
() =
0
;
virtual
*
() =
0
;
virtual
*
() =
0
;
virtual
GetBaseTypeDescriptorCount
() =
0
;
virtual
*
(
) =
0
;
virtual
bool
(
*
) =
0
;
virtual
() =
0
;
virtual
*
(
) =
0
;
virtual
bool
(
const
&
,
bool
) =
0
;
virtual
*
(
const
&
,
bool
) =
0
;
virtual
() =
0
;
virtual
*
(
) =
0
;
virtual
bool
(
const
&
,
bool
) =
0
;
virtual
*
(
const
&
,
bool
) =
0
;
virtual
() =
0
;
virtual
*
(
) =
0
;
virtual
bool
(
const
&
,
bool
) =
0
;
virtual
*
(
const
&
,
bool
) =
0
;
virtual
*
() =
0
;
};
#ifndef VCZH_DEBUG_NO_REFLECTION
class
;
class
:
public
virtual
{
public
:
virtual
void
(
*
)=
0
;
virtual
void
(
*
)=
0
;
};
class
:
public
virtual
{
public
:
virtual
()=
0
;
virtual
*
(
)=
0
;
virtual
*
(
const
&
)=
0
;
virtual
bool
(
const
&
,
<
>
)=
0
;
virtual
bool
(
<
>
)=
0
;
virtual
bool
(
<
>
)=
0
;
virtual
bool
()=
0
;
virtual
bool
()=
0
;
virtual
bool
()=
0
;
virtual
bool
()=
0
;
virtual
*
()=
0
;
virtual
()=
0
;
};
extern
*
();
extern
bool
();
extern
bool
();
extern
*
(
const
&
);
extern
bool
(
*
,
bool
&
);
extern
void
(
stream
::
&
);
extern
void
(
stream
::
&
);
extern
<
>
(
stream
::
&
,
const
collections
::
<
,
<
>>&
);
extern
(
*
);
extern
(
*
);
extern
(
*
);
extern
(
*
);
extern
(
*
);
extern
(
*
);
extern
(
*
);
extern
bool
(
*
);
extern
bool
(
*
);
extern
bool
(
*
);
extern
bool
(
*
);
#endif
class
abstract
:
public
{
public
:
(
const
&
)
:
(
)
{
}
};
class
ValueNotDisposableException
:
public
{
public
:
ValueNotDisposableException
()
:
(
L"Cannot dispose an object whose reference counter is not 0."
)
{
}
};
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
class
:
public
{
public
:
(
const
&
)
:
(
L"Cannot find the type \""
+
+
L"\"."
)
{
}
};
class
ConstructorNotExistsException
:
public
{
public
:
ConstructorNotExistsException
(
*
)
:
(
L"Cannot find any constructor in type \""
+
->
() +
L"\"."
)
{
}
};
class
:
public
{
public
:
(
const
&
,
*
)
:
(
L"Cannot find the member \""
+
+
L"\" in type \""
+
->
() +
L"\"."
)
{
}
};
class
PropertyIsNotReadableException
:
public
{
public
:
PropertyIsNotReadableException
(
*
)
:
(
L"Cannot read value from a property \""
+
->
() +
L"\" that is not readable in type \""
+
->
()->
() +
L"\"."
)
{
}
};
class
PropertyIsNotWritableException
:
public
{
public
:
PropertyIsNotWritableException
(
*
)
:
(
L"Cannot write value to a property \""
+
->
() +
L"\" that is not writable in type \""
+
->
()->
() +
L"\"."
)
{
}
};
class
:
public
{
public
:
(
const
&
,
const
&
)
:
(
L"Argument \""
+
+
L"\" cannot be null when accessing its member \""
+
+
L"\"."
)
{
}
(
const
&
,
*
)
:
(
L"Argument \""
+
+
L"\" cannot be null when invoking method \""
+
->
() +
L"\" in type \""
+
->
()->
() +
L"\"."
)
{
}
(
const
&
,
*
)
:
(
L"Argument \""
+
+
L"\" cannot be null when accessing event \""
+
->
() +
L"\" in type \""
+
->
()->
() +
L"\"."
)
{
}
(
const
&
,
*
)
:
(
L"Argument \""
+
+
L"\" cannot be null when invoking property \""
+
->
() +
L"\" in type \""
+
->
()->
() +
L"\"."
)
{
}
};
class
ArgumentTypeMismtatchException
:
public
{
public
:
ArgumentTypeMismtatchException
(
const
&
,
*
,
const
&
)
:
(
L"Argument \""
+
+
L"\" cannot convert from \""
+
.
() +
L"\" to \""
+
->
() +
L"\"."
)
{
}
ArgumentTypeMismtatchException
(
const
&
,
*
,
::
,
const
&
)
:
(
L"Argument \""
+
+
L"\" cannot convert from \""
+
.
() +
L"\" to \""
+
(
==
::
?
L"Ptr<"
:
L""
) +
->
() + (
==
::
?
L">"
:
==
::
?
L"*"
:
L""
)
+
L"\"."
)
{
}
};
class
ArgumentCountMismtatchException
:
public
{
public
:
ArgumentCountMismtatchException
()
:
(
L"Argument count does not match the definition."
)
{
}
ArgumentCountMismtatchException
(
*
)
:
(
L"Argument count does not match the definition when invoking method \""
+
->
() +
L"\" in type \""
+
->
()->
() +
L"\"."
)
{
}
};
#endif
}
}
}
#endif