CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
json_parameter_info_of_t.h
1#pragma once
2
3#include <system/scope_guard.h>
4#include <system/object_ext.h>
5#include <system/details/pointer_collection_helpers.h>
6#include <system/details/patterns.h>
7#include <cstdint>
8
9#include "system/text/json/serialization/metadata/json_parameter_info.h"
10#include "system/text/json/serialization/metadata/json_parameter_info_values.h"
11
12namespace System
13{
14namespace Text
15{
16namespace Json
17{
18namespace Serialization
19{
20template <typename> class JsonConverter;
21namespace Metadata
22{
23class JsonParameterInfoValues;
24template <typename> class JsonPropertyInfo;
25} // namespace Metadata
26} // namespace Serialization
27} // namespace Json
28} // namespace Text
29} // namespace System
30
31namespace System {
32
33namespace Text {
34
35namespace Json {
36
37namespace Serialization {
38
39namespace Metadata {
40
41template<typename T>
43{
46
47 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
48 RTTI_INFO_TEMPLATE_CLASS(ThisType, ThisTypeBaseTypesInfo);
49
50public:
51
53 {
54 return get_MatchingProperty()->get_EffectiveConverter();
55 }
56
58 {
59 return pr_MatchingProperty;
60 }
61
63 {
64 return pr_EffectiveDefaultValue;
65 }
66
68 : JsonParameterInfoBase(parameterInfoValues, matchingPropertyInfo), pr_EffectiveDefaultValue(T())
69 {
70 System::Details::ThisProtector __local_self_ref(this);
71
72 System::SharedPtr<Object> defaultValue;
73 if (System::Is(parameterInfoValues, (&JsonParameterInfoValues::get_HasDefaultValue% (_== true) && &JsonParameterInfoValues::get_DefaultValue% (_.Is<Object>(defaultValue)))))
74 {
75 pr_EffectiveDefaultValue = System::ExplicitCast<T>(defaultValue);
76 }
77
78 pr_MatchingProperty = matchingPropertyInfo;
79 System::Text::Json::Serialization::Metadata::JsonParameterInfoBase::init_EffectiveDefaultValue(System::ExplicitCast<System::Object>(get_EffectiveDefaultValue()));
80 }
81
82 void SetTemplateWeakPtr(uint32_t argument) override
83 {
84 ASPOSE_UNUSED(argument);
85 }
86
87protected:
88
89 #ifdef ASPOSE_GET_SHARED_MEMBERS
90 void GetSharedMembers(System::Object::shared_members_type& result) const override
91 {
92 JsonParameterInfoBase::GetSharedMembers(result);
93
94 result.Add("System::Text::Json::Serialization::Metadata::JsonParameterInfoBase::pr_MatchingProperty", this->pr_MatchingProperty);
95 result.Add("System::Text::Json::Serialization::Metadata::JsonParameterInfoBase::pr_EffectiveDefaultValue", this->pr_EffectiveDefaultValue);
96 }
97 #endif
98
99private:
100
101 System::SharedPtr<JsonPropertyInfo<T>> pr_MatchingProperty;
102 T pr_EffectiveDefaultValue;
103
104};
105
106} // namespace Metadata
107} // namespace Serialization
108} // namespace Json
109} // namespace Text
110} // namespace System
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:51
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
T get_EffectiveDefaultValue()
Definition: json_parameter_info_of_t.h:62
System::SharedPtr< JsonConverter< T > > get_EffectiveConverter()
Definition: json_parameter_info_of_t.h:52
void SetTemplateWeakPtr(uint32_t argument) override
Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containe...
Definition: json_parameter_info_of_t.h:82
System::SharedPtr< JsonPropertyInfo< T > > get_MatchingProperty()
Definition: json_parameter_info_of_t.h:57
JsonParameterInfo(System::SharedPtr< JsonParameterInfoValues > parameterInfoValues, System::SharedPtr< JsonPropertyInfo< T > > matchingPropertyInfo)
Definition: json_parameter_info_of_t.h:67
@ Text
Defines color adjustment information for text.
Definition: db_command.h:9