#ifndef VCZH_REFLECTION_GUITYPEDESCRIPTORBUILDER_CONTAINER
#define VCZH_REFLECTION_GUITYPEDESCRIPTORBUILDER_CONTAINER
#include "GuiTypeDescriptorBuilder.h"
namespace
{
namespace
{
namespace
{
template
<
typename
>
class
:
public
,
public
collections
::
<
>
{
private
:
<
>
;
<
>
;
;
;
public
:
(
<
>
,
,
const
&
)
:enumerable(
)
,index(
)
,value(
)
{
();
=-
1
;
while
(
current
++<
)
{
();
}
}
(
<
>
)
:enumerable(
)
,index(-
1
)
{
();
}
collections
::
<
>*
()
const
override
{
return
new
<
>(
,
,
);
}
const
&
()
const
override
{
return
;
}
()
const
override
{
return
;
}
bool
()
override
{
if
(
())
{
++;
=
<
>(
());
return
true
;
}
else
{
return
false
;
}
}
void
()
override
{
=-
1
;
();
}
};
template
<
typename
>
collections
::
<
>
(
<
>
)
{
return
collections
::
<
>(
new
<
>(
));
}
template
<
typename
>
collections
::
<
>
(
<
>
)
{
return
collections
::
<
>(
0
,
())
.
([value](
)
{
return
<
>(
(
i
));
});
}
template
<
typename
>
collections
::
<
>
(
<
>
)
{
return
<
>(
<
>(
));
}
template
<
typename
>
collections
::
<
>
(
<
>
)
{
return
<
>(
<
>(
));
}
template
<
typename
,
typename
>
collections
::
<
collections
::
<
,
>>
(
<
>
)
{
return
collections
::
<
>(
0
,
())
.
([value](
)
{
return
collections
::
<
,
>(
<
>(
()
(
i
)),
<
>(
()
(
i
)));
});
}
template
<
typename
,
typename
>
collections
::
<
collections
::
<
,
>>
(
<
>
)
{
return
<
,
>(
<
>(
));
}
namespace
{
template
<
typename
>
struct
{
typedef
;
};
template
<
typename
>
struct
<
*>
{
typedef
;
};
template
<
typename
>
struct
<
<
>>
{
typedef
;
};
}
#pragma warning(push)
#pragma warning(disable:
4250
)
template
<
typename
>
class
:
public
,
public
virtual
{
protected
:
typedef
typename
trait_helper
::
<
>::
;
typedef
typename
::ElementType
;
;
public
:
(
const
&
)
:wrapperPointer(
)
{
}
()
override
{
return
<
>(
->Current());
}
()
override
{
return
->Index();
}
bool
()
override
{
return
->Next();
}
};
template
<
typename
>
class
:
public
,
public
virtual
{
protected
:
typedef
typename
trait_helper
::
<
>::
;
typedef
typename
::ElementType
;
;
public
:
(
const
&
)
:wrapperPointer(
)
{
}
<
>
()
override
{
return
new
<
<
collections
::
<
>>>(
->CreateEnumerator());
}
};
#define WRAPPER_POINTER this->wrapperPointer
template
<
typename
>
class
:
public
<
>,
public
virtual
{
protected
:
typedef
typename
trait_helper
::
<
>::
;
typedef
typename
::ElementType
;
typedef
typename
<
>::
;
public
:
(
const
&
)
:
<
>(
)
{
}
()
override
{
return WRAPPER_POINTER->Count();
}
(
)
override
{
return BoxValue<ElementType>(WRAPPER_POINTER->Get(index));
return
<
>(
this
->
->Get(
));
}
bool
(
const
&
)
override
{
=
<
>(
);
return WRAPPER_POINTER->Contains(item);
return
this
->
->Contains(
item
);
}
(
const
&
)
override
{
=
<
>(
);
return WRAPPER_POINTER->IndexOf(item);
return
this
->
->IndexOf(
item
);
}
};
template
<
typename
>
class
:
public
<
>,
public
virtual
{
protected
:
typedef
typename
trait_helper
::
<
>::
;
typedef
typename
::ElementType
;
typedef
typename
<
>::
;
public
:
(
const
&
)
:
<
>(
)
{
}
void
(
,
const
&
)
override
{
=
<
>(
);
WRAPPER_POINTER->Set(index, item);
}
(
const
&
)
override
{
=
<
>(
);
return WRAPPER_POINTER->Add(item);
return
this
->
->Add(
item
);
}
(
,
const
&
)
override
{
=
<
>(
);
return WRAPPER_POINTER->Insert(index, item);
return
this
->
->Insert(
,
item
);
}
bool
(
const
&
)
override
{
=
<
>(
);
return WRAPPER_POINTER->Remove(item);
return
this
->
->Remove(
item
);
}
bool
(
)
override
{
return WRAPPER_POINTER->RemoveAt(index);
return
this
->
->RemoveAt(
);
}
void
()
override
{
WRAPPER_POINTER->Clear();
}
};
template
<
typename
,
typename
>
class
<
collections
::
<
,
>*> :
public
<
collections
::
<
,
>*>,
public
virtual
{
protected
:
typedef
collections
::
<
,
>
;
typedef
;
typedef
;
public
:
(
collections
::
<
,
>*
)
:
<
collections
::
<
,
>*>(
)
{
}
void
(
,
const
&
)
override
{
=
<
>(
);
WRAPPER_POINTER->Set(index, item);
}
(
const
&
)
override
{
throw
(
L"Array doesn't have Add method."
);
}
(
,
const
&
)
override
{
throw
(
L"Array doesn't have Insert method."
);
}
bool
(
const
&
)
override
{
throw
(
L"Array doesn't have Remove method."
);
}
bool
(
)
override
{
throw
(
L"Array doesn't have RemoveAt method."
);
}
void
()
override
{
throw
(
L"Array doesn't have Clear method."
);
}
};
template
<
typename
,
typename
>
class
<
collections
::
<
,
>*> :
public
<
collections
::
<
,
>*>,
public
virtual
{
protected
:
typedef
collections
::
<
,
>
;
typedef
;
typedef
;
public
:
(
collections
::
<
,
>*
)
:
<
collections
::
<
,
>*>(
)
{
}
void
(
,
const
&
)
override
{
throw
(
L"SortedList doesn't have Set method."
);
}
(
const
&
)
override
{
=
<
>(
);
return WRAPPER_POINTER->Add(item);
}
(
,
const
&
)
override
{
throw
(
L"SortedList doesn't have Insert method."
);
}
bool
(
const
&
)
override
{
=
<
>(
);
return WRAPPER_POINTER->Remove(item);
}
bool
(
)
override
{
return WRAPPER_POINTER->RemoveAt(index);
}
void
()
override
{
WRAPPER_POINTER->Clear();
}
};
template
<
typename
>
class
ValueObservableListWrapper
:
public
<
>,
public
virtual
{
public
:
ValueObservableListWrapper
(
const
&
)
:
<
>(
)
{
}
};
#undef WRAPPER_POINTER
template
<
typename
>
class
ValueReadonlyDictionaryWrapper
:
public
virtual
,
public
virtual
{
protected
:
typedef
typename
trait_helper
::
<
>::
;
typedef
typename
::KeyContainer
;
typedef
typename
::ValueContainer
;
typedef
typename
::ElementType
;
typedef
typename
<
>::
;
typedef
typename
::ElementType
;
;
<
>
;
<
>
;
public
:
ValueReadonlyDictionaryWrapper
(
const
&
)
:wrapperPointer(
)
{
}
<
>
()
override
{
if
(!
)
{
=
new
<
const
*>(&
->Keys());
}
return
;
}
<
>
()
override
{
if
(!
)
{
=
new
<
const
*>(&
->Values());
}
return
;
}
()
override
{
return
->Count();
}
(
const
&
)
override
{
=
<
>(
);
=
->Get(
item
);
return
<
>(
result
);
}
};
#define WRAPPER_POINTER ValueReadonlyDictionaryWrapper<T>::wrapperPointer
#define KEY_VALUE_TYPE typename ValueReadonlyDictionaryWrapper<T>::KeyValueType
#define VALUE_TYPE typename ValueReadonlyDictionaryWrapper<T>::ValueType
#define KEY_KEY_TYPE typename ValueReadonlyDictionaryWrapper<T>::KeyKeyType
template
<
typename
>
class
:
public
virtual
ValueReadonlyDictionaryWrapper
<
>,
public
virtual
{
public
:
(
const
&
)
:
ValueReadonlyDictionaryWrapper
<
>(
)
{
}
void
(
const
&
,
const
&
)
override
{
KEY_VALUE_TYPE item=UnboxValue<KEY_VALUE_TYPE>(key);
typename
ValueReadonlyDictionaryWrapper
<
>::
=
<
typename
ValueReadonlyDictionaryWrapper
<
>::
>(
);
VALUE_TYPE result=UnboxValue<VALUE_TYPE>(value);
typename
ValueReadonlyDictionaryWrapper
<
>::
=
<
typename
ValueReadonlyDictionaryWrapper
<
>::
>(
);
WRAPPER_POINTER->Set(item, result);
ValueReadonlyDictionaryWrapper
<
>::
->Set(
item
,
result
);
}
bool
(
const
&
)
override
{
KEY_KEY_TYPE item=UnboxValue<KEY_KEY_TYPE>(key);
typename
ValueReadonlyDictionaryWrapper
<
>::
=
<
typename
ValueReadonlyDictionaryWrapper
<
>::
>(
);
return WRAPPER_POINTER->Remove(item);
return
ValueReadonlyDictionaryWrapper
<
>::
->Remove(
item
);
}
void
()
override
{
WRAPPER_POINTER->Clear();
ValueReadonlyDictionaryWrapper
<
>::
->Clear();
}
};
#undef WRAPPER_POINTER
#undef KEY_VALUE_TYPE
#undef VALUE_TYPE
#undef KEY_KEY_TYPE
#pragma warning(pop)
template
<
typename
>
struct
<
,
::
>
{
typedef
<
,
::
>
;
static
const
::
=
::
;
typedef
;
typedef
typename
::
;
typedef
typename
::
;
typedef
typename
::
;
#ifndef VCZH_DEBUG_NO_REFLECTION
static
<
>
(
)
{
typedef
typename
<
,
::
>::
;
typedef
typename
::ElementType
;
auto
=
<
>(
<
>(),
);
auto
=
<
>(
arrayType
);
genericType
(
<
>::
());
auto
=
<
>(
genericType
);
return
type
;
}
#endif
};
template
<
typename
>
struct
<
,
::
>
{
typedef
<
,
::
>
;
static
const
::
=
::
;
typedef
;
typedef
typename
::
;
typedef
typename
::
;
typedef
typename
::
;
#ifndef VCZH_DEBUG_NO_REFLECTION
static
<
>
(
)
{
typedef
typename
<
,
::
>::
;
typedef
typename
::ElementType
;
auto
=
<
>(
<
>(),
);
auto
=
<
>(
arrayType
);
genericType
(
<
>::
());
auto
=
<
>(
genericType
);
return
type
;
}
#endif
};
template
<
typename
>
struct
<
,
::
>
{
typedef
<
,
::
>
;
static
const
::
=
::
;
typedef
;
typedef
typename
::
;
typedef
typename
::
;
typedef
typename
::
;
#ifndef VCZH_DEBUG_NO_REFLECTION
static
<
>
(
)
{
typedef
typename
<
,
::
>::
;
typedef
typename
::ElementType
;
auto
=
<
>(
<
>(),
);
auto
=
<
>(
arrayType
);
genericType
(
<
>::
());
auto
=
<
>(
genericType
);
return
type
;
}
#endif
};
template
<
typename
>
struct
<
,
::
>
{
typedef
<
,
::
>
;
static
const
::
=
::
;
typedef
;
typedef
typename
::
;
typedef
typename
::
;
typedef
typename
::
;
#ifndef VCZH_DEBUG_NO_REFLECTION
static
<
>
(
)
{
typedef
typename
<
,
::
>::
;
typedef
typename
::ElementType
;
auto
=
<
>(
<
>(),
);
auto
=
<
>(
arrayType
);
genericType
(
<
>::
());
auto
=
<
>(
genericType
);
return
type
;
}
#endif
};
template
<
typename
>
struct
<
,
::
>
{
typedef
<
,
::
>
;
static
const
::
=
::
;
typedef
;
typedef
typename
::
;
typedef
typename
::
;
typedef
typename
::
;
#ifndef VCZH_DEBUG_NO_REFLECTION
static
<
>
(
)
{
typedef
typename
<
,
::
>::
;
typedef
typename
::KeyContainer
;
typedef
typename
::ValueContainer
;
typedef
typename
::ElementType
;
typedef
typename
::ElementType
;
auto
=
<
>(
<
>(),
);
auto
=
<
>(
arrayType
);
genericType
(
<
>::
());
genericType
(
<
>::
());
auto
=
<
>(
genericType
);
return
type
;
}
#endif
};
template
<
typename
>
struct
<
,
::
>
{
typedef
<
,
::
>
;
static
const
::
=
::
;
typedef
;
typedef
typename
::
;
typedef
typename
::
;
typedef
typename
::
;
#ifndef VCZH_DEBUG_NO_REFLECTION
static
<
>
(
)
{
typedef
typename
<
,
::
>::
;
typedef
typename
::KeyContainer
;
typedef
typename
::ValueContainer
;
typedef
typename
::ElementType
;
typedef
typename
::ElementType
;
auto
=
<
>(
<
>(),
);
auto
=
<
>(
arrayType
);
genericType
(
<
>::
());
genericType
(
<
>::
());
auto
=
<
>(
genericType
);
return
type
;
}
#endif
};
template
<
typename
>
struct
<
collections
::
<
>,
::
>
{
static
(
collections
::
<
>&
,
*
)
{
<
>
=
::
(
collections
::
(
)
.Select([](
const
&
)
{
return
<
>(
item
);
})
);
*
=
nullptr
;
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
td
=
<
>::
GetAssociatedTypeDescriptor
();
#endif
return
<
<
>>(
result
,
td
);
}
static
void
(
const
&
,
collections
::
<
>&
,
*
,
const
&
)
{
typedef
typename
collections
::
<
>::
;
<
>
=
<
<
>>(
,
,
);
<
>(
listProxy
);
}
};
template
<
typename
>
struct
<
,
::
>
{
static
(
&
,
*
)
{
<
>
=
new
<
*>(&
);
*
=
nullptr
;
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
td
=
<
>::
GetAssociatedTypeDescriptor
();
#endif
return
<
<
>>(
result
,
td
);
}
static
void
(
const
&
,
&
,
*
,
const
&
)
{
typedef
typename
::ElementType
;
<
>
=
<
<
>>(
,
,
);
collections
::
<
>
=
<
>(
listProxy
);
collections
::
(
,
lazyList
);
}
};
template
<
typename
>
struct
<
,
::
>
{
static
(
&
,
*
)
{
<
>
=
new
<
*>(&
);
*
=
nullptr
;
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
td
=
<
>::
GetAssociatedTypeDescriptor
();
#endif
return
<
<
>>(
result
,
td
);
}
static
void
(
const
&
,
&
,
*
,
const
&
)
{
typedef
typename
::ElementType
;
<
>
=
<
<
>>(
,
,
);
collections
::
<
>
=
<
>(
listProxy
);
collections
::
(
,
lazyList
);
}
};
template
<
typename
>
struct
<
collections
::
<
>,
::
>
{
static
(
collections
::
<
>&
,
*
)
{
*
=
nullptr
;
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
td
=
<
>::
GetAssociatedTypeDescriptor
();
#endif
return
<
<
>>(
.
(),
td
);
}
};
template
<
typename
>
struct
<
,
::
>
{
static
(
&
,
*
)
{
<
>
=
new
ValueReadonlyDictionaryWrapper
<
*>(&
);
*
=
nullptr
;
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
td
=
<
>::
GetAssociatedTypeDescriptor
();
#endif
return
<
<
>>(
result
,
td
);
}
static
void
(
const
&
,
&
,
*
,
const
&
)
{
typedef
typename
::KeyContainer
;
typedef
typename
::ValueContainer
;
typedef
typename
::ElementType
;
typedef
typename
::ElementType
;
<
>
=
<
<
>>(
,
,
);
collections
::
<
collections
::
<
,
>>
=
<
,
>(
dictionaryProxy
);
collections
::
(
,
lazyList
);
}
};
template
<
typename
>
struct
<
,
::
>
{
static
(
&
,
*
)
{
<
>
=
new
<
*>(&
);
*
=
nullptr
;
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
td
=
<
>::
GetAssociatedTypeDescriptor
();
#endif
return
<
<
>>(
result
,
td
);
}
static
void
(
const
&
,
&
,
*
,
const
&
)
{
typedef
typename
::KeyContainer
;
typedef
typename
::ValueContainer
;
typedef
typename
::ElementType
;
typedef
typename
::ElementType
;
<
>
=
<
<
>>(
,
,
);
collections
::
<
collections
::
<
,
>>
=
<
,
>(
dictionaryProxy
);
collections
::
(
,
lazyList
);
}
};
}
}
namespace
{
template
<
typename
,
typename
=
typename
<
>::
>
class
:
public
,
public
virtual
collections
::
<
>
{
protected
:
collections
::
<
,
>
;
virtual
void
(
,
,
)
{
}
virtual
bool
(
,
const
&
)
{
return
true
;
}
virtual
void
(
,
const
&
)
{
}
virtual
void
(
,
const
&
)
{
}
virtual
bool
(
,
const
&
)
{
return
true
;
}
virtual
void
(
,
const
&
)
{
}
virtual
void
(
,
)
{
}
public
:
()
{
}
()
{
}
collections
::
<
>*
()
const
{
return
.
();
}
bool
(
,
=
1
)
{
if
(
<
0
||
>=
.
() ||
<=
0
||
+
>
.
())
{
return
false
;
}
else
{
(
,
,
);
return
true
;
}
}
bool
(
const
&
)
const
{
return
.
(
);
}
()
const
{
return
.
();
}
()
{
return
.
();
}
const
&
(
)
const
{
return
.
(
);
}
const
&
(
)
const
{
return
.
(
);
}
(
const
&
)
const
{
return
.
(
);
}
(
const
&
)
{
return
(
.
(),
);
}
bool
(
const
&
)
{
=
.
(
);
if
(
index
== -
1
)
return
false
;
return
(
index
);
}
bool
(
)
{
if
(
0
<=
&&
<
.
() &&
(
,
]))
{
(
,
]);
=
];
.
(
);
(
,
1
);
(
,
1
,
0
);
return
true
;
}
return
false
;
}
bool
(
,
)
{
if
(
<=
0
)
return
false
;
if
(
0
<=
&&
<
.
() &&
+
<=
.
())
{
for
(
=
0
;
i
<
;
i
++)
{
if
(!
(
+
1
,
+
i
]))
return
false
;
}
for
(
=
0
;
i
<
;
i
++)
{
(
+
i
,
+
i
]);
}
.
(
,
);
(
,
);
(
,
,
0
);
return
true
;
}
return
false
;
}
bool
()
{
=
.
();
for
(
=
0
;
i
<
count
;
i
++)
{
if
(!
(
i
,
i
]))
return
false
;
}
for
(
=
0
;
i
<
count
;
i
++)
{
(
i
,
i
]);
}
.
();
(
0
,
count
);
(
0
,
count
,
0
);
return
true
;
}
(
,
const
&
)
{
if
(
0
<=
&&
<=
.
() &&
(
,
))
{
(
,
);
.
(
,
);
(
,
);
(
,
0
,
1
);
return
;
}
else
{
return
-
1
;
}
}
bool
(
,
const
&
)
{
if
(
0
<=
&&
<
.
())
{
if
(
(
,
]) &&
(
,
))
{
(
,
]);
.
(
);
(
,
1
);
(
,
);
.
(
,
);
(
,
);
(
,
1
,
1
);
return
true
;
}
}
return
false
;
}
};
template
<
typename
>
class
:
public
<
>
{
protected
:
<
reflection
::
description
::
>
;
void
(
,
,
)
override
{
if
(
)
{
,
,
);
}
}
public
:
<
reflection
::
description
::
>
()
{
if
(!
)
{
new
reflection
::
description
::
ValueObservableListWrapper
<
<
>*>(
this
);
}
return
;
}
};
namespace
{
template
<
typename
>
struct
<
<
>>
{
static
const
bool
=
true
;
static
const
bool
=
false
;
};
template
<
typename
>
struct
<
<
>>
{
static
const
bool
=
true
;
static
const
bool
=
false
;
};
}
}
}
#endif