Skip to content

Commit e86a6fb

Browse files
hchokshimeta-codesync[bot]
authored andcommitted
Rename cpp2 generator 'qualified_namespace' property to 'cpp_qualified_namespace'
Summary: - Rename property `qualified_namespace` to `cpp_qualified_namespace` - Replace usages Reviewed By: iahs Differential Revision: D90035477 fbshipit-source-id: 7883095989ec7cb3c102fbdc8078f2025a5e695b
1 parent 78bf666 commit e86a6fb

43 files changed

Lines changed: 115 additions & 114 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

third-party/thrift/src/thrift/compiler/generate/t_mstch_cpp2_generator.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,8 @@ class t_mstch_cpp2_generator : public t_mstch_generator {
538538
const prototype_database& proto) const override {
539539
auto base = t_whisker_generator::make_prototype_for_program(proto);
540540
auto def = whisker::dsl::prototype_builder<h_program>::extends(base);
541-
def.property("qualified_namespace", &cpp2::get_gen_unprefixed_namespace);
541+
def.property(
542+
"cpp_qualified_namespace", &cpp2::get_gen_unprefixed_namespace);
542543
def.property(
543544
"const_referenced_in_field_default?", [this](const t_program& program) {
544545
return cpp_context_->field_default_const_ref_programs().contains(
@@ -590,7 +591,7 @@ class t_mstch_cpp2_generator : public t_mstch_generator {
590591
auto base = t_whisker_generator::make_prototype_for_type(proto);
591592
auto def = whisker::dsl::prototype_builder<h_type>::extends(base);
592593

593-
def.property("qualified_namespace", [](const t_type& type) {
594+
def.property("cpp_qualified_namespace", [](const t_type& type) {
594595
return cpp2::get_gen_unprefixed_namespace(*type.program());
595596
});
596597

third-party/thrift/src/thrift/compiler/generate/templates/cpp2/common/const_value.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ static_cast<{{value.type.cpp_standard_type}}>({{value.double_value}})
2929
"{{value.string_value}}"
3030
{{#else if value.enum?}}
3131
{{#if value.enum_value?}}
32-
::{{value.type.qualified_namespace}}::{{value.type.cpp_name}}::{{value.enum_value.cpp_name}}
32+
::{{value.type.cpp_qualified_namespace}}::{{value.type.cpp_name}}::{{value.enum_value.cpp_name}}
3333
{{#else}}
34-
static_cast< ::{{value.type.qualified_namespace}}::{{value.type.cpp_name}}>({{value.integer_value}})
34+
static_cast< ::{{value.type.cpp_qualified_namespace}}::{{value.type.cpp_name}}>({{value.integer_value}})
3535
{{/if value.enum_value?}}
3636
{{/if value.bool?}}
3737
{{/let partial}}
@@ -87,7 +87,7 @@ apache::thrift::StringTraits<{{value.type.cpp_standard_type}}>::fromStringLitera
8787
This is allowed when a value is considered referenceable AND the const to be
8888
referenced is defined in an external program (i.e. external? is true), or same
8989
program const referencing is enabled in the current context. }}
90-
::{{value.owner.program.qualified_namespace}}::{{value.owner.program.name}}_constants::{{value.owner.name}}()
90+
::{{value.owner.program.cpp_qualified_namespace}}::{{value.owner.program.name}}_constants::{{value.owner.name}}()
9191
{{#else if value.structured?}}
9292
{{! Struct/union values }}
9393
::apache::thrift::detail::make_structured_constant<{{value.type.cpp_standard_type}}>(

third-party/thrift/src/thrift/compiler/generate/templates/cpp2/module_clients_fwd.h.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ namespace apache::thrift {
2323
} // namespace apache::thrift
2424

2525
{{#services}}
26-
namespace {{service:qualified_namespace}} {
26+
namespace {{service:cpp_qualified_namespace}} {
2727
class {{service:cpp_name}};
28-
} // namespace {{service:qualified_namespace}}
28+
} // namespace {{service:cpp_qualified_namespace}}
2929
{{/services}}
3030

3131

3232
namespace apache::thrift {
3333
{{#services}}
34-
template<> class Client<::{{service:qualified_namespace}}::{{service:cpp_name}}>;
34+
template<> class Client<::{{service:cpp_qualified_namespace}}::{{service:cpp_name}}>;
3535
{{/services}}
3636
} // namespace apache::thrift

third-party/thrift/src/thrift/compiler/generate/templates/cpp2/module_constants.cpp.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "{{program:include_prefix}}{{program:name}}_constants.h"
2727
{{/program:thrift_includes}}
2828

29-
namespace {{program:qualified_namespace}} {
29+
namespace {{program:cpp_qualified_namespace}} {
3030
namespace {{program:name}}_constants {
3131
3232
{{#program:constants}}
@@ -87,4 +87,4 @@ namespace {{program:name}}_constants {
8787
}
8888

8989
} // namespace {{program:name}}_constants
90-
} // namespace {{program:qualified_namespace}}
90+
} // namespace {{program:cpp_qualified_namespace}}

third-party/thrift/src/thrift/compiler/generate/templates/cpp2/module_constants.h.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#include "{{program:include_prefix}}{{program:name}}_types.h"
2525

26-
namespace {{program:qualified_namespace}} {
26+
namespace {{program:cpp_qualified_namespace}} {
2727
{{> common/program_docblock}}
2828
namespace {{program:name}}_constants {
2929
@@ -57,4 +57,4 @@ namespace {{program:name}}_constants {
5757
FOLLY_EXPORT ::folly::Range<const ::std::string_view*> {{program:schema_name}}_uris();
5858

5959
} // namespace {{program:name}}_constants
60-
} // namespace {{program:qualified_namespace}}
60+
} // namespace {{program:cpp_qualified_namespace}}

third-party/thrift/src/thrift/compiler/generate/templates/cpp2/module_data.cpp.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
#include <thrift/lib/cpp2/gen/module_data_cpp.h>
2525

2626
{{#program:services}}
27-
namespace {{service:qualified_namespace}} {
27+
namespace {{service:cpp_qualified_namespace}} {
2828
class {{service:cpp_name}};
29-
} // namespace {{service:qualified_namespace}}
29+
} // namespace {{service:cpp_qualified_namespace}}
3030
{{/program:services}}
3131
namespace apache::thrift {
3232
{{#program:structs}}

third-party/thrift/src/thrift/compiler/generate/templates/cpp2/module_data.h.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
namespace apache { namespace thrift {
2626
{{#program:enums}}
2727

28-
template <> struct TEnumDataStorage<::{{program:qualified_namespace}}::{{enum:cpp_name}}> {
29-
using type = ::{{program:qualified_namespace}}::{{enum:cpp_name}};
28+
template <> struct TEnumDataStorage<::{{program:cpp_qualified_namespace}}::{{enum:cpp_name}}> {
29+
using type = ::{{program:cpp_qualified_namespace}}::{{enum:cpp_name}};
3030
static constexpr const std::size_t size = {{(array.len enum:values)}};
3131
static constexpr std::array<type, size> values = { {
3232
{{#enum:values}}{{!

third-party/thrift/src/thrift/compiler/generate/templates/cpp2/module_fatal.h.mustache

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <fatal/type/sequence.h>
2626

2727
#include "{{program:include_prefix}}{{program:name}}_types.h"
28-
namespace {{program:qualified_namespace}} {
28+
namespace {{program:cpp_qualified_namespace}} {
2929
3030
namespace __fbthrift_refl {
3131
@@ -45,17 +45,17 @@ struct {{program:name}}_module_traits {
4545
>;
4646
using enums = ::fatal::list<
4747
{{#program:fatal_enums}}{{#fatal_strings:items}}
48-
::fatal::pair<::{{program:qualified_namespace}}::{{fatal_string:name}}, strings::{{fatal_string:name}}>{{^last?}},{{/last?}}
48+
::fatal::pair<::{{program:cpp_qualified_namespace}}::{{fatal_string:name}}, strings::{{fatal_string:name}}>{{^last?}},{{/last?}}
4949
{{/fatal_strings:items}}{{/program:fatal_enums}}
5050
>;
5151
using unions = ::fatal::list<
5252
{{#program:fatal_unions}}{{#fatal_strings:items}}
53-
::fatal::pair<::{{program:qualified_namespace}}::{{fatal_string:name}}, strings::{{fatal_string:name}}>{{^last?}},{{/last?}}
53+
::fatal::pair<::{{program:cpp_qualified_namespace}}::{{fatal_string:name}}, strings::{{fatal_string:name}}>{{^last?}},{{/last?}}
5454
{{/fatal_strings:items}}{{/program:fatal_unions}}
5555
>;
5656
using structs = ::fatal::list<
5757
{{#program:fatal_structs}}{{#fatal_strings:items}}
58-
::fatal::pair<::{{program:qualified_namespace}}::{{fatal_string:name}}, strings::{{fatal_string:name}}>{{^last?}},{{/last?}}
58+
::fatal::pair<::{{program:cpp_qualified_namespace}}::{{fatal_string:name}}, strings::{{fatal_string:name}}>{{^last?}},{{/last?}}
5959
{{/fatal_strings:items}}{{/program:fatal_structs}}
6060
>;
6161
using constants = ::fatal::list<
@@ -116,4 +116,4 @@ class {{program:name}}_tags {
116116
using services = __fbthrift_services;
117117
};
118118

119-
} // namespace {{program:qualified_namespace}}
119+
} // namespace {{program:cpp_qualified_namespace}}

third-party/thrift/src/thrift/compiler/generate/templates/cpp2/module_fatal_constant.h.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020

2121
#include "{{program:include_prefix}}{{program:name}}_fatal_types.h"
2222

23-
namespace {{program:qualified_namespace}} {
23+
namespace {{program:cpp_qualified_namespace}} {
2424
25-
} // namespace {{program:qualified_namespace}}
25+
} // namespace {{program:cpp_qualified_namespace}}

third-party/thrift/src/thrift/compiler/generate/templates/cpp2/module_fatal_service.h.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@
2020

2121
#include "{{program:include_prefix}}{{program:name}}_types.h"
2222

23-
namespace {{program:qualified_namespace}} {
24-
} // namespace {{program:qualified_namespace}}
23+
namespace {{program:cpp_qualified_namespace}} {
24+
} // namespace {{program:cpp_qualified_namespace}}

0 commit comments

Comments
 (0)