3#include <system/object_ext.h>
17template<
typename ... Args>
21 using tuple_t = std::tuple<Args...>;
23 static constexpr std::size_t tuple_size =
sizeof...(Args);
26 template <
typename... OtherArgs>
friend class ValueTuple;
36 template <
typename = std::enable_if_t<(tuple_size > 0)>>
37 ValueTuple(Args... args) : m_tuple(std::forward<Args>(args)...)
44 return *static_holder<ThisTypeInfo>();
49 template <std::
size_t Index>
50 std::tuple_element_t<Index, tuple_t>&
Item()
52 static_assert(Index < tuple_size,
"Index out of ragnge.");
54 return std::get<Index>(m_tuple);
59 template <std::
size_t Index>
60 const std::tuple_element_t<Index, tuple_t>&
Item()
const
62 static_assert(Index < tuple_size,
"Index out of ragnge.");
64 return std::get<Index>(m_tuple);
72 return System::ObjectExt::Is<ValueTuple>(obj) &&
Equals<0, Args...>(m_tuple, ObjectExt::Unbox<ValueTuple>(obj).m_tuple);
97 return Equals<0, Args...>(m_tuple, other.m_tuple);
100 template<
typename ... OtherArgs>
103 m_tuple = otherTuple.m_tuple;
109 template<std::size_t Index = 0,
typename... Types>
110 static typename std::enable_if<Index ==
sizeof...(Types),
bool>::type
111 Equals(
const std::tuple<Types...>& a,
const std::tuple<Types...>& b)
119 template<std::size_t Index = 0,
typename... Types>
120 static typename std::enable_if<Index <
sizeof...(Types),
bool>::type
121 Equals(
const std::tuple<Types...>& a,
const std::tuple<Types...>& b)
128 return Equals<Index + 1, Types...>(a, b);
132 template<std::
size_t Index = 0>
133 static typename std::enable_if<Index == tuple_size, void>::type
ToString(
const tuple_t& tuple,
System::String& result) {}
134 template<std::
size_t Index = 0>
135 static typename std::enable_if<Index < tuple_size, void>::type
ToString(
const tuple_t& tuple,
System::String& result)
142 ToString<Index + 1>(tuple, result);
146 template<std::
size_t Index = 0>
147 static typename std::enable_if<Index == tuple_size, void>::type
GetHashCode(
const tuple_t& tuple, int32_t& result) {}
148 template<std::
size_t Index = 0>
149 static typename std::enable_if<Index < tuple_size, void>::type
GetHashCode(
const tuple_t& tuple, int32_t& result)
152 GetHashCode<Index + 1>(tuple, result);
164template <
typename... Args>
174template <
typename... Args>
177 return ValueTuple<Args&&...>(std::forward<Args>(args)...);
static String ToString(const char_t *obj)
Substitution for C# ToString method to work on any C++ type.
Definition: object_ext.h:96
static int GetHashCode(const T &obj)
Implements GetHashCode() calls; works on both Object subclasses and unrelated types.
Definition: object_ext.h:28
static std::enable_if< IsExceptionWrapper< T >::value, bool >::type Equals(const T &obj, const T2 &another)
Definition: object_ext.h:34
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
Represents a particular type and provides information about it.
Definition: type_info.h:109
Class that represents a ValueTuple data structure.
Definition: value_tuple.h:19
bool operator==(const ValueTuple &other) const
Definition: value_tuple.h:95
static const TypeInfo & Type()
Returns a reference to the TypeInfo object representing the ValueTuple class type information.
Definition: value_tuple.h:42
ValueTuple(Args... args)
Constructs a tuple object.
Definition: value_tuple.h:37
std::tuple_element_t< Index, tuple_t > & Item()
Gets the reference to value of the ValueTuple object's component.
Definition: value_tuple.h:50
bool Equals(SharedPtr< Object > obj)
Determines if the current and the specified objects are identical.
Definition: value_tuple.h:70
const std::tuple_element_t< Index, tuple_t > & Item() const
Gets the value of the ValueTuple object's component.
Definition: value_tuple.h:60
System::String ToString() const
Definition: value_tuple.h:75
int32_t GetHashCode() const
Definition: value_tuple.h:83
ValueTuple()
Definition: value_tuple.h:30
ValueTuple & operator=(const ValueTuple< OtherArgs... > &otherTuple)
Definition: value_tuple.h:101
const TypeInfo & GetType() const
Definition: value_tuple.h:90
Definition: db_command.h:9
static ValueTuple< Args... > MakeTuple(Args... args)
Creates tuple on stack.
Definition: value_tuple.h:165
static ValueTuple< Args... > TieTuple(Args &&... args)
Creates tuple bound to some values.
Definition: value_tuple.h:175
Wrapper for a pointer to an instance of TypeInfo class. This type should be allocated on stack and pa...
Definition: type_info.h:72
Represents a pointer to TypeInfo object that contains information about ValueTuple class.
Definition: value_tuple.h:9
ValueTupleTypeInfo()
Constructs an instance of MulticastDelegateTypeInfo class.
Definition: value_tuple.h:11