/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ include "thrift/annotation/cpp.thrift" @cpp.Type{name = "Foo"} typedef i64 (cpp.indirection) IndirectionA @cpp.Type{name = "Baz"} typedef i32 (cpp.indirection) IndirectionC @cpp.Type{name = "Bar"} typedef double (cpp.indirection) IndirectionB enum MyEnumA { fieldA = 1, fieldB = 2, fieldC = 4, } struct SmallStruct { 1: bool small_A; 2: i32 small_B; } struct containerStruct { 1: bool fieldA; 2: map fieldB; 3: set fieldC = [1, 2, 3, 4]; 4: string fieldD; 5: string fieldE = "somestring"; 6: list>> fieldF; 7: map>> fieldG; 8: list> fieldH; 9: bool fieldI = true; 10: map> fieldJ = { "subfieldA": [1, 4, 8, 12], "subfieldB": [2, 5, 9, 13], }; 11: list>>> fieldK; 12: set>> fieldL; 13: map>, map>, string>> fieldM; 14: list fieldN; 15: list fieldO; 16: list fieldP; 17: MyEnumA fieldQ; @cpp.Ref{type = cpp.RefType.Unique} 18: map fieldR; @cpp.Ref{type = cpp.RefType.Unique} 19: SmallStruct fieldS; @cpp.Ref{type = cpp.RefType.SharedMutable} 20: SmallStruct fieldT; @cpp.Ref{type = cpp.RefType.Shared} 21: SmallStruct fieldU; @cpp.Ref{type = cpp.RefType.Unique} 23: SmallStruct fieldX; }