Skip to content

Commit db9a790

Browse files
Mizuchimeta-codesync[bot]
authored andcommitted
Remove thrift/lib/cpp2/reflection/helpers.h
Summary: The APIs in this file is only used in unit-test. Reviewed By: hchokshi Differential Revision: D90126425 fbshipit-source-id: f54b161a24b8d8c0ac96d145dd73d739359ba2bb
1 parent ee76d3d commit db9a790

3 files changed

Lines changed: 1 addition & 313 deletions

File tree

third-party/thrift/src/thrift/lib/cpp2/reflection/helpers.h

Lines changed: 1 addition & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -14,116 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
#ifndef THRIFT_FATAL_HELPERS_H_
18-
#define THRIFT_FATAL_HELPERS_H_ 1
17+
#pragma once
1918

2019
#include <fatal/type/get_type.h>
2120
#include <thrift/lib/cpp2/reflection/reflection.h>
22-
23-
#include <thrift/lib/cpp2/reflection/internal/helpers-inl-pre.h>
24-
25-
namespace apache::thrift {
26-
27-
/**
28-
* Gets the reflection metadata for a given struct's member based on a user
29-
* provided filter applied to each `reflected_struct_data_member` of the
30-
* struct's members.
31-
*
32-
* Example:
33-
*
34-
* // Thrift file
35-
* struct some_struct {
36-
* 123: i32 some_member
37-
* }
38-
*
39-
* // cpp file
40-
* FATAL_S(member_name, "some_member");
41-
*
42-
* using info = get_struct_member_by<
43-
* some_struct,
44-
* member_name,
45-
* fatal::get_type::name
46-
* >;
47-
*
48-
* some_struct x;
49-
* info::getter{}(x) = 10;
50-
*
51-
* // prints `10`
52-
* std::cout << x.some_member;
53-
*
54-
* @author: Marcelo Juchem <marcelo@fb.com>
55-
*/
56-
template <typename T, typename Key, typename Filter>
57-
using get_struct_member_by =
58-
typename detail ::check_struct_has_member_for_criteria<
59-
T,
60-
fatal::find<typename reflect_struct<T>::members, Key, void, Filter>>::
61-
type;
62-
63-
/**
64-
* Gets the reflection metadata for a given struct's member based on its name.
65-
*
66-
* Example:
67-
*
68-
* // Thrift file
69-
* struct some_struct {
70-
* 123: i32 some_member
71-
* }
72-
*
73-
* // cpp file
74-
* FATAL_S(member_name, "some_member");
75-
*
76-
* using info = get_struct_member_by_name<some_struct, member_name>;
77-
*
78-
* some_struct x;
79-
* info::getter{}(x) = 10;
80-
*
81-
* // prints `10`
82-
* std::cout << x.some_member;
83-
*
84-
* @author: Marcelo Juchem <marcelo@fb.com>
85-
*/
86-
template <typename T, typename Name>
87-
using get_struct_member_by_name =
88-
typename detail ::check_struct_has_member_for_criteria<
89-
T,
90-
fatal::find<
91-
typename reflect_struct<T>::members,
92-
Name,
93-
void,
94-
fatal::get_type::name>>::type;
95-
96-
/**
97-
* Gets the reflection metadata for a given struct's member based on its name.
98-
*
99-
* Example:
100-
*
101-
* // Thrift file
102-
* struct some_struct {
103-
* 123: i32 some_member
104-
* }
105-
*
106-
* // cpp file
107-
* using info = get_struct_member_by_id<some_struct, 123>;
108-
*
109-
* some_struct x;
110-
* info::getter{}(x) = 10;
111-
*
112-
* // prints `10`
113-
* std::cout << x.some_member;
114-
*
115-
* @author: Marcelo Juchem <marcelo@fb.com>
116-
*/
117-
template <typename T, field_id_t Id>
118-
using get_struct_member_by_id =
119-
typename detail ::check_struct_has_member_for_criteria<
120-
T,
121-
fatal::find<
122-
typename reflect_struct<T>::members,
123-
std::integral_constant<field_id_t, Id>,
124-
void,
125-
fatal::get_type::id>>::type;
126-
127-
} // namespace apache::thrift
128-
129-
#endif // THRIFT_FATAL_HELPERS_H_

third-party/thrift/src/thrift/lib/cpp2/reflection/internal/helpers-inl-pre.h

Lines changed: 0 additions & 38 deletions
This file was deleted.

third-party/thrift/src/thrift/test/reflection/reflection_helpers_test.cpp

Lines changed: 0 additions & 165 deletions
This file was deleted.

0 commit comments

Comments
 (0)