ACLOCAL_AMFLAGS = -I ./aclocal
-SUBDIRS = compiler/cpp lib if test
+SUBDIRS = compiler/cpp lib test
## Don't run make dist from a subversion working copy
## because it will pull in your .svn directories.
EXTRA_DIST = bootstrap.sh cleanup.sh doc test tutorial contrib \
iter = parsed_options.find("include_prefix");
use_include_prefix_ = (iter != parsed_options.end());
- iter = parsed_options.find("reflection_limited");
- gen_reflection_limited_ = (iter != parsed_options.end());
-
out_dir_base_ = "gen-cpp";
}
void generate_process_function (t_service* tservice, t_function* tfunction);
void generate_function_helpers (t_service* tservice, t_function* tfunction);
- void generate_service_limited_reflector(t_service* tservice);
- bool generate_type_limited_reflection(t_type* ttype, std::string target);
- bool generate_simple_type_limited_reflection(std::ostream& out, t_type* ttype, std::string target);
-
/**
* Serialization constructs
*/
*/
std::string get_include_prefix(const t_program& program) const;
- /**
- * True iff we should generate limited reflectors for services.
- */
- bool gen_reflection_limited_;
-
/**
* True iff we should generate local reflection metadata for TDenseProtocol.
*/
// Include base types
f_types_ <<
"#include <Thrift.h>" << endl <<
- "#include <reflection_limited_types.h>" << endl <<
"#include <protocol/TProtocol.h>" << endl <<
"#include <transport/TTransport.h>" << endl <<
endl;
generate_function_helpers(tservice, *f_iter);
}
-
- if (gen_reflection_limited_) {
- generate_service_limited_reflector(tservice);
- }
}
/**
f_header_ <<
indent() << "virtual ~" << service_name_ << "If() {}" << endl;
- if (gen_reflection_limited_) {
- f_header_ <<
- indent() << "static void getStaticLimitedReflection" <<
- "(apache::thrift::reflection::limited::Service & _return);" << endl;
- // TODO(dreiss): Uncomment and test this if we decide we need
- // a virtual function with this effect.
- //f_header_ <<
- // indent() << "virtual void getVirtualLimitedReflection" <<
- // "(apache::thrift::reflection::limited::Service & _return) ";
- //scope_up(f_header_);
- //f_header_ <<
- // indent() << "getStaticLimitedReflection(_return);" << endl;
- //scope_down(f_header_);
- }
-
vector<t_function*> functions = tservice->get_functions();
vector<t_function*>::iterator f_iter;
for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
f_service_ << endl;
}
-/**
- * Helper function for generate_service_limited_reflector.
- * Generates a reflection of a single simple type.
- *
- * @param ttype The type to reflect
- * @param target The name of the lvalue to reflect onto
- * @return true iff the type really is simple
- *
- * Note: don't let this function output anything unless it is going to return true.
- */
-bool t_cpp_generator::generate_simple_type_limited_reflection(ostream & out, t_type* ttype, string target) {
- if (ttype->is_base_type()) {
- string type;
- switch (((t_base_type*)ttype)->get_base()) {
- case t_base_type::TYPE_VOID : type = "T_VOID;" ; break;
- case t_base_type::TYPE_STRING : type = "T_STRING;" ; break;
- case t_base_type::TYPE_BOOL : type = "T_BOOL;" ; break;
- case t_base_type::TYPE_BYTE : type = "T_BYTE;" ; break;
- case t_base_type::TYPE_I16 : type = "T_I16;" ; break;
- case t_base_type::TYPE_I32 : type = "T_I32;" ; break;
- case t_base_type::TYPE_I64 : type = "T_I64;" ; break;
- case t_base_type::TYPE_DOUBLE : type = "T_DOUBLE;" ; break;
- default: return false;
- }
- out << indent() << target << ".ttype = " << type << endl;
- return true;
- }
-
- if (ttype->is_enum()) {
- out <<
- indent() << target << ".ttype = T_ENUM;" << endl <<
- indent() << target << ".name = \"" << ttype->get_name() << "\";" << endl;
- }
-
- if (ttype->is_struct()) {
- out <<
- indent() << target << ".ttype = T_STRUCT;" << endl <<
- indent() << target << ".name = \"" << ttype->get_name() << "\";" << endl;
- return true;
- }
-
- return false;
-}
-
-/**
- * Helper function for generate_service_limited_reflector.
- * Generates a reflection of a single type.
- *
- * @param ttype The type to reflect
- * @param target The name of the lvalue to reflect onto
- */
-bool t_cpp_generator::generate_type_limited_reflection(t_type* ttype, string target) {
- bool is_simple = generate_simple_type_limited_reflection(f_service_, ttype, target + ".simple_type");
- if (is_simple) {
- f_service_ <<
- indent() << target << ".is_container = false;" << endl <<
- indent() << target << ".__isset.simple_type = true;" << endl;
- return true;
- }
-
- ostringstream out;
-
- out <<
- indent() << target << ".is_container = true;" << endl <<
- indent() << target << ".__isset.container_type = true;" << endl <<
- indent() << target << ".container_type.ttype = ";
-
- if (ttype->is_list()) out << "T_LIST;" << endl;
- if (ttype->is_set()) out << "T_SET;" << endl;
- if (ttype->is_map()) out << "T_MAP;" << endl;
-
- bool reflected = false;
-
- if (ttype->is_list()) {
- reflected = generate_simple_type_limited_reflection(
- out, ((t_list*)ttype)->get_elem_type(), target + ".container_type.subtype1");
- }
- if (ttype->is_set()) {
- reflected = generate_simple_type_limited_reflection(
- out, ((t_set*)ttype)->get_elem_type(), target + ".container_type.subtype1");
- }
- if (ttype->is_map()) {
- reflected =
- generate_simple_type_limited_reflection(
- out, ((t_map*)ttype)->get_key_type(), target + ".container_type.subtype1")
- &&
- generate_simple_type_limited_reflection(
- out, ((t_map*)ttype)->get_val_type(), target + ".container_type.subtype2");
- out << indent() << target << ".container_type.__isset.subtype2 = true;" << endl;
- }
-
- if (reflected) {
- f_service_ << out.str();
- return true;
- } else {
- f_service_ <<
- indent() << target << ".is_container = false;" << endl <<
- indent() << target << ".__isset.simple_type = true;" << endl;
- f_service_ << indent() << target << ".simple_type.ttype = T_NOT_REFLECTED;" << endl;
- return false;
- }
-}
-
-/**
- * Generates a service reflector definition.
- * This uses thrift::reflection::limited.
- *
- * @param tservice The service to write a reflector for
- */
-void t_cpp_generator::generate_service_limited_reflector(t_service* tservice) {
- // Open function
- f_service_ <<
- indent() << "void " << tservice->get_name() << "If::getStaticLimitedReflection" <<
- "(apache::thrift::reflection::limited::Service & _return) ";
- scope_up(f_service_);
-
- f_service_ << indent() << "using namespace apache::thrift::reflection::limited;" << endl;
-
- f_service_ << indent() << "_return.name = \"" << tservice->get_name() << "\";" << endl;
- f_service_ << indent() << "_return.fully_reflected = true;" << endl;
-
- bool all_reflectable = true;
- bool one_reflectable;
-
- const vector<t_function*> & funcs = tservice->get_functions();
- vector<t_function*>::const_iterator f_iter;
- for (f_iter = funcs.begin(); f_iter != funcs.end(); ++f_iter) {
-
- f_service_ << indent() << "_return.methods.resize(_return.methods.size() + 1);" << endl;
- f_service_ << indent() << "_return.methods.back().name = \"" << (*f_iter)->get_name() << "\";" << endl;
- one_reflectable = generate_type_limited_reflection(
- (*f_iter)->get_returntype(), "_return.methods.back().return_type");
- all_reflectable = all_reflectable && one_reflectable;
-
- t_struct* arglist = (*f_iter)->get_arglist();
- const vector<t_field*> & args = arglist->get_members();
- vector<t_field*>::const_iterator a_iter;
- for (a_iter = args.begin(); a_iter != args.end(); ++a_iter) {
- f_service_ <<
- indent() << "_return.methods.back().arguments.resize("
- "_return.methods.back().arguments.size() + 1);" << endl <<
- indent() << "_return.methods.back().arguments.back().name = \"" <<
- (*a_iter)->get_name() << "\";" << endl <<
- indent() << "_return.methods.back().arguments.back().key = " <<
- (*a_iter)->get_key() << ";" << endl;
- one_reflectable = generate_type_limited_reflection(
- (*a_iter)->get_type(), "_return.methods.back().arguments.back().type");
- all_reflectable = all_reflectable && one_reflectable;
- }
- }
-
- if (!all_reflectable) {
- f_service_ << indent() << "_return.fully_reflected = false;" << endl;
- }
-
- // Close function
- scope_down(f_service_);
- f_service_ << endl;
-}
-
/**
* Generates a skeleton file of a server
*
lib/perl/test/Makefile
lib/py/Makefile
lib/rb/Makefile
- if/Makefile
test/Makefile
test/py/Makefile
test/rb/Makefile
using namespace facebook::fb303;
using facebook::thrift::concurrency::Guard;
-FacebookBase::FacebookBase(std::string name, get_static_limref_ptr reflect_lim) :
+FacebookBase::FacebookBase(std::string name) :
name_(name) {
aliveSince_ = (int64_t) time(NULL);
- if (reflect_lim) {
- reflect_lim(reflection_limited_);
- }
}
inline void FacebookBase::getName(std::string& _return) {
struct ReadWriteCounterMap : ReadWriteMutex,
std::map<std::string, ReadWriteInt> {};
-typedef void (*get_static_limref_ptr)(facebook::thrift::reflection::limited::Service &);
-
/**
* Base Facebook service implementation in C++.
*
*/
class FacebookBase : virtual public FacebookServiceIf {
protected:
- FacebookBase(std::string name, get_static_limref_ptr reflect_lim = NULL);
+ FacebookBase(std::string name);
virtual ~FacebookBase() {}
public:
int64_t aliveSince();
- void getLimitedReflection(facebook::thrift::reflection::limited::Service& _return) {
- _return = reflection_limited_;
- }
-
virtual void reinitialize() {}
virtual void shutdown() {
private:
std::string name_;
- facebook::thrift::reflection::limited::Service reflection_limited_;
int64_t aliveSince_;
std::map<std::string, std::string> options_;
* @author Mark Slee <mcslee@facebook.com>
*/
-include "thrift/if/reflection_limited.thrift"
-
namespace java com.facebook.fb303
namespace cpp facebook.fb303
*/
i64 aliveSince(),
- /**
- * Returns a limited description of this service.
- */
- reflection_limited.Service
- getLimitedReflection(),
-
/**
* Tell the server to reload its configuration, reopen log files, etc
*/
return "";
}
- public org.apache.thrift.reflection.limited.Service getLimitedReflection() {
- return new org.apache.thrift.reflection.limited.Service();
- }
-
public void reinitialize() {}
public void shutdown() {}
%files
%defattr(-,root,root)
%{_bindir}/thrift
-%{_datadir}/thrift/if/reflection_limited.thrift
%package lib-cpp
+++ /dev/null
-thrift_ifdir = $(datadir)/thrift/if
-dist_thrift_if_DATA = \
- reflection_limited.thrift
-EXTRA_DIST = regen.sh
+++ /dev/null
-// NOTICE!!!
-// DO NOT FORGET to run regen.sh if you change this file
-// (or if you change the compiler).
-
-// This interface is deprecated.
-// There is no replacement yet, but I hate it so much that
-// I'm deprecating it before it's done.
-// @author I'm too ashamed to say.
-
-// dreiss naively thinks he knows how to do this better,
-// so talk to him if you are interested in taking it on,
-// or if you just want someone to make it better for you.
-
-cpp_namespace facebook.thrift.reflection.limited
-java_package com.facebook.thrift.reflection.limited
-py_module thrift.reflection.limited
-
-enum TTypeTag {
- T_VOID = 1,
- T_BOOL = 2,
- T_BYTE = 3,
- T_I16 = 6,
- T_I32 = 8,
- T_I64 = 10,
- T_DOUBLE = 4,
- T_STRING = 11,
- T_STRUCT = 12,
- T_MAP = 13,
- T_SET = 14,
- T_LIST = 15,
- // This doesn't exist in TBinaryProtocol, but it could be useful for reflection.
- T_ENUM = 101,
- T_NOT_REFLECTED = 102,
-}
-
-struct SimpleType {
- 1: TTypeTag ttype,
- 2: string name, // For structs and emums.
-}
-
-struct ContainerType {
- 1: TTypeTag ttype,
- 2: SimpleType subtype1,
- 3: optional SimpleType subtype2,
-}
-
-struct ThriftType {
- 1: bool is_container,
- 2: optional SimpleType simple_type,
- 3: optional ContainerType container_type,
-}
-
-struct Argument {
- 1: i16 key,
- 2: string name,
- 3: ThriftType type,
-}
-
-struct Method {
- 1: string name,
- 2: ThriftType return_type,
- 3: list<Argument> arguments,
-}
-
-struct Service {
- 1: string name,
- 2: list<Method> methods,
- 3: bool fully_reflected,
-}
+++ /dev/null
-#!/bin/sh
-cd "`dirname $0`"
-../compiler/cpp/thrift --gen cpp --gen py reflection_limited.thrift
-cp gen-cpp/reflection_limited_types.h ../lib/cpp/src/
-cp gen-cpp/reflection_limited_types.cpp ../lib/cpp/src/
-cp -r gen-py/thrift/reflection ../lib/py/src
# Define the source files for the module
libthrift_la_SOURCES = src/Thrift.cpp \
- src/reflection_limited_types.cpp \
src/concurrency/Mutex.cpp \
src/concurrency/Monitor.cpp \
src/concurrency/PosixThreadFactory.cpp \
$(top_builddir)/config.h \
src/Thrift.h \
src/TReflectionLocal.h \
- src/reflection_limited_types.h \
src/TProcessor.h \
src/TLogging.h
+++ /dev/null
-/**
- * Autogenerated by Thrift
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- */
-#include "reflection_limited_types.h"
-
-namespace apache { namespace thrift { namespace reflection { namespace limited {
-
-const char* SimpleType::ascii_fingerprint = "19B5240589E680301A7E32DF3971EFBE";
-const uint8_t SimpleType::binary_fingerprint[16] = {0x19,0xB5,0x24,0x05,0x89,0xE6,0x80,0x30,0x1A,0x7E,0x32,0xDF,0x39,0x71,0xEF,0xBE};
-
-uint32_t SimpleType::read(apache::thrift::protocol::TProtocol* iprot) {
-
- uint32_t xfer = 0;
- std::string fname;
- apache::thrift::protocol::TType ftype;
- int16_t fid;
-
- xfer += iprot->readStructBegin(fname);
-
- using apache::thrift::protocol::TProtocolException;
-
-
- while (true)
- {
- xfer += iprot->readFieldBegin(fname, ftype, fid);
- if (ftype == apache::thrift::protocol::T_STOP) {
- break;
- }
- switch (fid)
- {
- case 1:
- if (ftype == apache::thrift::protocol::T_I32) {
- int32_t ecast0;
- xfer += iprot->readI32(ecast0);
- this->ttype = (TTypeTag)ecast0;
- this->__isset.ttype = true;
- } else {
- xfer += iprot->skip(ftype);
- }
- break;
- case 2:
- if (ftype == apache::thrift::protocol::T_STRING) {
- xfer += iprot->readString(this->name);
- this->__isset.name = true;
- } else {
- xfer += iprot->skip(ftype);
- }
- break;
- default:
- xfer += iprot->skip(ftype);
- break;
- }
- xfer += iprot->readFieldEnd();
- }
-
- xfer += iprot->readStructEnd();
-
- return xfer;
-}
-
-uint32_t SimpleType::write(apache::thrift::protocol::TProtocol* oprot) const {
- uint32_t xfer = 0;
- xfer += oprot->writeStructBegin("SimpleType");
- xfer += oprot->writeFieldBegin("ttype", apache::thrift::protocol::T_I32, 1);
- xfer += oprot->writeI32((int32_t)this->ttype);
- xfer += oprot->writeFieldEnd();
- xfer += oprot->writeFieldBegin("name", apache::thrift::protocol::T_STRING, 2);
- xfer += oprot->writeString(this->name);
- xfer += oprot->writeFieldEnd();
- xfer += oprot->writeFieldStop();
- xfer += oprot->writeStructEnd();
- return xfer;
-}
-
-const char* ContainerType::ascii_fingerprint = "654FA6EFFF8242F4C2A604B970686634";
-const uint8_t ContainerType::binary_fingerprint[16] = {0x65,0x4F,0xA6,0xEF,0xFF,0x82,0x42,0xF4,0xC2,0xA6,0x04,0xB9,0x70,0x68,0x66,0x34};
-
-uint32_t ContainerType::read(apache::thrift::protocol::TProtocol* iprot) {
-
- uint32_t xfer = 0;
- std::string fname;
- apache::thrift::protocol::TType ftype;
- int16_t fid;
-
- xfer += iprot->readStructBegin(fname);
-
- using apache::thrift::protocol::TProtocolException;
-
-
- while (true)
- {
- xfer += iprot->readFieldBegin(fname, ftype, fid);
- if (ftype == apache::thrift::protocol::T_STOP) {
- break;
- }
- switch (fid)
- {
- case 1:
- if (ftype == apache::thrift::protocol::T_I32) {
- int32_t ecast1;
- xfer += iprot->readI32(ecast1);
- this->ttype = (TTypeTag)ecast1;
- this->__isset.ttype = true;
- } else {
- xfer += iprot->skip(ftype);
- }
- break;
- case 2:
- if (ftype == apache::thrift::protocol::T_STRUCT) {
- xfer += this->subtype1.read(iprot);
- this->__isset.subtype1 = true;
- } else {
- xfer += iprot->skip(ftype);
- }
- break;
- case 3:
- if (ftype == apache::thrift::protocol::T_STRUCT) {
- xfer += this->subtype2.read(iprot);
- this->__isset.subtype2 = true;
- } else {
- xfer += iprot->skip(ftype);
- }
- break;
- default:
- xfer += iprot->skip(ftype);
- break;
- }
- xfer += iprot->readFieldEnd();
- }
-
- xfer += iprot->readStructEnd();
-
- return xfer;
-}
-
-uint32_t ContainerType::write(apache::thrift::protocol::TProtocol* oprot) const {
- uint32_t xfer = 0;
- xfer += oprot->writeStructBegin("ContainerType");
- xfer += oprot->writeFieldBegin("ttype", apache::thrift::protocol::T_I32, 1);
- xfer += oprot->writeI32((int32_t)this->ttype);
- xfer += oprot->writeFieldEnd();
- xfer += oprot->writeFieldBegin("subtype1", apache::thrift::protocol::T_STRUCT, 2);
- xfer += this->subtype1.write(oprot);
- xfer += oprot->writeFieldEnd();
- if (this->__isset.subtype2) {
- xfer += oprot->writeFieldBegin("subtype2", apache::thrift::protocol::T_STRUCT, 3);
- xfer += this->subtype2.write(oprot);
- xfer += oprot->writeFieldEnd();
- }
- xfer += oprot->writeFieldStop();
- xfer += oprot->writeStructEnd();
- return xfer;
-}
-
-const char* ThriftType::ascii_fingerprint = "76BC1CC759001D7D85FEE75C4F183062";
-const uint8_t ThriftType::binary_fingerprint[16] = {0x76,0xBC,0x1C,0xC7,0x59,0x00,0x1D,0x7D,0x85,0xFE,0xE7,0x5C,0x4F,0x18,0x30,0x62};
-
-uint32_t ThriftType::read(apache::thrift::protocol::TProtocol* iprot) {
-
- uint32_t xfer = 0;
- std::string fname;
- apache::thrift::protocol::TType ftype;
- int16_t fid;
-
- xfer += iprot->readStructBegin(fname);
-
- using apache::thrift::protocol::TProtocolException;
-
-
- while (true)
- {
- xfer += iprot->readFieldBegin(fname, ftype, fid);
- if (ftype == apache::thrift::protocol::T_STOP) {
- break;
- }
- switch (fid)
- {
- case 1:
- if (ftype == apache::thrift::protocol::T_BOOL) {
- xfer += iprot->readBool(this->is_container);
- this->__isset.is_container = true;
- } else {
- xfer += iprot->skip(ftype);
- }
- break;
- case 2:
- if (ftype == apache::thrift::protocol::T_STRUCT) {
- xfer += this->simple_type.read(iprot);
- this->__isset.simple_type = true;
- } else {
- xfer += iprot->skip(ftype);
- }
- break;
- case 3:
- if (ftype == apache::thrift::protocol::T_STRUCT) {
- xfer += this->container_type.read(iprot);
- this->__isset.container_type = true;
- } else {
- xfer += iprot->skip(ftype);
- }
- break;
- default:
- xfer += iprot->skip(ftype);
- break;
- }
- xfer += iprot->readFieldEnd();
- }
-
- xfer += iprot->readStructEnd();
-
- return xfer;
-}
-
-uint32_t ThriftType::write(apache::thrift::protocol::TProtocol* oprot) const {
- uint32_t xfer = 0;
- xfer += oprot->writeStructBegin("ThriftType");
- xfer += oprot->writeFieldBegin("is_container", apache::thrift::protocol::T_BOOL, 1);
- xfer += oprot->writeBool(this->is_container);
- xfer += oprot->writeFieldEnd();
- if (this->__isset.simple_type) {
- xfer += oprot->writeFieldBegin("simple_type", apache::thrift::protocol::T_STRUCT, 2);
- xfer += this->simple_type.write(oprot);
- xfer += oprot->writeFieldEnd();
- }
- if (this->__isset.container_type) {
- xfer += oprot->writeFieldBegin("container_type", apache::thrift::protocol::T_STRUCT, 3);
- xfer += this->container_type.write(oprot);
- xfer += oprot->writeFieldEnd();
- }
- xfer += oprot->writeFieldStop();
- xfer += oprot->writeStructEnd();
- return xfer;
-}
-
-const char* Argument::ascii_fingerprint = "8C45506BE0EFBB22FB19FA40DDCECB3F";
-const uint8_t Argument::binary_fingerprint[16] = {0x8C,0x45,0x50,0x6B,0xE0,0xEF,0xBB,0x22,0xFB,0x19,0xFA,0x40,0xDD,0xCE,0xCB,0x3F};
-
-uint32_t Argument::read(apache::thrift::protocol::TProtocol* iprot) {
-
- uint32_t xfer = 0;
- std::string fname;
- apache::thrift::protocol::TType ftype;
- int16_t fid;
-
- xfer += iprot->readStructBegin(fname);
-
- using apache::thrift::protocol::TProtocolException;
-
-
- while (true)
- {
- xfer += iprot->readFieldBegin(fname, ftype, fid);
- if (ftype == apache::thrift::protocol::T_STOP) {
- break;
- }
- switch (fid)
- {
- case 1:
- if (ftype == apache::thrift::protocol::T_I16) {
- xfer += iprot->readI16(this->key);
- this->__isset.key = true;
- } else {
- xfer += iprot->skip(ftype);
- }
- break;
- case 2:
- if (ftype == apache::thrift::protocol::T_STRING) {
- xfer += iprot->readString(this->name);
- this->__isset.name = true;
- } else {
- xfer += iprot->skip(ftype);
- }
- break;
- case 3:
- if (ftype == apache::thrift::protocol::T_STRUCT) {
- xfer += this->type.read(iprot);
- this->__isset.type = true;
- } else {
- xfer += iprot->skip(ftype);
- }
- break;
- default:
- xfer += iprot->skip(ftype);
- break;
- }
- xfer += iprot->readFieldEnd();
- }
-
- xfer += iprot->readStructEnd();
-
- return xfer;
-}
-
-uint32_t Argument::write(apache::thrift::protocol::TProtocol* oprot) const {
- uint32_t xfer = 0;
- xfer += oprot->writeStructBegin("Argument");
- xfer += oprot->writeFieldBegin("key", apache::thrift::protocol::T_I16, 1);
- xfer += oprot->writeI16(this->key);
- xfer += oprot->writeFieldEnd();
- xfer += oprot->writeFieldBegin("name", apache::thrift::protocol::T_STRING, 2);
- xfer += oprot->writeString(this->name);
- xfer += oprot->writeFieldEnd();
- xfer += oprot->writeFieldBegin("type", apache::thrift::protocol::T_STRUCT, 3);
- xfer += this->type.write(oprot);
- xfer += oprot->writeFieldEnd();
- xfer += oprot->writeFieldStop();
- xfer += oprot->writeStructEnd();
- return xfer;
-}
-
-const char* Method::ascii_fingerprint = "E6573428C492D24C84A19432D39A17B0";
-const uint8_t Method::binary_fingerprint[16] = {0xE6,0x57,0x34,0x28,0xC4,0x92,0xD2,0x4C,0x84,0xA1,0x94,0x32,0xD3,0x9A,0x17,0xB0};
-
-uint32_t Method::read(apache::thrift::protocol::TProtocol* iprot) {
-
- uint32_t xfer = 0;
- std::string fname;
- apache::thrift::protocol::TType ftype;
- int16_t fid;
-
- xfer += iprot->readStructBegin(fname);
-
- using apache::thrift::protocol::TProtocolException;
-
-
- while (true)
- {
- xfer += iprot->readFieldBegin(fname, ftype, fid);
- if (ftype == apache::thrift::protocol::T_STOP) {
- break;
- }
- switch (fid)
- {
- case 1:
- if (ftype == apache::thrift::protocol::T_STRING) {
- xfer += iprot->readString(this->name);
- this->__isset.name = true;
- } else {
- xfer += iprot->skip(ftype);
- }
- break;
- case 2:
- if (ftype == apache::thrift::protocol::T_STRUCT) {
- xfer += this->return_type.read(iprot);
- this->__isset.return_type = true;
- } else {
- xfer += iprot->skip(ftype);
- }
- break;
- case 3:
- if (ftype == apache::thrift::protocol::T_LIST) {
- {
- this->arguments.clear();
- uint32_t _size2;
- apache::thrift::protocol::TType _etype5;
- iprot->readListBegin(_etype5, _size2);
- this->arguments.resize(_size2);
- uint32_t _i6;
- for (_i6 = 0; _i6 < _size2; ++_i6)
- {
- xfer += this->arguments[_i6].read(iprot);
- }
- iprot->readListEnd();
- }
- this->__isset.arguments = true;
- } else {
- xfer += iprot->skip(ftype);
- }
- break;
- default:
- xfer += iprot->skip(ftype);
- break;
- }
- xfer += iprot->readFieldEnd();
- }
-
- xfer += iprot->readStructEnd();
-
- return xfer;
-}
-
-uint32_t Method::write(apache::thrift::protocol::TProtocol* oprot) const {
- uint32_t xfer = 0;
- xfer += oprot->writeStructBegin("Method");
- xfer += oprot->writeFieldBegin("name", apache::thrift::protocol::T_STRING, 1);
- xfer += oprot->writeString(this->name);
- xfer += oprot->writeFieldEnd();
- xfer += oprot->writeFieldBegin("return_type", apache::thrift::protocol::T_STRUCT, 2);
- xfer += this->return_type.write(oprot);
- xfer += oprot->writeFieldEnd();
- xfer += oprot->writeFieldBegin("arguments", apache::thrift::protocol::T_LIST, 3);
- {
- xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRUCT, this->arguments.size());
- std::vector<Argument> ::const_iterator _iter7;
- for (_iter7 = this->arguments.begin(); _iter7 != this->arguments.end(); ++_iter7)
- {
- xfer += (*_iter7).write(oprot);
- }
- xfer += oprot->writeListEnd();
- }
- xfer += oprot->writeFieldEnd();
- xfer += oprot->writeFieldStop();
- xfer += oprot->writeStructEnd();
- return xfer;
-}
-
-const char* Service::ascii_fingerprint = "4673B0777B701D9B02A7A74CEC7908A7";
-const uint8_t Service::binary_fingerprint[16] = {0x46,0x73,0xB0,0x77,0x7B,0x70,0x1D,0x9B,0x02,0xA7,0xA7,0x4C,0xEC,0x79,0x08,0xA7};
-
-uint32_t Service::read(apache::thrift::protocol::TProtocol* iprot) {
-
- uint32_t xfer = 0;
- std::string fname;
- apache::thrift::protocol::TType ftype;
- int16_t fid;
-
- xfer += iprot->readStructBegin(fname);
-
- using apache::thrift::protocol::TProtocolException;
-
-
- while (true)
- {
- xfer += iprot->readFieldBegin(fname, ftype, fid);
- if (ftype == apache::thrift::protocol::T_STOP) {
- break;
- }
- switch (fid)
- {
- case 1:
- if (ftype == apache::thrift::protocol::T_STRING) {
- xfer += iprot->readString(this->name);
- this->__isset.name = true;
- } else {
- xfer += iprot->skip(ftype);
- }
- break;
- case 2:
- if (ftype == apache::thrift::protocol::T_LIST) {
- {
- this->methods.clear();
- uint32_t _size8;
- apache::thrift::protocol::TType _etype11;
- iprot->readListBegin(_etype11, _size8);
- this->methods.resize(_size8);
- uint32_t _i12;
- for (_i12 = 0; _i12 < _size8; ++_i12)
- {
- xfer += this->methods[_i12].read(iprot);
- }
- iprot->readListEnd();
- }
- this->__isset.methods = true;
- } else {
- xfer += iprot->skip(ftype);
- }
- break;
- case 3:
- if (ftype == apache::thrift::protocol::T_BOOL) {
- xfer += iprot->readBool(this->fully_reflected);
- this->__isset.fully_reflected = true;
- } else {
- xfer += iprot->skip(ftype);
- }
- break;
- default:
- xfer += iprot->skip(ftype);
- break;
- }
- xfer += iprot->readFieldEnd();
- }
-
- xfer += iprot->readStructEnd();
-
- return xfer;
-}
-
-uint32_t Service::write(apache::thrift::protocol::TProtocol* oprot) const {
- uint32_t xfer = 0;
- xfer += oprot->writeStructBegin("Service");
- xfer += oprot->writeFieldBegin("name", apache::thrift::protocol::T_STRING, 1);
- xfer += oprot->writeString(this->name);
- xfer += oprot->writeFieldEnd();
- xfer += oprot->writeFieldBegin("methods", apache::thrift::protocol::T_LIST, 2);
- {
- xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRUCT, this->methods.size());
- std::vector<Method> ::const_iterator _iter13;
- for (_iter13 = this->methods.begin(); _iter13 != this->methods.end(); ++_iter13)
- {
- xfer += (*_iter13).write(oprot);
- }
- xfer += oprot->writeListEnd();
- }
- xfer += oprot->writeFieldEnd();
- xfer += oprot->writeFieldBegin("fully_reflected", apache::thrift::protocol::T_BOOL, 3);
- xfer += oprot->writeBool(this->fully_reflected);
- xfer += oprot->writeFieldEnd();
- xfer += oprot->writeFieldStop();
- xfer += oprot->writeStructEnd();
- return xfer;
-}
-
-}}}} // namespace
+++ /dev/null
-/**
- * Autogenerated by Thrift
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- */
-#ifndef reflection_limited_TYPES_H
-#define reflection_limited_TYPES_H
-
-#include <Thrift.h>
-#include <reflection_limited_types.h>
-#include <protocol/TProtocol.h>
-#include <transport/TTransport.h>
-
-
-
-namespace apache { namespace thrift { namespace reflection { namespace limited {
-
-enum TTypeTag {
- T_VOID = 1,
- T_BOOL = 2,
- T_BYTE = 3,
- T_I16 = 6,
- T_I32 = 8,
- T_I64 = 10,
- T_DOUBLE = 4,
- T_STRING = 11,
- T_STRUCT = 12,
- T_MAP = 13,
- T_SET = 14,
- T_LIST = 15,
- T_ENUM = 101,
- T_NOT_REFLECTED = 102
-};
-
-class SimpleType {
- public:
-
- static const char* ascii_fingerprint; // = "19B5240589E680301A7E32DF3971EFBE";
- static const uint8_t binary_fingerprint[16]; // = {0x19,0xB5,0x24,0x05,0x89,0xE6,0x80,0x30,0x1A,0x7E,0x32,0xDF,0x39,0x71,0xEF,0xBE};
-
- SimpleType() : name("") {
- }
-
- virtual ~SimpleType() throw() {}
-
- TTypeTag ttype;
- std::string name;
-
- struct __isset {
- __isset() : ttype(false), name(false) {}
- bool ttype;
- bool name;
- } __isset;
-
- bool operator == (const SimpleType & rhs) const
- {
- if (!(ttype == rhs.ttype))
- return false;
- if (!(name == rhs.name))
- return false;
- return true;
- }
- bool operator != (const SimpleType &rhs) const {
- return !(*this == rhs);
- }
-
- bool operator < (const SimpleType & ) const;
-
- uint32_t read(apache::thrift::protocol::TProtocol* iprot);
- uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;
-
-};
-
-class ContainerType {
- public:
-
- static const char* ascii_fingerprint; // = "654FA6EFFF8242F4C2A604B970686634";
- static const uint8_t binary_fingerprint[16]; // = {0x65,0x4F,0xA6,0xEF,0xFF,0x82,0x42,0xF4,0xC2,0xA6,0x04,0xB9,0x70,0x68,0x66,0x34};
-
- ContainerType() {
- }
-
- virtual ~ContainerType() throw() {}
-
- TTypeTag ttype;
- SimpleType subtype1;
- SimpleType subtype2;
-
- struct __isset {
- __isset() : ttype(false), subtype1(false), subtype2(false) {}
- bool ttype;
- bool subtype1;
- bool subtype2;
- } __isset;
-
- bool operator == (const ContainerType & rhs) const
- {
- if (!(ttype == rhs.ttype))
- return false;
- if (!(subtype1 == rhs.subtype1))
- return false;
- if (__isset.subtype2 != rhs.__isset.subtype2)
- return false;
- else if (__isset.subtype2 && !(subtype2 == rhs.subtype2))
- return false;
- return true;
- }
- bool operator != (const ContainerType &rhs) const {
- return !(*this == rhs);
- }
-
- bool operator < (const ContainerType & ) const;
-
- uint32_t read(apache::thrift::protocol::TProtocol* iprot);
- uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;
-
-};
-
-class ThriftType {
- public:
-
- static const char* ascii_fingerprint; // = "76BC1CC759001D7D85FEE75C4F183062";
- static const uint8_t binary_fingerprint[16]; // = {0x76,0xBC,0x1C,0xC7,0x59,0x00,0x1D,0x7D,0x85,0xFE,0xE7,0x5C,0x4F,0x18,0x30,0x62};
-
- ThriftType() : is_container(0) {
- }
-
- virtual ~ThriftType() throw() {}
-
- bool is_container;
- SimpleType simple_type;
- ContainerType container_type;
-
- struct __isset {
- __isset() : is_container(false), simple_type(false), container_type(false) {}
- bool is_container;
- bool simple_type;
- bool container_type;
- } __isset;
-
- bool operator == (const ThriftType & rhs) const
- {
- if (!(is_container == rhs.is_container))
- return false;
- if (__isset.simple_type != rhs.__isset.simple_type)
- return false;
- else if (__isset.simple_type && !(simple_type == rhs.simple_type))
- return false;
- if (__isset.container_type != rhs.__isset.container_type)
- return false;
- else if (__isset.container_type && !(container_type == rhs.container_type))
- return false;
- return true;
- }
- bool operator != (const ThriftType &rhs) const {
- return !(*this == rhs);
- }
-
- bool operator < (const ThriftType & ) const;
-
- uint32_t read(apache::thrift::protocol::TProtocol* iprot);
- uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;
-
-};
-
-class Argument {
- public:
-
- static const char* ascii_fingerprint; // = "8C45506BE0EFBB22FB19FA40DDCECB3F";
- static const uint8_t binary_fingerprint[16]; // = {0x8C,0x45,0x50,0x6B,0xE0,0xEF,0xBB,0x22,0xFB,0x19,0xFA,0x40,0xDD,0xCE,0xCB,0x3F};
-
- Argument() : key(0), name("") {
- }
-
- virtual ~Argument() throw() {}
-
- int16_t key;
- std::string name;
- ThriftType type;
-
- struct __isset {
- __isset() : key(false), name(false), type(false) {}
- bool key;
- bool name;
- bool type;
- } __isset;
-
- bool operator == (const Argument & rhs) const
- {
- if (!(key == rhs.key))
- return false;
- if (!(name == rhs.name))
- return false;
- if (!(type == rhs.type))
- return false;
- return true;
- }
- bool operator != (const Argument &rhs) const {
- return !(*this == rhs);
- }
-
- bool operator < (const Argument & ) const;
-
- uint32_t read(apache::thrift::protocol::TProtocol* iprot);
- uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;
-
-};
-
-class Method {
- public:
-
- static const char* ascii_fingerprint; // = "E6573428C492D24C84A19432D39A17B0";
- static const uint8_t binary_fingerprint[16]; // = {0xE6,0x57,0x34,0x28,0xC4,0x92,0xD2,0x4C,0x84,0xA1,0x94,0x32,0xD3,0x9A,0x17,0xB0};
-
- Method() : name("") {
- }
-
- virtual ~Method() throw() {}
-
- std::string name;
- ThriftType return_type;
- std::vector<Argument> arguments;
-
- struct __isset {
- __isset() : name(false), return_type(false), arguments(false) {}
- bool name;
- bool return_type;
- bool arguments;
- } __isset;
-
- bool operator == (const Method & rhs) const
- {
- if (!(name == rhs.name))
- return false;
- if (!(return_type == rhs.return_type))
- return false;
- if (!(arguments == rhs.arguments))
- return false;
- return true;
- }
- bool operator != (const Method &rhs) const {
- return !(*this == rhs);
- }
-
- bool operator < (const Method & ) const;
-
- uint32_t read(apache::thrift::protocol::TProtocol* iprot);
- uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;
-
-};
-
-class Service {
- public:
-
- static const char* ascii_fingerprint; // = "4673B0777B701D9B02A7A74CEC7908A7";
- static const uint8_t binary_fingerprint[16]; // = {0x46,0x73,0xB0,0x77,0x7B,0x70,0x1D,0x9B,0x02,0xA7,0xA7,0x4C,0xEC,0x79,0x08,0xA7};
-
- Service() : name(""), fully_reflected(0) {
- }
-
- virtual ~Service() throw() {}
-
- std::string name;
- std::vector<Method> methods;
- bool fully_reflected;
-
- struct __isset {
- __isset() : name(false), methods(false), fully_reflected(false) {}
- bool name;
- bool methods;
- bool fully_reflected;
- } __isset;
-
- bool operator == (const Service & rhs) const
- {
- if (!(name == rhs.name))
- return false;
- if (!(methods == rhs.methods))
- return false;
- if (!(fully_reflected == rhs.fully_reflected))
- return false;
- return true;
- }
- bool operator != (const Service &rhs) const {
- return !(*this == rhs);
- }
-
- bool operator < (const Service & ) const;
-
- uint32_t read(apache::thrift::protocol::TProtocol* iprot);
- uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;
-
-};
-
-}}}} // namespace
-
-#endif
+++ /dev/null
-/**
- * Autogenerated by Thrift
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- */
-package org.apache.thrift.reflection.limited;
-
-import java.util.ArrayList;
-import java.util.AbstractMap;
-import java.util.HashMap;
-import java.util.HashSet;
-import org.apache.thrift.*;
-
-import org.apache.thrift.protocol.*;
-import org.apache.thrift.transport.*;
-
-public class Argument implements java.io.Serializable {
- public short key;
- public String name;
- public ThriftType type;
-
- public final Isset __isset = new Isset();
- public static final class Isset {
- public boolean key = false;
- public boolean name = false;
- public boolean type = false;
- }
-
- public Argument() {
- }
-
- public Argument(
- short key,
- String name,
- ThriftType type)
- {
- this();
- this.key = key;
- this.__isset.key = true;
- this.name = name;
- this.__isset.name = true;
- this.type = type;
- this.__isset.type = true;
- }
-
- public void read(TProtocol iprot) throws TException {
- TField field;
- iprot.readStructBegin();
- while (true)
- {
- field = iprot.readFieldBegin();
- if (field.type == TType.STOP) {
- break;
- }
- switch (field.id)
- {
- case 1:
- if (field.type == TType.I16) {
- this.key = iprot.readI16();
- this.__isset.key = true;
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2:
- if (field.type == TType.STRING) {
- this.name = iprot.readString();
- this.__isset.name = true;
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 3:
- if (field.type == TType.STRUCT) {
- this.type = new ThriftType();
- this.type.read(iprot);
- this.__isset.type = true;
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- TProtocolUtil.skip(iprot, field.type);
- break;
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
- }
-
- public void write(TProtocol oprot) throws TException {
- TStruct struct = new TStruct("Argument");
- oprot.writeStructBegin(struct);
- TField field = new TField();
- field.name = "key";
- field.type = TType.I16;
- field.id = 1;
- oprot.writeFieldBegin(field);
- oprot.writeI16(this.key);
- oprot.writeFieldEnd();
- if (this.name != null) {
- field.name = "name";
- field.type = TType.STRING;
- field.id = 2;
- oprot.writeFieldBegin(field);
- oprot.writeString(this.name);
- oprot.writeFieldEnd();
- }
- if (this.type != null) {
- field.name = "type";
- field.type = TType.STRUCT;
- field.id = 3;
- oprot.writeFieldBegin(field);
- this.type.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- public String toString() {
- StringBuilder sb = new StringBuilder("Argument(");
- sb.append("key:");
- sb.append(this.key);
- sb.append(",name:");
- sb.append(this.name);
- sb.append(",type:");
- sb.append(this.type.toString());
- sb.append(")");
- return sb.toString();
- }
-
-}
-
+++ /dev/null
-/**
- * Autogenerated by Thrift
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- */
-package org.apache.thrift.reflection.limited;
-
-import java.util.ArrayList;
-import java.util.AbstractMap;
-import java.util.HashMap;
-import java.util.HashSet;
-import org.apache.thrift.*;
-
-public class Constants {
-
-}
+++ /dev/null
-/**
- * Autogenerated by Thrift
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- */
-package org.apache.thrift.reflection.limited;
-
-import java.util.ArrayList;
-import java.util.AbstractMap;
-import java.util.HashMap;
-import java.util.HashSet;
-import org.apache.thrift.*;
-
-import org.apache.thrift.protocol.*;
-import org.apache.thrift.transport.*;
-
-public class ContainerType implements java.io.Serializable {
- public int ttype;
- public SimpleType subtype1;
- public SimpleType subtype2;
-
- public final Isset __isset = new Isset();
- public static final class Isset {
- public boolean ttype = false;
- public boolean subtype1 = false;
- public boolean subtype2 = false;
- }
-
- public ContainerType() {
- }
-
- public ContainerType(
- int ttype,
- SimpleType subtype1,
- SimpleType subtype2)
- {
- this();
- this.ttype = ttype;
- this.__isset.ttype = true;
- this.subtype1 = subtype1;
- this.__isset.subtype1 = true;
- this.subtype2 = subtype2;
- this.__isset.subtype2 = true;
- }
-
- public void read(TProtocol iprot) throws TException {
- TField field;
- iprot.readStructBegin();
- while (true)
- {
- field = iprot.readFieldBegin();
- if (field.type == TType.STOP) {
- break;
- }
- switch (field.id)
- {
- case 1:
- if (field.type == TType.I32) {
- this.ttype = iprot.readI32();
- this.__isset.ttype = true;
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2:
- if (field.type == TType.STRUCT) {
- this.subtype1 = new SimpleType();
- this.subtype1.read(iprot);
- this.__isset.subtype1 = true;
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 3:
- if (field.type == TType.STRUCT) {
- this.subtype2 = new SimpleType();
- this.subtype2.read(iprot);
- this.__isset.subtype2 = true;
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- TProtocolUtil.skip(iprot, field.type);
- break;
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
- }
-
- public void write(TProtocol oprot) throws TException {
- TStruct struct = new TStruct("ContainerType");
- oprot.writeStructBegin(struct);
- TField field = new TField();
- field.name = "ttype";
- field.type = TType.I32;
- field.id = 1;
- oprot.writeFieldBegin(field);
- oprot.writeI32(this.ttype);
- oprot.writeFieldEnd();
- if (this.subtype1 != null) {
- field.name = "subtype1";
- field.type = TType.STRUCT;
- field.id = 2;
- oprot.writeFieldBegin(field);
- this.subtype1.write(oprot);
- oprot.writeFieldEnd();
- }
- if (this.subtype2 != null) {
- field.name = "subtype2";
- field.type = TType.STRUCT;
- field.id = 3;
- oprot.writeFieldBegin(field);
- this.subtype2.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- public String toString() {
- StringBuilder sb = new StringBuilder("ContainerType(");
- sb.append("ttype:");
- sb.append(this.ttype);
- sb.append(",subtype1:");
- sb.append(this.subtype1.toString());
- sb.append(",subtype2:");
- sb.append(this.subtype2.toString());
- sb.append(")");
- return sb.toString();
- }
-
-}
-
+++ /dev/null
-/**
- * Autogenerated by Thrift
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- */
-package org.apache.thrift.reflection.limited;
-
-import java.util.ArrayList;
-import java.util.AbstractMap;
-import java.util.HashMap;
-import java.util.HashSet;
-import org.apache.thrift.*;
-
-import org.apache.thrift.protocol.*;
-import org.apache.thrift.transport.*;
-
-public class Method implements java.io.Serializable {
- public String name;
- public ThriftType return_type;
- public ArrayList<Argument> arguments;
-
- public final Isset __isset = new Isset();
- public static final class Isset {
- public boolean name = false;
- public boolean return_type = false;
- public boolean arguments = false;
- }
-
- public Method() {
- }
-
- public Method(
- String name,
- ThriftType return_type,
- ArrayList<Argument> arguments)
- {
- this();
- this.name = name;
- this.__isset.name = true;
- this.return_type = return_type;
- this.__isset.return_type = true;
- this.arguments = arguments;
- this.__isset.arguments = true;
- }
-
- public void read(TProtocol iprot) throws TException {
- TField field;
- iprot.readStructBegin();
- while (true)
- {
- field = iprot.readFieldBegin();
- if (field.type == TType.STOP) {
- break;
- }
- switch (field.id)
- {
- case 1:
- if (field.type == TType.STRING) {
- this.name = iprot.readString();
- this.__isset.name = true;
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2:
- if (field.type == TType.STRUCT) {
- this.return_type = new ThriftType();
- this.return_type.read(iprot);
- this.__isset.return_type = true;
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 3:
- if (field.type == TType.LIST) {
- {
- TList _list0 = iprot.readListBegin();
- this.arguments = new ArrayList<Argument>(_list0.size);
- for (int _i1 = 0; _i1 < _list0.size; ++_i1)
- {
- Argument _elem2 = new Argument();
- _elem2 = new Argument();
- _elem2.read(iprot);
- this.arguments.add(_elem2);
- }
- iprot.readListEnd();
- }
- this.__isset.arguments = true;
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- TProtocolUtil.skip(iprot, field.type);
- break;
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
- }
-
- public void write(TProtocol oprot) throws TException {
- TStruct struct = new TStruct("Method");
- oprot.writeStructBegin(struct);
- TField field = new TField();
- if (this.name != null) {
- field.name = "name";
- field.type = TType.STRING;
- field.id = 1;
- oprot.writeFieldBegin(field);
- oprot.writeString(this.name);
- oprot.writeFieldEnd();
- }
- if (this.return_type != null) {
- field.name = "return_type";
- field.type = TType.STRUCT;
- field.id = 2;
- oprot.writeFieldBegin(field);
- this.return_type.write(oprot);
- oprot.writeFieldEnd();
- }
- if (this.arguments != null) {
- field.name = "arguments";
- field.type = TType.LIST;
- field.id = 3;
- oprot.writeFieldBegin(field);
- {
- oprot.writeListBegin(new TList(TType.STRUCT, this.arguments.size()));
- for (Argument _iter3 : this.arguments) {
- _iter3.write(oprot);
- oprot.writeListEnd();
- }
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- public String toString() {
- StringBuilder sb = new StringBuilder("Method(");
- sb.append("name:");
- sb.append(this.name);
- sb.append(",return_type:");
- sb.append(this.return_type.toString());
- sb.append(",arguments:");
- sb.append(this.arguments);
- sb.append(")");
- return sb.toString();
- }
-
-}
-
+++ /dev/null
-/**
- * Autogenerated by Thrift
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- */
-package org.apache.thrift.reflection.limited;
-
-import java.util.ArrayList;
-import java.util.AbstractMap;
-import java.util.HashMap;
-import java.util.HashSet;
-import org.apache.thrift.*;
-
-import org.apache.thrift.protocol.*;
-import org.apache.thrift.transport.*;
-
-public class Service implements java.io.Serializable {
- public String name;
- public ArrayList<Method> methods;
- public boolean fully_reflected;
-
- public final Isset __isset = new Isset();
- public static final class Isset {
- public boolean name = false;
- public boolean methods = false;
- public boolean fully_reflected = false;
- }
-
- public Service() {
- }
-
- public Service(
- String name,
- ArrayList<Method> methods,
- boolean fully_reflected)
- {
- this();
- this.name = name;
- this.__isset.name = true;
- this.methods = methods;
- this.__isset.methods = true;
- this.fully_reflected = fully_reflected;
- this.__isset.fully_reflected = true;
- }
-
- public void read(TProtocol iprot) throws TException {
- TField field;
- iprot.readStructBegin();
- while (true)
- {
- field = iprot.readFieldBegin();
- if (field.type == TType.STOP) {
- break;
- }
- switch (field.id)
- {
- case 1:
- if (field.type == TType.STRING) {
- this.name = iprot.readString();
- this.__isset.name = true;
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2:
- if (field.type == TType.LIST) {
- {
- TList _list4 = iprot.readListBegin();
- this.methods = new ArrayList<Method>(_list4.size);
- for (int _i5 = 0; _i5 < _list4.size; ++_i5)
- {
- Method _elem6 = new Method();
- _elem6 = new Method();
- _elem6.read(iprot);
- this.methods.add(_elem6);
- }
- iprot.readListEnd();
- }
- this.__isset.methods = true;
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 3:
- if (field.type == TType.BOOL) {
- this.fully_reflected = iprot.readBool();
- this.__isset.fully_reflected = true;
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- TProtocolUtil.skip(iprot, field.type);
- break;
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
- }
-
- public void write(TProtocol oprot) throws TException {
- TStruct struct = new TStruct("Service");
- oprot.writeStructBegin(struct);
- TField field = new TField();
- if (this.name != null) {
- field.name = "name";
- field.type = TType.STRING;
- field.id = 1;
- oprot.writeFieldBegin(field);
- oprot.writeString(this.name);
- oprot.writeFieldEnd();
- }
- if (this.methods != null) {
- field.name = "methods";
- field.type = TType.LIST;
- field.id = 2;
- oprot.writeFieldBegin(field);
- {
- oprot.writeListBegin(new TList(TType.STRUCT, this.methods.size()));
- for (Method _iter7 : this.methods) {
- _iter7.write(oprot);
- oprot.writeListEnd();
- }
- }
- oprot.writeFieldEnd();
- }
- field.name = "fully_reflected";
- field.type = TType.BOOL;
- field.id = 3;
- oprot.writeFieldBegin(field);
- oprot.writeBool(this.fully_reflected);
- oprot.writeFieldEnd();
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- public String toString() {
- StringBuilder sb = new StringBuilder("Service(");
- sb.append("name:");
- sb.append(this.name);
- sb.append(",methods:");
- sb.append(this.methods);
- sb.append(",fully_reflected:");
- sb.append(this.fully_reflected);
- sb.append(")");
- return sb.toString();
- }
-
-}
-
+++ /dev/null
-/**
- * Autogenerated by Thrift
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- */
-package org.apache.thrift.reflection.limited;
-
-import java.util.ArrayList;
-import java.util.AbstractMap;
-import java.util.HashMap;
-import java.util.HashSet;
-import org.apache.thrift.*;
-
-import org.apache.thrift.protocol.*;
-import org.apache.thrift.transport.*;
-
-public class SimpleType implements java.io.Serializable {
- public int ttype;
- public String name;
-
- public final Isset __isset = new Isset();
- public static final class Isset {
- public boolean ttype = false;
- public boolean name = false;
- }
-
- public SimpleType() {
- }
-
- public SimpleType(
- int ttype,
- String name)
- {
- this();
- this.ttype = ttype;
- this.__isset.ttype = true;
- this.name = name;
- this.__isset.name = true;
- }
-
- public void read(TProtocol iprot) throws TException {
- TField field;
- iprot.readStructBegin();
- while (true)
- {
- field = iprot.readFieldBegin();
- if (field.type == TType.STOP) {
- break;
- }
- switch (field.id)
- {
- case 1:
- if (field.type == TType.I32) {
- this.ttype = iprot.readI32();
- this.__isset.ttype = true;
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2:
- if (field.type == TType.STRING) {
- this.name = iprot.readString();
- this.__isset.name = true;
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- TProtocolUtil.skip(iprot, field.type);
- break;
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
- }
-
- public void write(TProtocol oprot) throws TException {
- TStruct struct = new TStruct("SimpleType");
- oprot.writeStructBegin(struct);
- TField field = new TField();
- field.name = "ttype";
- field.type = TType.I32;
- field.id = 1;
- oprot.writeFieldBegin(field);
- oprot.writeI32(this.ttype);
- oprot.writeFieldEnd();
- if (this.name != null) {
- field.name = "name";
- field.type = TType.STRING;
- field.id = 2;
- oprot.writeFieldBegin(field);
- oprot.writeString(this.name);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- public String toString() {
- StringBuilder sb = new StringBuilder("SimpleType(");
- sb.append("ttype:");
- sb.append(this.ttype);
- sb.append(",name:");
- sb.append(this.name);
- sb.append(")");
- return sb.toString();
- }
-
-}
-
+++ /dev/null
-/**
- * Autogenerated by Thrift
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- */
-package org.apache.thrift.reflection.limited;
-
-
-public class TTypeTag {
- public static final int T_VOID = 1;
- public static final int T_BOOL = 2;
- public static final int T_BYTE = 3;
- public static final int T_I16 = 6;
- public static final int T_I32 = 8;
- public static final int T_I64 = 10;
- public static final int T_DOUBLE = 4;
- public static final int T_STRING = 11;
- public static final int T_STRUCT = 12;
- public static final int T_MAP = 13;
- public static final int T_SET = 14;
- public static final int T_LIST = 15;
- public static final int T_ENUM = 101;
- public static final int T_NOT_REFLECTED = 102;
-}
+++ /dev/null
-/**
- * Autogenerated by Thrift
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- */
-package org.apache.thrift.reflection.limited;
-
-import java.util.ArrayList;
-import java.util.AbstractMap;
-import java.util.HashMap;
-import java.util.HashSet;
-import org.apache.thrift.*;
-
-import org.apache.thrift.protocol.*;
-import org.apache.thrift.transport.*;
-
-public class ThriftType implements java.io.Serializable {
- public boolean is_container;
- public SimpleType simple_type;
- public ContainerType container_type;
-
- public final Isset __isset = new Isset();
- public static final class Isset {
- public boolean is_container = false;
- public boolean simple_type = false;
- public boolean container_type = false;
- }
-
- public ThriftType() {
- }
-
- public ThriftType(
- boolean is_container,
- SimpleType simple_type,
- ContainerType container_type)
- {
- this();
- this.is_container = is_container;
- this.__isset.is_container = true;
- this.simple_type = simple_type;
- this.__isset.simple_type = true;
- this.container_type = container_type;
- this.__isset.container_type = true;
- }
-
- public void read(TProtocol iprot) throws TException {
- TField field;
- iprot.readStructBegin();
- while (true)
- {
- field = iprot.readFieldBegin();
- if (field.type == TType.STOP) {
- break;
- }
- switch (field.id)
- {
- case 1:
- if (field.type == TType.BOOL) {
- this.is_container = iprot.readBool();
- this.__isset.is_container = true;
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2:
- if (field.type == TType.STRUCT) {
- this.simple_type = new SimpleType();
- this.simple_type.read(iprot);
- this.__isset.simple_type = true;
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 3:
- if (field.type == TType.STRUCT) {
- this.container_type = new ContainerType();
- this.container_type.read(iprot);
- this.__isset.container_type = true;
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- TProtocolUtil.skip(iprot, field.type);
- break;
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
- }
-
- public void write(TProtocol oprot) throws TException {
- TStruct struct = new TStruct("ThriftType");
- oprot.writeStructBegin(struct);
- TField field = new TField();
- field.name = "is_container";
- field.type = TType.BOOL;
- field.id = 1;
- oprot.writeFieldBegin(field);
- oprot.writeBool(this.is_container);
- oprot.writeFieldEnd();
- if (this.simple_type != null) {
- field.name = "simple_type";
- field.type = TType.STRUCT;
- field.id = 2;
- oprot.writeFieldBegin(field);
- this.simple_type.write(oprot);
- oprot.writeFieldEnd();
- }
- if (this.container_type != null) {
- field.name = "container_type";
- field.type = TType.STRUCT;
- field.id = 3;
- oprot.writeFieldBegin(field);
- this.container_type.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- public String toString() {
- StringBuilder sb = new StringBuilder("ThriftType(");
- sb.append("is_container:");
- sb.append(this.is_container);
- sb.append(",simple_type:");
- sb.append(this.simple_type.toString());
- sb.append(",container_type:");
- sb.append(this.container_type.toString());
- sb.append(")");
- return sb.toString();
- }
-
-}
-
'thrift.protocol',
'thrift.transport',
'thrift.server',
- 'thrift.reflection',
- 'thrift.reflection.limited',
],
package_dir = {'thrift' : 'src'},
ext_modules = [fastbinarymod],
+++ /dev/null
-__all__ = ['ttypes', 'constants']
+++ /dev/null
-#
-# Autogenerated by Thrift
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-
-from thrift.Thrift import *
-from ttypes import *
-
+++ /dev/null
-#
-# Autogenerated by Thrift
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-
-from thrift.Thrift import *
-
-from thrift.transport import TTransport
-from thrift.protocol import TBinaryProtocol
-try:
- from thrift.protocol import fastbinary
-except:
- fastbinary = None
-
-
-class TTypeTag:
- T_VOID = 1
- T_BOOL = 2
- T_BYTE = 3
- T_I16 = 6
- T_I32 = 8
- T_I64 = 10
- T_DOUBLE = 4
- T_STRING = 11
- T_STRUCT = 12
- T_MAP = 13
- T_SET = 14
- T_LIST = 15
- T_ENUM = 101
- T_NOT_REFLECTED = 102
-
-class SimpleType:
-
- thrift_spec = (
- None, # 0
- (1, TType.I32, 'ttype', None, None, ), # 1
- (2, TType.STRING, 'name', None, None, ), # 2
- )
-
- def __init__(self, d=None):
- self.ttype = None
- self.name = None
- if isinstance(d, dict):
- if 'ttype' in d:
- self.ttype = d['ttype']
- if 'name' in d:
- self.name = d['name']
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return
- iprot.readStructBegin()
- while True:
- (fname, ftype, fid) = iprot.readFieldBegin()
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.I32:
- self.ttype = iprot.readI32();
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.STRING:
- self.name = iprot.readString();
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- iprot.readFieldEnd()
- iprot.readStructEnd()
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return
- oprot.writeStructBegin('SimpleType')
- if self.ttype != None:
- oprot.writeFieldBegin('ttype', TType.I32, 1)
- oprot.writeI32(self.ttype)
- oprot.writeFieldEnd()
- if self.name != None:
- oprot.writeFieldBegin('name', TType.STRING, 2)
- oprot.writeString(self.name)
- oprot.writeFieldEnd()
- oprot.writeFieldStop()
- oprot.writeStructEnd()
-
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class ContainerType:
-
- thrift_spec = (
- None, # 0
- (1, TType.I32, 'ttype', None, None, ), # 1
- (2, TType.STRUCT, 'subtype1', (SimpleType, SimpleType.thrift_spec), None, ), # 2
- (3, TType.STRUCT, 'subtype2', (SimpleType, SimpleType.thrift_spec), None, ), # 3
- )
-
- def __init__(self, d=None):
- self.ttype = None
- self.subtype1 = None
- self.subtype2 = None
- if isinstance(d, dict):
- if 'ttype' in d:
- self.ttype = d['ttype']
- if 'subtype1' in d:
- self.subtype1 = d['subtype1']
- if 'subtype2' in d:
- self.subtype2 = d['subtype2']
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return
- iprot.readStructBegin()
- while True:
- (fname, ftype, fid) = iprot.readFieldBegin()
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.I32:
- self.ttype = iprot.readI32();
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.STRUCT:
- self.subtype1 = SimpleType()
- self.subtype1.read(iprot)
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.STRUCT:
- self.subtype2 = SimpleType()
- self.subtype2.read(iprot)
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- iprot.readFieldEnd()
- iprot.readStructEnd()
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return
- oprot.writeStructBegin('ContainerType')
- if self.ttype != None:
- oprot.writeFieldBegin('ttype', TType.I32, 1)
- oprot.writeI32(self.ttype)
- oprot.writeFieldEnd()
- if self.subtype1 != None:
- oprot.writeFieldBegin('subtype1', TType.STRUCT, 2)
- self.subtype1.write(oprot)
- oprot.writeFieldEnd()
- if self.subtype2 != None:
- oprot.writeFieldBegin('subtype2', TType.STRUCT, 3)
- self.subtype2.write(oprot)
- oprot.writeFieldEnd()
- oprot.writeFieldStop()
- oprot.writeStructEnd()
-
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class ThriftType:
-
- thrift_spec = (
- None, # 0
- (1, TType.BOOL, 'is_container', None, None, ), # 1
- (2, TType.STRUCT, 'simple_type', (SimpleType, SimpleType.thrift_spec), None, ), # 2
- (3, TType.STRUCT, 'container_type', (ContainerType, ContainerType.thrift_spec), None, ), # 3
- )
-
- def __init__(self, d=None):
- self.is_container = None
- self.simple_type = None
- self.container_type = None
- if isinstance(d, dict):
- if 'is_container' in d:
- self.is_container = d['is_container']
- if 'simple_type' in d:
- self.simple_type = d['simple_type']
- if 'container_type' in d:
- self.container_type = d['container_type']
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return
- iprot.readStructBegin()
- while True:
- (fname, ftype, fid) = iprot.readFieldBegin()
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.BOOL:
- self.is_container = iprot.readBool();
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.STRUCT:
- self.simple_type = SimpleType()
- self.simple_type.read(iprot)
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.STRUCT:
- self.container_type = ContainerType()
- self.container_type.read(iprot)
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- iprot.readFieldEnd()
- iprot.readStructEnd()
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return
- oprot.writeStructBegin('ThriftType')
- if self.is_container != None:
- oprot.writeFieldBegin('is_container', TType.BOOL, 1)
- oprot.writeBool(self.is_container)
- oprot.writeFieldEnd()
- if self.simple_type != None:
- oprot.writeFieldBegin('simple_type', TType.STRUCT, 2)
- self.simple_type.write(oprot)
- oprot.writeFieldEnd()
- if self.container_type != None:
- oprot.writeFieldBegin('container_type', TType.STRUCT, 3)
- self.container_type.write(oprot)
- oprot.writeFieldEnd()
- oprot.writeFieldStop()
- oprot.writeStructEnd()
-
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class Argument:
-
- thrift_spec = (
- None, # 0
- (1, TType.I16, 'key', None, None, ), # 1
- (2, TType.STRING, 'name', None, None, ), # 2
- (3, TType.STRUCT, 'type', (ThriftType, ThriftType.thrift_spec), None, ), # 3
- )
-
- def __init__(self, d=None):
- self.key = None
- self.name = None
- self.type = None
- if isinstance(d, dict):
- if 'key' in d:
- self.key = d['key']
- if 'name' in d:
- self.name = d['name']
- if 'type' in d:
- self.type = d['type']
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return
- iprot.readStructBegin()
- while True:
- (fname, ftype, fid) = iprot.readFieldBegin()
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.I16:
- self.key = iprot.readI16();
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.STRING:
- self.name = iprot.readString();
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.STRUCT:
- self.type = ThriftType()
- self.type.read(iprot)
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- iprot.readFieldEnd()
- iprot.readStructEnd()
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return
- oprot.writeStructBegin('Argument')
- if self.key != None:
- oprot.writeFieldBegin('key', TType.I16, 1)
- oprot.writeI16(self.key)
- oprot.writeFieldEnd()
- if self.name != None:
- oprot.writeFieldBegin('name', TType.STRING, 2)
- oprot.writeString(self.name)
- oprot.writeFieldEnd()
- if self.type != None:
- oprot.writeFieldBegin('type', TType.STRUCT, 3)
- self.type.write(oprot)
- oprot.writeFieldEnd()
- oprot.writeFieldStop()
- oprot.writeStructEnd()
-
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class Method:
-
- thrift_spec = (
- None, # 0
- (1, TType.STRING, 'name', None, None, ), # 1
- (2, TType.STRUCT, 'return_type', (ThriftType, ThriftType.thrift_spec), None, ), # 2
- (3, TType.LIST, 'arguments', (TType.STRUCT,(Argument, Argument.thrift_spec)), None, ), # 3
- )
-
- def __init__(self, d=None):
- self.name = None
- self.return_type = None
- self.arguments = None
- if isinstance(d, dict):
- if 'name' in d:
- self.name = d['name']
- if 'return_type' in d:
- self.return_type = d['return_type']
- if 'arguments' in d:
- self.arguments = d['arguments']
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return
- iprot.readStructBegin()
- while True:
- (fname, ftype, fid) = iprot.readFieldBegin()
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- self.name = iprot.readString();
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.STRUCT:
- self.return_type = ThriftType()
- self.return_type.read(iprot)
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.LIST:
- self.arguments = []
- (_etype3, _size0) = iprot.readListBegin()
- for _i4 in xrange(_size0):
- _elem5 = Argument()
- _elem5.read(iprot)
- self.arguments.append(_elem5)
- iprot.readListEnd()
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- iprot.readFieldEnd()
- iprot.readStructEnd()
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return
- oprot.writeStructBegin('Method')
- if self.name != None:
- oprot.writeFieldBegin('name', TType.STRING, 1)
- oprot.writeString(self.name)
- oprot.writeFieldEnd()
- if self.return_type != None:
- oprot.writeFieldBegin('return_type', TType.STRUCT, 2)
- self.return_type.write(oprot)
- oprot.writeFieldEnd()
- if self.arguments != None:
- oprot.writeFieldBegin('arguments', TType.LIST, 3)
- oprot.writeListBegin(TType.STRUCT, len(self.arguments))
- for iter6 in self.arguments:
- iter6.write(oprot)
- oprot.writeListEnd()
- oprot.writeFieldEnd()
- oprot.writeFieldStop()
- oprot.writeStructEnd()
-
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class Service:
-
- thrift_spec = (
- None, # 0
- (1, TType.STRING, 'name', None, None, ), # 1
- (2, TType.LIST, 'methods', (TType.STRUCT,(Method, Method.thrift_spec)), None, ), # 2
- (3, TType.BOOL, 'fully_reflected', None, None, ), # 3
- )
-
- def __init__(self, d=None):
- self.name = None
- self.methods = None
- self.fully_reflected = None
- if isinstance(d, dict):
- if 'name' in d:
- self.name = d['name']
- if 'methods' in d:
- self.methods = d['methods']
- if 'fully_reflected' in d:
- self.fully_reflected = d['fully_reflected']
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return
- iprot.readStructBegin()
- while True:
- (fname, ftype, fid) = iprot.readFieldBegin()
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- self.name = iprot.readString();
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.LIST:
- self.methods = []
- (_etype10, _size7) = iprot.readListBegin()
- for _i11 in xrange(_size7):
- _elem12 = Method()
- _elem12.read(iprot)
- self.methods.append(_elem12)
- iprot.readListEnd()
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.BOOL:
- self.fully_reflected = iprot.readBool();
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- iprot.readFieldEnd()
- iprot.readStructEnd()
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return
- oprot.writeStructBegin('Service')
- if self.name != None:
- oprot.writeFieldBegin('name', TType.STRING, 1)
- oprot.writeString(self.name)
- oprot.writeFieldEnd()
- if self.methods != None:
- oprot.writeFieldBegin('methods', TType.LIST, 2)
- oprot.writeListBegin(TType.STRUCT, len(self.methods))
- for iter13 in self.methods:
- iter13.write(oprot)
- oprot.writeListEnd()
- oprot.writeFieldEnd()
- if self.fully_reflected != None:
- oprot.writeFieldBegin('fully_reflected', TType.BOOL, 3)
- oprot.writeBool(self.fully_reflected)
- oprot.writeFieldEnd()
- oprot.writeFieldStop()
- oprot.writeStructEnd()
-
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
i32 Janky(i32 arg)
}
-service PartiallyReflectable {
- map<i32,map<i32,i32>> returnNotReflectable(1: i32 hello),
- void argNotReflectable(1: list<set<i32>> arg),
- void arg2NotReflectable(1: i32 arg1, 2: list<set<i32>> argNotReflectable),
- void withMap(1: map<i32, string> amap),
-
- OneOfEach refl1(1: list<Bonk> arg1),
- OneOfEach refl2(2: list<string> arg1, 1: Bonk arg2);
-}
-
// The only purpose of this thing is to increase the size of the generated code
// so that ZlibTest has more highly compressible data to play with.
struct BlowUp {
service Srv {
i32 Janky(i32 arg)
}
-
-service PartiallyReflectable {
- map<i32,map<i32,i32>> returnNotReflectable(1: i32 hello),
- void argNotReflectable(1: list<set<i32>> arg),
- void arg2NotReflectable(1: i32 arg1, 2: list<set<i32>> argNotReflectable),
- void withMap(1: map<i32, string> amap),
-
- OneOfEachZZ refl1(1: list<BonkZZ> arg1),
- OneOfEachZZ refl2(2: list<string> arg1, 1: BonkZZ arg2);
-}
gen-cpp/DebugProtoTest_types.cpp \
gen-cpp/OptionalRequiredTest_types.cpp \
gen-cpp/DebugProtoTest_types.cpp \
- gen-cpp/PartiallyReflectable.cpp \
gen-cpp/Service.cpp \
gen-cpp/StressTest_types.cpp \
gen-cpp/SecondService.cpp \
DebugProtoTest \
JSONProtoTest \
OptionalRequiredTest \
- ReflectionTest \
UnitTests
TESTS = \
OptionalRequiredTest_LDADD = libtestgencpp.la
-#
-# ReflectionTest
-#
-ReflectionTest_SOURCES = \
- ReflectionTest.cpp
-
-ReflectionTest_LDADD = libtestgencpp.la
-
#
# Common thrift code generation rules
#
THRIFT = $(top_builddir)/compiler/cpp/thrift
-gen-cpp/DebugProtoTest_types.cpp gen-cpp/PartiallyReflectable.cpp: DebugProtoTest.thrift
- $(THRIFT) --gen cpp:dense,reflection_limited $<
+gen-cpp/DebugProtoTest_types.cpp: DebugProtoTest.thrift
+ $(THRIFT) --gen cpp:dense $<
gen-cpp/OptionalRequiredTest_types.cpp: OptionalRequiredTest.thrift
$(THRIFT) --gen cpp:dense $<
gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp: StressTest.thrift
- $(THRIFT) --gen cpp:dense,reflection_limited $<
+ $(THRIFT) --gen cpp:dense $<
gen-cpp/SecondService.cpp gen-cpp/ThriftTest_constants.cpp gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest_types.cpp: ThriftTest.thrift
- $(THRIFT) --gen cpp:dense,reflection_limited $<
+ $(THRIFT) --gen cpp:dense $<
INCLUDES = \
-I$(top_srcdir)/lib/cpp/src
+++ /dev/null
-#include <iostream>
-#include "gen-cpp/PartiallyReflectable.h"
-#include "gen-cpp/Service.h"
-#include "../lib/cpp/src/protocol/TDebugProtocol.h"
-
-int main() {
- using std::cout;
- using std::endl;
-
- apache::thrift::reflection::limited::Service srv1;
- thrift::test::debug::PartiallyReflectableIf::getStaticLimitedReflection(srv1);
- cout << apache::thrift::ThriftDebugString(srv1) << endl << endl;
-
- apache::thrift::reflection::limited::Service srv2;
- test::stress::ServiceIf::getStaticLimitedReflection(srv2);
- cout << apache::thrift::ThriftDebugString(srv2) << endl << endl;
-
- return 0;
-}