Summary:
The Thrift compiler now generates static methods for every service to generate
a reflection of the methods provided by the service. This reflection is fairly
limited, but should be enough for what we want to do with SMC.
Reviewed By: mcslee
Test Plan: test/ReflectionTest.cpp
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665226 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Merging a patch from Ben Maurer.
This adds a python extension (i.e., a C module) that
encodes Python thrift structs into the standard binary protocol
much faster than our generated Python code.
Also added by-value equality comparison to thrift structs
(to help with testing).
Cleaned up some trailing whitespace too.
Reviewed By: mcslee, dreiss
Test Plan:
Recompiled Thrift.
Thrifted a bunch of IDLs and compared the generated Python output.
Looked at the extension module a lot.
test/FastBinaryTest.py
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665224 13f79535-47bb-0310-9956-ffa450edef68
Summary:
We added a helper function for the generators: get_true_type,
which finds the actual type behind a series of typedefs
(though the compiler only supports one layer of typedefs now).
This change uses it everywhere we used to have that loop.
(It was a lot of places.)
Reviewed By: mcslee
Test Plan: test/ManyTypedefs.thrift
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665220 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Add a function to t_generator to traverse the typedef chain.
Reviewed By: mcslee
Test Plan:
Rebuilt thrift.
Re-thrifted ThriftTest.thrift.
Saw that the output was unchanged.
Revert Plan: ok
Notes:
Converting all of the generators to use this will happen later.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665203 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Merging a patch from Andy Lutomirsky.
- Allow fields to be marked "required" or "optional" (only affects C++).
- Thrift structs now have operator ==.
Reviewed By: mcslee
Test Plan: test/OptionalRequiredTest.cpp
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665202 13f79535-47bb-0310-9956-ffa450edef68
Summary:
It was a bad idea to let doxygen comments become a part of the parse tree.
We now get them a totally different way. The lexer stashes the docsting
contents in a global, and the parser actions (not the rules) pull it out.
This should prevent doxygen comments from ever causing parse errors.
Blame Rev: 52678, 52732
Reviewed By: mcslee
Test Plan:
Recompiled thrift.
Thrifted a bunch of files and saw no parse errors (or C++ compile errors).
Thrifted DocTest.thrift with dump_docs on.
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665201 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Allow constants to be documented.
Now any "Definition" can be documented, so we can move the docstring stuff
up to a a higher node in the parse tree.
Reviewed By: mcslee
Test Plan:
Recompiled thrift.
Checked out DocTest.thrift and a few other thrifts.
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665200 13f79535-47bb-0310-9956-ffa450edef68
Summary: Because we're all about strict aliasing rules in the g++, m'holmbie.
Reviewed By: aditya
Test Plan: Should be NO compiler warnings about (enum&) -> (int32_t&) typecasting
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665196 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Make enum constants as structure defaults work.
Make enum constants as constant map keys work.
Un-break the generated skeleton servers.
Reviewed By: mcslee
Test Plan:
cd test
../compiler/cpp/thrift -cpp ConstantsDemo.thrift
g++ -I../lib/cpp/src -c gen-cpp/*.cpp
Also compared the generated output to the old generated output.
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665193 13f79535-47bb-0310-9956-ffa450edef68
Summary:
* custom, extensible error logger -- show only relevant stuff
* clean up of errors in developer-supplied handler module
now gives sane error messages and doesn't crash whole server
(introduces tApplicationException_HANDLER_ERROR)
* more precise catch in tErlProcessor (exits gracefully only if
transport closes)
Reviewed By: iproctor
Test Plan: tutorial works
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665186 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Allow docstrings at the top of the program.
Blame Rev: 52687
Reviewed By: mcslee
Test Plan:
../compiler/cpp/thrift -cpp DocTest.thrift
(with dump_docs on)
and looked at the output.
Generated C++ is identical to installed thrift.
Revert Plan: Do 52687 also.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665183 13f79535-47bb-0310-9956-ffa450edef68
Summary:
The old docstring syntax collided with the syntax for list constants.
The new syntax looks a lot like doxygent comments.
Trac Bug: #4664
Blame Rev: 32392
Reviewed By: mcslee
Test Plan:
../compiler/cpp/thrift -cpp DocTest.thrift
(with dump_docs on)
and looked at the output.
Generated C++ is identical to installed thrift.
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665182 13f79535-47bb-0310-9956-ffa450edef68
Summary: So for example, you can make a constant map of enum values to string identifiers.
Reviewed By: dreiss
Test Plan: ConstantsDemo.thrift in the test folder
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665181 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Catch an exception that was being thrown,
and print out the error message.
Trac Bug: #
Blame Rev:
Reviewed By: mcslee
Test Plan:
Recompiled Thrift.
Ran it on a broken .thrift that throws one of these exceptions.
Revert Plan: ok
Notes:
EImportant:
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665177 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Replaced a lot of tabs with spaces in the thrift codebase.
Removed a lot of trailing whitespace from thrift-generated c++.
Added a few things to cleanup.sh.
Trac Bug: #
Blame Rev:
Reviewed By: mcslee
Test Plan:
Recompiled thrift.
Re-thrifted some test .thrifts.
Compiled the genrated c++.
Ran cleanup.sh.
Revert Plan: ok
Notes:
EImportant:
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665176 13f79535-47bb-0310-9956-ffa450edef68
Summary: It's thrift for haskell. The codegen is complete. The library has binary protocol, io channel transport, and a threaded server.
Reviewed by: mcslee
Test plan: Yes
Revert plan: yes
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665174 13f79535-47bb-0310-9956-ffa450edef68
Summary: Generated ruby code did not give exception struct fields a class. This broke the result structs for all functions that threw exceptions.
Reviewed by: mcslee
Test plan: Yes
Revert plan: yes
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665173 13f79535-47bb-0310-9956-ffa450edef68
Summary: stop generating files/modules in titlecase
Notes: somehow we access service_name_ before the constructor downcases it ... burnsauce
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665170 13f79535-47bb-0310-9956-ffa450edef68
Summary:
* const/enum namespacing
* better formatting, less debugging comments in both source and gen-erl/
Notes:
* in preparation for iproctor's whiz-bang map/list/set support
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665169 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Someone forgot an indent after a newline. Added.
Trac Bug: #
Blame Rev:
Reviewed By: mcslee
Test Plan:
Compiled the compiler, compiled a .thrift, and compared the output
with diff -u and diff -w -u.
Revert Plan: svn revert
Notes:
EImportant:
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665165 13f79535-47bb-0310-9956-ffa450edef68
Summary:
* shim to use object-oriented code as gen_servers
* high(er) performance Erlang-style server and transport
* sane packaging based on otp-base, i.e. Makefiles and real structure
Test Plan: tutorial server offers the same (subset of) functionality as previous version
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665164 13f79535-47bb-0310-9956-ffa450edef68
Summary: Added (minimal) library and code generator for OCaml.
Reviewed by: mcslee
Test plan: Test client and server (included).
Revert plan: yes
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665163 13f79535-47bb-0310-9956-ffa450edef68
Summary: Submitted by Kevin Clark, Ruby guru from Powerset
Reviewed By: mcslee
Test Plan: He updated the tests in trunk/test/rb/
Notes: The code is now officially "ruby-ish" and idiomatic
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665151 13f79535-47bb-0310-9956-ffa450edef68
Summary:
* missing {list,map,set}s, inheritance is spotty
* loose source code, plus everything is one process (application / gen_server behavior is forthcoming)
* codegen is a mess, need t_fp_generator
Test Plan:
* codegen invoked without -erl generates identical code for test/
* calculatorHandler plus 'thrift -erl -r tutorial.thrift' more or less works
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665146 13f79535-47bb-0310-9956-ffa450edef68
Summary: Identical to string in all languages except Java. Java String is NOT binary-safe, so we need to use raw byte[] in that case. PHP/RUBY/Python strings are all binary safe, and C++ std::string works fine and manages memory for you so it's the safest route. Java just needs this tweak.
Reviewed By: aditya
Test Plan: Use "binary" as a type instead of String.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665099 13f79535-47bb-0310-9956-ffa450edef68
Summary:
The php recv functions for method invocations didn't pass a proper input object into the handler for reading an application exception. This caused graceful thrift failures to not work gracefully in PHP.
Reviewed By: Slee
Test Plan: Tested by invoking from a thrift client a function not defined on a thrift server. Should response with Invalid method name
Revert Plan: revertible
Notes:
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665061 13f79535-47bb-0310-9956-ffa450edef68