diff --git a/mcrouter/lib/carbon/test/Util.h b/mcrouter/lib/carbon/test/Util.h index 2e21fac8..30834f4e 100644 --- a/mcrouter/lib/carbon/test/Util.h +++ b/mcrouter/lib/carbon/test/Util.h @@ -20,7 +20,6 @@ namespace carbon { namespace test { class TestRequest; -class TestCompactRequest; namespace util { diff --git a/mcrouter/lib/carbon/test/gen/CompactTest.thrift b/mcrouter/lib/carbon/test/gen/CompactTest.thrift deleted file mode 100644 index b7d5491a..00000000 --- a/mcrouter/lib/carbon/test/gen/CompactTest.thrift +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the LICENSE - * file in the root directory of this source tree. - * - */ - -/* - * THIS FILE IS AUTOGENERATED. DO NOT MODIFY IT; ALL CHANGES WILL BE LOST IN - * VAIN. - * - * @generated - */ -include "mcrouter/lib/carbon/carbon.thrift" -include "mcrouter/lib/carbon/carbon_result.thrift" - - -cpp_include "" - -namespace cpp2 carbon.test.thrift2 - -enum SimpleEnum { - Twenty = 20, - Zero = 0, - One = 1, - Negative = -92233 -} (cpp.enum_type="int32_t") - -struct TestCompactRequest { - 1: carbon.StringKey key - 2: SimpleEnum testEnum - 3: bool testBool - 4: byte (cpp.type = "char") testChar - 5: byte testInt8 - 6: i16 testInt16 - 7: i32 testInt32 - 8: i64 testInt64 - 9: byte (cpp.type = "uint8_t") testUInt8 - 10: i16 (cpp.type = "uint16_t") testUInt16 - 11: i32 (cpp.type = "uint32_t") testUInt32 - 12: i64 (cpp.type = "uint64_t") testUInt64 - 13: string testShortString - 14: string testLongString - 15: binary (cpp.type = "folly::IOBuf") testIobuf - 16: list testList -}(cpp.methods = " - template - void visitFields(V&& v); - template - void visitFields(V&& v) const; - - template - void serialize(Writer&& writer) const; - - void deserialize(carbon::CarbonProtocolReader& reader); - -", -cpp.virtual -) -struct TestCompactReply { - 1: carbon_result.Result result - 2: i32 valInt32 - 3: i64 valInt64 -}(cpp.methods = " - template - void visitFields(V&& v); - template - void visitFields(V&& v) const; - - template - void serialize(Writer&& writer) const; - - void deserialize(carbon::CarbonProtocolReader& reader); - -", -cpp.virtual -) diff --git a/mcrouter/lib/carbon/test/gen/CompactTestMessages-inl.h b/mcrouter/lib/carbon/test/gen/CompactTestMessages-inl.h deleted file mode 100644 index bce6bd4b..00000000 --- a/mcrouter/lib/carbon/test/gen/CompactTestMessages-inl.h +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the LICENSE - * file in the root directory of this source tree. - * - */ - -/* - * THIS FILE IS AUTOGENERATED. DO NOT MODIFY IT; ALL CHANGES WILL BE LOST IN - * VAIN. - * - * @generated - */ - -namespace carbon { -namespace test { -namespace thrift2 { - -template -void TestCompactRequest::serialize(Writer&& writer) const { - writer.writeStructBegin(); - writer.writeField(1 /* field id */, key_ref()); - writer.writeField(2 /* field id */, testEnum_ref()); - writer.writeField(3 /* field id */, testBool_ref()); - writer.writeField(4 /* field id */, testChar_ref()); - writer.writeField(5 /* field id */, testInt8_ref()); - writer.writeField(6 /* field id */, testInt16_ref()); - writer.writeField(7 /* field id */, testInt32_ref()); - writer.writeField(8 /* field id */, testInt64_ref()); - writer.writeField(9 /* field id */, testUInt8_ref()); - writer.writeField(10 /* field id */, testUInt16_ref()); - writer.writeField(11 /* field id */, testUInt32_ref()); - writer.writeField(12 /* field id */, testUInt64_ref()); - writer.writeField(13 /* field id */, testShortString_ref()); - writer.writeField(14 /* field id */, testLongString_ref()); - writer.writeField(15 /* field id */, testIobuf_ref()); - writer.writeField(16 /* field id */, testList_ref()); - writer.writeFieldStop(); - writer.writeStructEnd(); -} - -template -void TestCompactRequest::visitFields(V&& v) { - if (!v.visitField(1, "key", *this->key_ref())) { - return; - } - if (!v.visitField(2, "testEnum", *this->testEnum_ref())) { - return; - } - if (!v.visitField(3, "testBool", *this->testBool_ref())) { - return; - } - if (!v.visitField(4, "testChar", *this->testChar_ref())) { - return; - } - if (!v.visitField(5, "testInt8", *this->testInt8_ref())) { - return; - } - if (!v.visitField(6, "testInt16", *this->testInt16_ref())) { - return; - } - if (!v.visitField(7, "testInt32", *this->testInt32_ref())) { - return; - } - if (!v.visitField(8, "testInt64", *this->testInt64_ref())) { - return; - } - if (!v.visitField(9, "testUInt8", *this->testUInt8_ref())) { - return; - } - if (!v.visitField(10, "testUInt16", *this->testUInt16_ref())) { - return; - } - if (!v.visitField(11, "testUInt32", *this->testUInt32_ref())) { - return; - } - if (!v.visitField(12, "testUInt64", *this->testUInt64_ref())) { - return; - } - if (!v.visitField(13, "testShortString", *this->testShortString_ref())) { - return; - } - if (!v.visitField(14, "testLongString", *this->testLongString_ref())) { - return; - } - if (!v.visitField(15, "testIobuf", *this->testIobuf_ref())) { - return; - } - if (!v.visitField(16, "testList", *this->testList_ref())) { - return; - } -} - -template -void TestCompactRequest::visitFields(V&& v) const { - if (!v.visitField(1, "key", *this->key_ref())) { - return; - } - if (!v.visitField(2, "testEnum", *this->testEnum_ref())) { - return; - } - if (!v.visitField(3, "testBool", *this->testBool_ref())) { - return; - } - if (!v.visitField(4, "testChar", *this->testChar_ref())) { - return; - } - if (!v.visitField(5, "testInt8", *this->testInt8_ref())) { - return; - } - if (!v.visitField(6, "testInt16", *this->testInt16_ref())) { - return; - } - if (!v.visitField(7, "testInt32", *this->testInt32_ref())) { - return; - } - if (!v.visitField(8, "testInt64", *this->testInt64_ref())) { - return; - } - if (!v.visitField(9, "testUInt8", *this->testUInt8_ref())) { - return; - } - if (!v.visitField(10, "testUInt16", *this->testUInt16_ref())) { - return; - } - if (!v.visitField(11, "testUInt32", *this->testUInt32_ref())) { - return; - } - if (!v.visitField(12, "testUInt64", *this->testUInt64_ref())) { - return; - } - if (!v.visitField(13, "testShortString", *this->testShortString_ref())) { - return; - } - if (!v.visitField(14, "testLongString", *this->testLongString_ref())) { - return; - } - if (!v.visitField(15, "testIobuf", *this->testIobuf_ref())) { - return; - } - if (!v.visitField(16, "testList", *this->testList_ref())) { - return; - } -} - -template -void TestCompactReply::serialize(Writer&& writer) const { - writer.writeStructBegin(); - writer.writeField(1 /* field id */, result_ref()); - writer.writeField(2 /* field id */, valInt32_ref()); - writer.writeField(3 /* field id */, valInt64_ref()); - writer.writeFieldStop(); - writer.writeStructEnd(); -} - -template -void TestCompactReply::visitFields(V&& v) { - if (!v.visitField(1, "result", *this->result_ref())) { - return; - } - if (!v.visitField(2, "valInt32", *this->valInt32_ref())) { - return; - } - if (!v.visitField(3, "valInt64", *this->valInt64_ref())) { - return; - } -} - -template -void TestCompactReply::visitFields(V&& v) const { - if (!v.visitField(1, "result", *this->result_ref())) { - return; - } - if (!v.visitField(2, "valInt32", *this->valInt32_ref())) { - return; - } - if (!v.visitField(3, "valInt64", *this->valInt64_ref())) { - return; - } -} -} // namespace thrift2 -} // namespace test -} // namespace carbon - -namespace apache { -namespace thrift { -template <> -class Cpp2Ops { - public: - typedef carbon::test::TestCompactRequest Type; - static constexpr protocol::TType thriftType() { - return protocol::T_STRUCT; - } - template - static uint32_t write(Protocol* prot, const Type* value) { - return value->write(prot); - } - template - static void read(Protocol* prot, Type* value) { - value->read(prot); - } - template - static uint32_t serializedSize(Protocol* prot, const Type* value) { - return value->serializedSize(prot); - } - template - static uint32_t serializedSizeZC(Protocol* prot, const Type* value) { - return value->serializedSizeZC(prot); - } -}; - -template <> -class Cpp2Ops { - public: - typedef carbon::test::TestCompactReply Type; - static constexpr protocol::TType thriftType() { - return protocol::T_STRUCT; - } - template - static uint32_t write(Protocol* prot, const Type* value) { - return value->write(prot); - } - template - static void read(Protocol* prot, Type* value) { - value->read(prot); - } - template - static uint32_t serializedSize(Protocol* prot, const Type* value) { - return value->serializedSize(prot); - } - template - static uint32_t serializedSizeZC(Protocol* prot, const Type* value) { - return value->serializedSizeZC(prot); - } -}; -} // namespace thrift -} // namespace apache