1 /*
2  * Copyright (c) Facebook, Inc. and its affiliates.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "thrift/compiler/ast/t_base_type.h"
18 
19 namespace apache {
20 namespace thrift {
21 namespace compiler {
22 
t_void()23 const t_base_type& t_base_type::t_void() {
24   static t_base_type type{"void", type::t_void};
25   return type;
26 }
27 
t_string()28 const t_base_type& t_base_type::t_string() {
29   static t_base_type type{"string", type::t_string};
30   return type;
31 }
32 
t_binary()33 const t_base_type& t_base_type::t_binary() {
34   // NOTE: thrift compiler used to treat both string and binary as string.
35   // TODO(afuller): Change this to "binary".
36   static t_base_type type{"string", type::t_binary};
37   return type;
38 }
39 
t_bool()40 const t_base_type& t_base_type::t_bool() {
41   static t_base_type type{"bool", type::t_bool};
42   return type;
43 }
44 
t_byte()45 const t_base_type& t_base_type::t_byte() {
46   static t_base_type type{"byte", type::t_byte};
47   return type;
48 }
49 
t_i16()50 const t_base_type& t_base_type::t_i16() {
51   static t_base_type type{"i16", type::t_i16};
52   return type;
53 }
54 
t_i32()55 const t_base_type& t_base_type::t_i32() {
56   static t_base_type type{"i32", type::t_i32};
57   return type;
58 }
59 
t_i64()60 const t_base_type& t_base_type::t_i64() {
61   static t_base_type type{"i64", type::t_i64};
62   return type;
63 }
64 
t_double()65 const t_base_type& t_base_type::t_double() {
66   static t_base_type type{"double", type::t_double};
67   return type;
68 }
69 
t_float()70 const t_base_type& t_base_type::t_float() {
71   static t_base_type type{"float", type::t_float};
72   return type;
73 }
74 
75 } // namespace compiler
76 } // namespace thrift
77 } // namespace apache
78