Commit Graph

412 Commits

Author SHA1 Message Date
Mark Slee
dd43eb85c7 Fix Java generator for javabean target to construct maps and lists properly
Summary: From Johann Oskarsson

Reviewed By: dreiss

Test Plan: Generate javabean code


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665476 13f79535-47bb-0310-9956-ffa450edef68
2008-02-13 22:03:15 +00:00
iproctor
55aebc404b Thrift haskell getTransport working
Summary: getTransport is now a method of Protocol. To flush the transport one does tflush (getTransport p) instead of pflush p. This is more like how it is done with other languages.

Reviewed By: dcorson

Test Plan: Ran thrifttest for haskell.

Revert: OK

DiffCamp Revision: 7515


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665473 13f79535-47bb-0310-9956-ffa450edef68
2008-02-11 22:59:01 +00:00
David Reiss
407c9e7865 Thrift: Fix a bug with local reflection and namespaces.
Summary:
References to "local reflections" in other thrift files were not given
namespace prefixes, give undefined symbol errors.  This change
distinguishes between relfection names being generated for declarations
(not namespaced) and those that could be external references (namespaced).

Reviewed By: mcslee

Test Plan:
Got the following files to build and link correctly with -dense.

==> test1.thrift <==
cpp_namespace ns
enum foo { bar }

==> test2.thrift <==
include "test1.thrift"
enum dummy_enum_workaround { I_AM_A_WORKAROUND }
struct baz {
  1: test1.foo qux
}

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665472 13f79535-47bb-0310-9956-ffa450edef68
2008-02-09 02:51:43 +00:00
Mark Slee
6756f1351a Getters for input/output protocol in client lib
Summary: Why not, nice to have. From Ted Dziuba.

Reviewed By: dreiss

Test Plan: Build Java compiler.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665471 13f79535-47bb-0310-9956-ffa450edef68
2008-02-09 00:26:29 +00:00
Mark Slee
22360b2f30 Use interfaces, not classes for Java gen
Summary: Not AbstractMap or HashSet, etc. use Map, List, Set

Reviewed By: dreiss

Test Plan: Generate Java code and build java tests

Other Notes: Submitted by Seth Falcon


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665470 13f79535-47bb-0310-9956-ffa450edef68
2008-02-09 00:18:32 +00:00
Mark Slee
a8de4895f6 Patch from Ross McFarland to compile with strict warnings
Summary: Use comment trick in params that are unused to prevent warnings

Reviewed By: dreiss

Test Plan: Generate C++ code and compile -W -Wall


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665469 13f79535-47bb-0310-9956-ffa450edef68
2008-02-09 00:02:26 +00:00
David Reiss
3c5d2fd9a8 Thrift: Fix a bug in local reflection generation.
Summary:
The problem was that in generate_local_reflection, we refused to
generate reflections for types defined in another program, including enums.
But in local_reflection_name, we treated enums like base types,
assuming that their reflections were always defined in this program.
One solution would be to treat enums like base types everywhere, and always
generate their reflections in the program where they were being used.
But this change takes the opposite approach.  We now always
generate fingerprints for enums in the program in which they are defined,
even if they are not used there.

Reviewed By: mcslee

Test Plan:
Got the following files to build and link correctly with -dense.

dreiss@dreiss-vmware:reflection:thrift/test$ tail test[12].thrift
==> test1.thrift <==
enum foo { bar }

==> test2.thrift <==
include "test1.thrift"
struct baz {
  1: test1.foo qux
}

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665468 13f79535-47bb-0310-9956-ffa450edef68
2008-02-08 21:58:06 +00:00
David Reiss
0c90f6f8af Thrift: Whitespace cleanup.
Summary:
- Expanded tabs to spaces where spaces were the norm.
- Deleted almost all trailing whitespace.
- Added newlines to the ends of a few files.
- Ran dos2unix on one file or two.

Reviewed By: mcslee

Test Plan: git diff -b

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665467 13f79535-47bb-0310-9956-ffa450edef68
2008-02-06 22:18:40 +00:00
David Reiss
46dc62950d Thrift: Miscellaneous optimizations for C#.
Reviewed By: mcslee

Test Plan: Built it after a future revision.

Revert Plan: ok

Other Notes:
Submitted by Ben Maurer.
Actually reviewed by Todd Berman.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665464 13f79535-47bb-0310-9956-ffa450edef68
2008-02-06 22:09:58 +00:00
David Reiss
cba5727a3f Thrift: String/Binary distinction for C#.
Reviewed By: mcslee

Test Plan: Built it after a future revision.

Revert Plan: ok

Other Notes:
Submitted by Ben Maurer.
Actually reviewed by Todd Berman.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665463 13f79535-47bb-0310-9956-ffa450edef68
2008-02-06 22:09:44 +00:00
Mark Slee
adb5cad7d3 Make inner Isset classes implement serializable
Summary: Since the outer class is serializable, you'll want it on the inner member too. Though in general you shouldn't be using Java to serialize Thrift objects, as that misses the point and tosses version compatibility out the window.

Reviewed By: dreiss

Test Plan: Generate Java code


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665460 13f79535-47bb-0310-9956-ffa450edef68
2008-02-04 21:34:22 +00:00
dweatherford
84e5022bfc [thrift] Fix generated T_LIST push_back() for cpptype override
Summary: Thrift compiler emitting code missing a closing paren:
  "this->extras.push_back(_elem18;"
Reviewed by: eletuchy
Test plan: rebuild some feed code that uses cpptype overrides
Revert: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665453 13f79535-47bb-0310-9956-ffa450edef68
2008-02-01 20:42:56 +00:00
Mark Slee
f07d48e812 Fix to the throws clause validation
Summary: Types from external files are not resolved until the program parse pass, not the include one. Therefore, only do full type validation once after all includes have been parsed and external type pointers resolved.

Reviewed By: aditya

Test Plan: build ServiceManager.thrift


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665452 13f79535-47bb-0310-9956-ffa450edef68
2008-02-01 01:36:26 +00:00
Mark Slee
5cf89c1610 If a list has a custom CPP type, use push_back
Summary: Can't deserialize by reference into std::list, for example

Reviewed By: dweatherford

Test Plan: Build feed


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665451 13f79535-47bb-0310-9956-ffa450edef68
2008-01-31 22:02:26 +00:00
Mark Slee
91f2b7b2f7 Validate that throws clauses in Thrift contain only exceptions
Summary: Throwing non-exceptions, though allowed in some languages, is a weird concept and causes problems in many places. Disallow it in the Thrift compiler and throw an informative error.

Reviewed By: dreiss

Test Plan: Generate a file with an int or something in a throws clause. Peep the nice informative compiler error.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665450 13f79535-47bb-0310-9956-ffa450edef68
2008-01-31 01:49:16 +00:00
Mark Slee
8d4b1cc3ab Improve C++ vector deserialization
Summary: Use std::vector::resize() method to default construct placeholder elements. Then grab references via operator[] to deserialize directly into the vector, instead of copy-constructing elements in.

Reviewed By: hzhao

Test Plan: test/cpp contains list serialization/deserialization checks


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665449 13f79535-47bb-0310-9956-ffa450edef68
2008-01-31 00:06:29 +00:00
Mark Slee
61959f5d9d Improve Thrift map deserialization code
Summary: Instead of copy-constructing map values into the map, alter the code such that we insert default-constructed elements into the map and then deserialize them by reference.

Reviewed By: hzhao

Test Plan: Ran the test in test/cpp which include serialization and deserialization of nested maps.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665448 13f79535-47bb-0310-9956-ffa450edef68
2008-01-30 23:23:15 +00:00
David Reiss
073e2cfeb5 Thrift/Ruby: Generate nicer constructors for Thrift structs.
Submitted by William Morgan.
Approved by Kevin Clark.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665446 13f79535-47bb-0310-9956-ffa450edef68
2008-01-28 20:47:00 +00:00
David Reiss
3e6583365a Thrift/Ruby: Allow some thrift exceptions to use standard Ruby syntax.
Submitted by William Morgan.
Approved by Kevin Clark.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665445 13f79535-47bb-0310-9956-ffa450edef68
2008-01-28 20:46:57 +00:00
David Reiss
050f3200a2 Thrift: Change the way constants are initialized to avoid segfaults.
Reviewed By: mcslee

Test Plan: Looked at the patch carefully.

Other Notes:
Patch submitted by Dave Simpson.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665437 13f79535-47bb-0310-9956-ffa450edef68
2008-01-18 07:39:36 +00:00
Mark Slee
32007a555c Fix set_name compiler method signature
Reviewed By: kholst

Other Notes: Follow up from 78130


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665434 13f79535-47bb-0310-9956-ffa450edef68
2008-01-18 00:57:59 +00:00
kholst
76f2c88eda thrift: Add -cpp_use_include_prefix flag to compiler
Summary: Adds a new flag to allow for a mode where #include statements in generated c++ will include path context information.  For example, if my .thrift file includes "foo/bar/baz.thrift", the generated source files will contain #include statements like:

         #include "foo/bar/gen-cpp/baz_types.h"

         instead of just:

         #include "baz_types.h"

         -cpp_use_include_prefix is OFF by default.

Reviewed By: dreiss

Test Plan: Tested against multiple thrift input files both with and without the new flag.

Revert: OK

DiffCamp Revision: 5522


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665431 13f79535-47bb-0310-9956-ffa450edef68
2008-01-16 02:47:41 +00:00
Mark Slee
1c4ced7409 Generate structs/exceptions in declared order
Summary: Otherwise you're liable to get forward declaration problems in the generated C++ code.

Reviewed By: dreiss

Test Plan: Generate some code that mixes exceptions/structs and has methods potentially return a list of exceptions


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665423 13f79535-47bb-0310-9956-ffa450edef68
2008-01-14 23:04:43 +00:00
David Reiss
7f42bcf97c Thrift: C# Bindings.
Summary:
C# generator, library, and MS Build task contributed by imeem.

Reviewed By: mcslee

Test Plan:
Built the Thrift compiler and generated some C# code.
I'd love to say I installed Mono or Portable.NET and built the C# code,
but I did not.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665421 13f79535-47bb-0310-9956-ffa450edef68
2008-01-11 20:59:12 +00:00
David Reiss
204420fa56 Thrift: MinGW port.
Summary:
Todd Berman from imeem has contributed a patch that allows
the Thrift compiler to be built with MinGW and run on Windows.

Reviewed By: mcslee

Test Plan:
Built the compiler from scratch on Linux.
If my changes messed up the MinGW build, I'm sure Todd will yell at me.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665420 13f79535-47bb-0310-9956-ffa450edef68
2008-01-11 20:59:03 +00:00
Mark Slee
89f5716421 Ruby default values patch
Summary: Submitted by Dan Sully, reviewed by Kevin Clark

Reviewed By: dreiss

Test Plan: New ruby generated code with default vals, and new test scripts


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665418 13f79535-47bb-0310-9956-ffa450edef68
2008-01-10 00:53:08 +00:00
Mark Slee
8c46b1a881 Fix generation for Byte/byte while we're at it
Summary: If in a container, use Byte not byte

Reviewed By: dreiss

Test Plan: Generate a list of bytes

Other Notes: based upon Kyle's submission


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665417 13f79535-47bb-0310-9956-ffa450edef68
2008-01-09 19:51:24 +00:00
David Reiss
a65a79ed26 Thrift: Java generator bugfix.
Reviewed By: mcslee

Test Plan: None.

Revert Plan: ok

Other Notes:
Reported by Kyle Shank.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665416 13f79535-47bb-0310-9956-ffa450edef68
2008-01-09 19:20:20 +00:00
David Reiss
832b262aca Thrift: Revamp build to use a single configure.ac.
Summary:
Ben Maurer suggested that it would make sense for Thrift to build as
a single project, with one configure.ac and multiple Makefile.am.
He was also kind enough to do the heavy lifting, and this commit
is the application of his patch (with minor modifications).
The most significant visible change from this diff is that
in order to buidl one of the thrift sub-projects (i.e.: the compiler,
the C++ library, or the Python library) you must run bootstrap.sh
and configure in the Thrift root, then make in the specific project.
Users who want to build and install the Python library but
can't run configure because they don't have Boost can simply
run setup.py directly.

Reviewed By: mcslee

Test Plan: Built Thrift from scratch.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665409 13f79535-47bb-0310-9956-ffa450edef68
2007-12-28 18:25:33 +00:00
eletuchy
6570451145 [thrift] service functions that begin with a Capital now work for Erlang ...
Summary: ... The main interface function has the same name, but as an escaped atom
         (ie 'CapitalizedFun'(Arg1, Arg2) -> is the function sig)

Reviewed by: dweatherford

Test Plan: tested with the following thrift
     service foo {
         Struct1 CapitalizedFun(1: list<Struct2> param);
     }

     Generated erlang code now compiles

Revert Plan: sure


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665408 13f79535-47bb-0310-9956-ffa450edef68
2007-12-27 15:20:14 +00:00
Mark Slee
f845b7d3e0 Make base set_name take const std:string& instead of std:string
Summary: All the subclasses do that so it causes warnings not to and is dumb because copy constructing std::string is dumb

Reviewed By: kholst

Test Plan: Generate some codes, compile with -Werror


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665405 13f79535-47bb-0310-9956-ffa450edef68
2007-12-21 23:53:10 +00:00
Mark Slee
c27fc31333 Make "args" reserved in thrift
Summary: Breaks the generated python code

Reviewed By: dcorson

Test Plan: Get an error if you use "args" as a variable name in Thrift.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665404 13f79535-47bb-0310-9956-ffa450edef68
2007-12-21 23:52:19 +00:00
Mark Slee
97264864df is_a is deprecated, instanceof only takes vars or constants
Summary: Solution, dummy static class var to use instanceof

Reviewed By: dweatherford

Test Plan: Regen'd some mobile code in trunk using this


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665401 13f79535-47bb-0310-9956-ffa450edef68
2007-12-20 03:23:27 +00:00
David Reiss
6495adb992 Thrift: Optional support for new-style classes.
Reviewed By: mcslee

Test Plan: Thrifted ThriftTest.thrift and looked at the output.

Revert Plan: ok

Other Notes:
Based on a patch from Jon Dugan.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665399 13f79535-47bb-0310-9956-ffa450edef68
2007-12-18 03:37:30 +00:00
David Reiss
80a702fa39 Thrift: Make default values for base types work in Java.
Summary:
The Java generator wasn't setting default values for base types
in the zero argument constructor.  This check was probably brought over
from the C++ generator, where base types are given their default values
in the member variable initializer list (or whatever that thing is called).

Blame Rev: Somewhere in the mysterious past.  I tried to find it, but failed.

Reviewed By: mcslee

Test Plan: Recompiled Thrift and thrifted a file that showed the bug.

Revert Plan: ok

Other Notes:
Bug reported by Jake Luciani.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665398 13f79535-47bb-0310-9956-ffa450edef68
2007-12-18 02:54:06 +00:00
David Reiss
15457c9b08 Thrift: Smalltalk prefix support.
Reviewed By: mcslee

Test Plan: Built the compiler.

Revert Plan: ok

Other Notes:
Contributed by Ben Matasar.
Signed off by Patrick Collison.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665391 13f79535-47bb-0310-9956-ffa450edef68
2007-12-14 07:03:03 +00:00
Mark Slee
9860ee2c86 Fix bug that double-initializes list objects in deserialization.
Reviewed By: jssarma

Test Plan: Regenerate Java code, check list deserializer for no double-object instantiation


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665381 13f79535-47bb-0310-9956-ffa450edef68
2007-11-30 01:43:36 +00:00
Mark Slee
6f9ac3ffeb Thrift compiler now enforces uniqueness of field identifiers
Summary: The code would either not generate, or generate code with errors, if you did this beforehand. Now it's a die-fast stop hard error since this is absolultely always a wrong thing to do.

Reviewed By: dreiss

Test Plan: Test compiling a .thrift file with a repeated field identifier in a struct or arglist.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665379 13f79535-47bb-0310-9956-ffa450edef68
2007-11-28 22:28:13 +00:00
Mark Slee
e02ab33cb8 Lowercase autoload strings
Summary: PHP is undebatably the worst programming language in the world. Class names are case insensitive, so new $tHiNg = new $THing. Garbase. Now autoload has to deal with the fallout.

Reviewed By: dreiss

Test Plan: autoload enabled falcon code


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665375 13f79535-47bb-0310-9956-ffa450edef68
2007-11-28 04:17:49 +00:00
Mark Slee
b22df7c963 Make inheriting from TBase and using inherited read method optional in generated Thrift PHP code
Reviewed By: dreiss, akhil

Test Plan: Generate falcon etc. without -phpo and check it out


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665372 13f79535-47bb-0310-9956-ffa450edef68
2007-11-28 02:39:59 +00:00
Mark Slee
5ab570558f Fix writeContainerEnd call being inside loop instead of after loop
Summary: Potentailly breaks Java serialization for protocols that care about container termination.

Reviewed By: dreiss

Test Plan: Generate code, veirfy writeListEnd/writeSetEnd is in the apporpriate place


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665366 13f79535-47bb-0310-9956-ffa450edef68
2007-11-27 08:38:16 +00:00
Mark Slee
7962223ce2 libtoolize and configure tweaks for Thrift compiler
Summary: Need glibtoolize on OSX.

Reviewed By: mcslee

Other Notes: From Paul Collison


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665363 13f79535-47bb-0310-9956-ffa450edef68
2007-11-21 23:35:52 +00:00
Mark Slee
a9387af56e Double-free Cocoa fix: Redux
Summary: Need get_true_type to evaluate string status

Reviewed By: mcslee

Other Notes: Submission from Andrew McGeachie


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665362 13f79535-47bb-0310-9956-ffa450edef68
2007-11-21 22:05:50 +00:00
Mark Slee
bd5882259d Merging in some Smalltalk changes from Patrick Collison
Reviewed By: mcslee

Test Plan: Rebuild Thrift compiler


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665361 13f79535-47bb-0310-9956-ffa450edef68
2007-11-21 08:43:35 +00:00
Mark Slee
12a28758a6 Fix cocoa double-free issue with strings
Reviewed By: mcslee

Other Notes: Submitted by Andrew McGeachie


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665360 13f79535-47bb-0310-9956-ffa450edef68
2007-11-20 23:55:33 +00:00
Mark Slee
efd37f14d2 Add Smalltalk support to Thrift
Summary: Submitted by Patrick Collison


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665358 13f79535-47bb-0310-9956-ffa450edef68
2007-11-20 05:13:09 +00:00
Mark Slee
12a3b4e002 Do not generate constants php files from Thrift when they will be empty
Summary: That's just silly

Reviewed By: peter, dreiss

Test Plan: Generate PHP from a .thrift with no constants. Notice there is no _constants.php generated.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665355 13f79535-47bb-0310-9956-ffa450edef68
2007-11-20 02:05:29 +00:00
Christopher Piro
de11d85211 [thrift] gut Erlang exception handling
Summary: * move type field to tException from subclasses
          * add backtrace to tException
          * add oop:is_a
          * on exit, wrap exceptions in {thrift_exception, E} ... otherwise can't distinguish e.g. exit:{{tBinProtException, {tException, ...}}, Stack} vs. exit:{tBinProtException, {tException, ...} -- I hate erlang
          * all throws/exits to tException:throw which does the wrapping described above

Reviewed By: eletuchy

Test Plan: been using this code on my live server ^_^

Revert: OK


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665350 13f79535-47bb-0310-9956-ffa450edef68
2007-11-18 02:10:20 +00:00
Mark Slee
09f69e0524 Add __autoload() support to Thrift-generated PHP code
Summary: Include thrift/autoload.php and use -phpa flag to generated code that works with autoload. Good for services with lots of methods that are typically not all invoked.

Reviewed By: dreiss

Test Plan: Falcon, baby, falcon.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665349 13f79535-47bb-0310-9956-ffa450edef68
2007-11-17 00:32:36 +00:00
Mark Slee
eab6ac8b18 Make sure to lazily initialize $TSPEC for structs even with no members
Reviewed By: dweatherford

Test Plan: Generate code with no E_ALL for method-less args


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665346 13f79535-47bb-0310-9956-ffa450edef68
2007-11-16 03:27:22 +00:00
Mark Slee
9e58f4330d Fix namespacing of included enum types in C++ generated code
Summary: If you reference enum types from an include you need to fully qualify their namespace in the generated C++ code.

Reviewed By: pfung

Test Plan: fbtypes code that pfung is using


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665345 13f79535-47bb-0310-9956-ffa450edef68
2007-11-16 02:48:52 +00:00
Christopher Piro
9230539a6f [thrift] Erlang client calls return value from recv_
Summary: only return `ok' if it's an async, otherwise return the value of recv_

Reviewed By: cvarenhorst

Test Plan: my server works now

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665344 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 06:26:32 +00:00
Christopher Piro
90eab4d6e4 [thrift] remove trailing-whitespace-generating code from t_erl_generator.cc
Summary: meta

Reviewed By: dcorson

Test Plan: M-x delete-trailing-whitespace does nothing

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665341 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 06:26:29 +00:00
Christopher Piro
2605af3a2d [thrift] remove tabs from t_erl_generator.cc
Summary: ididntdoit

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665340 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 06:26:29 +00:00
Mark Slee
89d5207983 Change Thrift to lazily instantiate $_TSPEC objects on first object instantiation
Summary: Apparently adding the static array costs overhead since it must get preinitialized or something? It's unclear exactly what's going on here, but let's test to see if explicit lazy instantiation helps here.

Reviewed By: dreiss

Test Plan: See if this speeds up falcon loading


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665334 13f79535-47bb-0310-9956-ffa450edef68
2007-11-14 00:24:14 +00:00
David Reiss
380298f458 Thrift: Fix new-style generated PHP code.
Summary:
We were generating a fatal when constructing a struct with an argument.

Reviewed By: lucas

Test Plan: None.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665332 13f79535-47bb-0310-9956-ffa450edef68
2007-11-13 11:55:06 +00:00
Mark Slee
c557df42ed Need to properly namespace the php class names in typespec
Reviewed By: aditya

Test Plan: Regenerate ubersearch code


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665330 13f79535-47bb-0310-9956-ffa450edef68
2007-11-13 05:53:44 +00:00
Mark Slee
5b743079da Thrift PHP generation Redux
Summary: Chopping the amount of code generated by Thrift for PHP services by two orders of magnitude (approx 25% of the previous size). This is done via putting more logic in a dynamic base class and taking it out of the generated code. Hopefully this wins back the CPU cycles paid just to load code from APC at the cost of a marginal increase in dynamic execution runtime.

Reviewed By: sgrimm, dreiss

Test Plan: Ran all the tests in trunk/test/php, also tested the API generate code and Falcon, etc. in my sandbox


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665328 13f79535-47bb-0310-9956-ffa450edef68
2007-11-13 04:00:29 +00:00
Mark Slee
5151c6279b Add include_once statements for generated PHP code that depends upon other types
Reviewed By: root

Test Plan: Generate PHP code for a .thrift file with an include in it

Other Notes: Reviewed by Todd Lipcon from AmieStreet


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665325 13f79535-47bb-0310-9956-ffa450edef68
2007-11-06 22:11:29 +00:00
Mark Slee
f968926f2b Missing configure check for strerror function
Reviewed By: dreiss

Test Plan: Run configure script


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665324 13f79535-47bb-0310-9956-ffa450edef68
2007-11-06 22:10:24 +00:00
David Reiss
83be086c7d Thrift: Create directories with more permissive modes.
Summary:
How many times has no one else been able to use your awesome Python script
because the Thrift generated files are in a directory that they can't access?
Never again!  We now create directories with mode 0777.
Of course, your process umask will ensure that they are actually created
with mode 0755.  (This is how the mkdir command works.)

Reviewed By: mcslee

Test Plan:
Rebuilt thrift, then did this:
dreiss@dreiss-vmware:dir_mode:thrift/test$ rm -rf gen-*
dreiss@dreiss-vmware:dir_mode:thrift/test$ thrift -cpp  -java -php -py ThriftTest.thrift
dreiss@dreiss-vmware:dir_mode:thrift/test$ ls -ld gen-*
drwx------ 2 dreiss dreiss 4096 2007-10-18 12:20 gen-cpp
drwx------ 3 dreiss dreiss 4096 2007-10-18 12:20 gen-java
drwx------ 2 dreiss dreiss 4096 2007-10-18 12:20 gen-php
drwx------ 3 dreiss dreiss 4096 2007-10-18 12:20 gen-py
dreiss@dreiss-vmware:dir_mode:thrift/test$ rm -rf gen-*
dreiss@dreiss-vmware:dir_mode:thrift/test$ ../compiler/cpp/thrift -cpp  -java -php -py ThriftTest.thrift
dreiss@dreiss-vmware:dir_mode:thrift/test$ ls -ld gen-*
drwxr-xr-x 2 dreiss dreiss 4096 2007-10-18 12:20 gen-cpp
drwxr-xr-x 3 dreiss dreiss 4096 2007-10-18 12:20 gen-java
drwxr-xr-x 2 dreiss dreiss 4096 2007-10-18 12:20 gen-php
drwxr-xr-x 3 dreiss dreiss 4096 2007-10-18 12:20 gen-py
dreiss@dreiss-vmware:dir_mode:thrift/test$

Revert Plan: ok

Other Notes:
With some help from external contributor Ben Maurer.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665317 13f79535-47bb-0310-9956-ffa450edef68
2007-11-01 17:15:35 +00:00
eletuchy
83f14ee795 [thrift] erlang structs now compile
Summary: if "cond and cond ->" is not valid erlang,
         if "cond andalso cond ->" is.

Reviewed By: cpiro

Test Plan: generated erlang from and thrift file with structs ...
           generated code compiles

Revert Plan: sure


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665314 13f79535-47bb-0310-9956-ffa450edef68
2007-10-31 13:40:48 +00:00
dweatherford
5afc0aae32 [thrift] PHP generator: extension support
Summary: Adds php code generation to take advantage of the php
  'thrift_protocol' extension (currently for deserialization only)

  Requires you to swap your protocol for a TBinaryProtocolAccelerated
  (which just inherits TBinaryProtocol without actually adding any
  new functionality) and that you use a TFramedTransport or wrap your
  transport in a TBufferedTransport.

  TBinaryProtocolAccelerated is currently only in tfb/www/lib (or will
  be momentarily).

Reviewed By: mcslee
Test Plan: synapse_feed uses this in my sandbox, works fine
Revert: svn


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665313 13f79535-47bb-0310-9956-ffa450edef68
2007-10-31 06:03:54 +00:00
dweatherford
65b7075b5a [thrift] Output dir selection + updated TSCons
Summary: Allows setting the output directory via the new '-o dir' cmdline option.

  TSCons is updated to use this to put the output in the right place no matter
  the cwd, so doing dependent builds from different directories won't break.

Reviewed By: martin
Test Plan: mkdir /tmp/honk; thrift -cpp -java -javabean -php -phpi -py -rb -xsd -perl -erl -ocaml -hs -cocoa -o /tmp/honk Tablet.thrift
Revert: svn


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665311 13f79535-47bb-0310-9956-ffa450edef68
2007-10-31 02:18:14 +00:00
Mark Slee
2e7801d7c0 Make the Java generator respect the optional keyword in struct writers
Reviewed By: dreiss

Test Plan: Generate Java code. Check functionality and safe compile


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665308 13f79535-47bb-0310-9956-ffa450edef68
2007-10-24 02:56:24 +00:00
dweatherford
969b226b06 [thrift] Updating gen_phpi for new header format
Summary: This was still sending/expecting the old style (no version field); should be fixed now.
Reviewed By: mcslee
Test Plan: build and use Tablemaster and Tablet interfaces with gen-phpi
Revert: svn
DiffCamp Revision: 1435


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665306 13f79535-47bb-0310-9956-ffa450edef68
2007-10-23 00:26:44 +00:00
David Reiss
2b9ddab14c Thrift: Kill a warning.
Summary:
These should always have been const.

Reviewed By: mcslee

Test Plan:
Re-ran the dense protocol test.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665303 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 03:39:55 +00:00
Mark Slee
65e595f54f Generate REST code properly for objects/struct arguments
Reviewed By: hzhao

Test Plan: Data store API


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665302 13f79535-47bb-0310-9956-ffa450edef68
2007-10-15 21:32:12 +00:00
Christopher Piro
7b19b65a16 [thrift] Erlang Thrift 'oop:get' -> 'This#'
Summary: the client structures aren't oop objects, they're vanilla records ... adjust accordingly

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665300 13f79535-47bb-0310-9956-ffa450edef68
2007-10-13 05:10:52 +00:00
Mark Slee
34b2926d5c Java Thrift objects implement common base interface
Reviewed By: dreiss

Test Plan: Generate java code and run against new library.

Revert: OK

DiffCamp Revision: 900


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665296 13f79535-47bb-0310-9956-ffa450edef68
2007-10-09 20:55:10 +00:00
Christopher Piro
4c3d7b84b6 [thrift] don't scope non-service types in Erlang
Summary: kind of funny ... exact same patch as for the Ruby version; both were unexposed until I tried using reflection_limited

Test Plan: thx but nothx

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665295 13f79535-47bb-0310-9956-ffa450edef68
2007-10-09 04:41:48 +00:00
Mark Slee
6c848a02df Use json encoding logic for <list> and <set> args in Thrift PHP/REST
Reviewed By: hzhao

Test Plan: Data store API interface


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665294 13f79535-47bb-0310-9956-ffa450edef68
2007-10-08 22:31:03 +00:00
Christopher Piro
e4e1968935 [thrift] don't scope non-service types in Ruby
Summary: non-service types live in the top-level namespace, so look for them there. example from FacebookService.rb (accessing Service from reflection_limited_types.rb):

              FIELDS = {
         -      0 => {:type => TType::STRUCT, :name => 'success', :class => reflection_limited_types.Service}
         +      0 => {:type => TType::STRUCT, :name => 'success', :class => Service}
              }

         preferable to adding a "module honk_types ... end" around honk_types.rb ... non-service types should land in top-level space (or whatever ruby_namespace has been defined).  if ruby_namespace even works ... who knows

Reviewed By: mcslee

Test Plan: now reflection_limited works with my simple Ruby client

           honestly, there's no test suite for these?  TODO:cpiro

Revert: OK

TracCamp Project: Thrift

DiffCamp Revision: 735


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665291 13f79535-47bb-0310-9956-ffa450edef68
2007-10-04 01:54:11 +00:00
Mark Slee
165eca9c7c Make REST PHP deserializer generated PHP code support map/list/set
Summary: list/set are comma-separated and explode, map is JSON decoded

Reviewed By: hzhao

Test Plan: Invoke API methods via JSON


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665290 13f79535-47bb-0310-9956-ffa450edef68
2007-10-04 01:19:20 +00:00
Christopher Piro
73e3dd7d5f [thrift] fix Ruby codegen: capitalize module name for enums
Summary: all module names must be capitalized in Ruby -- if the enum name from the interface isn't capitalized \
         then it's a runtime error, e.g. in fb303_types.rb:

         -module fb_status
         +module Fb_status

Reviewed By: mcslee

Test Plan: fb303 now works with Ruby binding

Revert: OK

TracCamp Project: Thrift

DiffCamp Revision: 692


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665288 13f79535-47bb-0310-9956-ffa450edef68
2007-10-03 07:13:44 +00:00
Mark Slee
aa3c5a882c Merging latest minor Cocoa changes
Summary: BinaryProtocol handling of null strings, destructor, and contributors email fix. Submitted by Andrew McGeachie

Reviewed By: mcslee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665278 13f79535-47bb-0310-9956-ffa450edef68
2007-09-19 21:12:52 +00:00
Mark Slee
8266443d92 OO perl accessors for Thrift objects
Summary: Submitted by Jake Luciani

Reviewed By: cpiro

Test Plan: Supplied in test/tutorial code


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665276 13f79535-47bb-0310-9956-ffa450edef68
2007-09-19 06:49:30 +00:00
David Reiss
b72d19f653 Thrift: Prep for release.
Summary:
- make dist is no fun.  Had to add a lot of stuff to Makefile.am to
  make sure stuff got included in the tarball.
- Added a permanent NEWS file with the release notes for this release.
- clean.sh removes ylwrap also.
- Gave it a real version for make dist.
- Added ACLOCAL_AMFLAGS to lib/cpp/Makefile.am to make it easier to
  work on configure.ac.
- Made concurrency_test a non-installed binary because
  no one wants to install it.
- Dropped some symlinks that were annoying make dist.
- Updated README.

Test Plan:
./bootstrap.sh && ./configure && make dist
Compared contents of tarball to source tree.
Did this from a fresh git tree so no gross untracked files would be around.
On devrs: ./bootstrap.sh && ./configure && make install DESTDIR=/tmp/relinst1
Made sure concurrency_test was built but not installed.
Checked zlib URL with firefox.

Reviewed By: mcslee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665274 13f79535-47bb-0310-9956-ffa450edef68
2007-09-18 19:46:00 +00:00
Christopher Piro
0f6cc29f72 [thrift] fix _thrift for inheriting services
Summary: obviously Iain's fault


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665272 13f79535-47bb-0310-9956-ffa450edef68
2007-09-18 02:14:31 +00:00
Christopher Piro
b97b89d1dc [thrift] give the generated Erlang service file a _thrift
Summary: Before they were names Service.erl, but the Service module name should be reserved for more important things.  Namespaces what?

Test Plan: with channel server

Riders: also fixes whitespace, puts -erl in its right place


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665271 13f79535-47bb-0310-9956-ffa450edef68
2007-09-18 00:07:42 +00:00
David Reiss
f84b360d5c Thrift: Fix fingerprinting bug.
Summary:
Fingerprints were'nt being initialized properly because I forgot to move
the initialization from t_struct to t_type.  Fixed that.
Also, typedefs weren't generating fingerprints for their true types.

Reviewed By: mcslee

Test Plan:
This didn't work before with -cpp -dense.  Now it does.
typedef list<i32> ilist
struct foo { 1: ilist l }

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665268 13f79535-47bb-0310-9956-ffa450edef68
2007-09-17 21:16:32 +00:00
dweatherford
df72c01c37 [thrift] C++: Pass std::exception from server to client
Summary: Rather than an uncaught exception dropping the connection, catching std::exception (and anything derived from it) and passing its message payload back in the form of a T_EXCEPTION message is a much cleaner response.
Reviewed By: mcslee
Test Plan: compile generated code for Synapse's tablet interface, throw a generic exception at the server, observe the message for the exception arising from the client in the form of a TApplicationException (instead of the previous 'no more data to read' exception)
Revert: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665264 13f79535-47bb-0310-9956-ffa450edef68
2007-09-15 08:49:48 +00:00
Mark Slee
3d029786cd Add missing writeEnd calls
Summary: When flush is called this also should be

Reviewed By: aditya

Test Plan: Use w/ PipedTransport. Should writeEnd() when an exception is thrown


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665261 13f79535-47bb-0310-9956-ffa450edef68
2007-09-14 22:18:09 +00:00
Mark Slee
33a7d898ca Merge more cocoa changes from Andrew McGeachie
Reviewed By: dreiss

Test Plan: To be provided later by McGeachie. Compiler builds fine. Does not affect other libraries.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665259 13f79535-47bb-0310-9956-ffa450edef68
2007-09-14 19:44:30 +00:00
David Reiss
ce161a96cd Thrift: Clean up and test TDenseProtocol
Summary:
- TDenseProtocol now includes a part of the struct fingerprint in
  the serialized message, to protect from unserialzing trash.
- A lot of cleanups and commenting for TDenseProtocol.
- A lot of test cases for same.

Reviewed By: mcslee

Test Plan: test/DenseProtoTest.cpp

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665257 13f79535-47bb-0310-9956-ffa450edef68
2007-09-11 22:09:42 +00:00
Mark Slee
8775c73db2 Add JavaDoc comments to generated Thrift Java code
Reviewed By: dreiss
           Test Plan: Generate Java code from .thrift file w/ javadoc comments
              Revert: OK
               Notes: My first backend diffcamp review


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665256 13f79535-47bb-0310-9956-ffa450edef68
2007-09-10 22:33:05 +00:00
Mark Slee
7816572784 Modify Thrift parser to disallow optional/required keywords in argument lists
Reviewed By: dreiss

Test Plan: Toss an optional/required in an arg list, check that it's ignored and compiler spits a warning


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665255 13f79535-47bb-0310-9956-ffa450edef68
2007-09-10 22:08:49 +00:00
Mark Slee
7e9eea4871 Adding Cocoa generator to Thrift
Summary: Thanks to Andrew McGeachie for doing this

Reviewed By: dreiss

Test Plan: No merge/build issues. Will solicit McGeachie for additions to test/cocoa in the future


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665254 13f79535-47bb-0310-9956-ffa450edef68
2007-09-10 21:00:23 +00:00
Mark Slee
979ff958c1 Merge Java get/set Size and Iterator changes from Dave Engberg
Reviewed By: dreiss


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665253 13f79535-47bb-0310-9956-ffa450edef68
2007-09-10 20:53:23 +00:00
David Reiss
47557bc8ad Thrift: Slight tweaks to local reflection.
Summary:
Local reflection typespecs for structs now have a dummy T_STOP field at the end
so we don't have to check the size on every iteration.
They also contain information about which fields are optional.
Also put a static pointer to the reflection in each structure.

Reviewed By: mcslee

Test Plan: test/DenseLinkingTest.thrift

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665246 13f79535-47bb-0310-9956-ffa450edef68
2007-09-04 21:31:04 +00:00
James Wang
d3f1a2d2ba Summary: Checking in fix to TFileTransport to remove redundant behavior of readEvent -- just return NULL or the next event
Also, checking in changes to the php generation code I made awhile ago, but forgot to check in

Reviewed By: aditya, mcslee

Test Plan: Compiled thrift and falcon, and confirmed that falcon's print binary still worked

Revert Plan: revertible


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665245 13f79535-47bb-0310-9956-ffa450edef68
2007-08-31 23:45:53 +00:00
Mark Slee
5de75dd859 Merge some java gen fixes from Johan Oskarsson
Summary: Making Isset inner classes static because they don't need to reference their owner, and killing some unused variables.

Reviewed By: dreiss


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665244 13f79535-47bb-0310-9956-ffa450edef68
2007-08-31 20:06:36 +00:00
Mark Slee
f150f1aed5 Add get_true_type call to RB generator
Summary: Issue with typedefs failing, submitted by kevin clark @ powerset

Reviewed By: mcslee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665241 13f79535-47bb-0310-9956-ffa450edef68
2007-08-31 04:30:52 +00:00
David Reiss
d779cbe48c Thrift: Local Reflection for C++.
Summary:
The compiler now takes a "-dense" flag that will cause it to
generate some extra metadata for C++.  This metadata will be used by
TDenseProtocol.  This should be the last compiler change necessary
to enable that feature.

Reviewed By: mcslee

Test Plan: test/DenseLinkingTest.thrift

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665240 13f79535-47bb-0310-9956-ffa450edef68
2007-08-31 01:42:55 +00:00
Mark Slee
01a9f8845d Add -javabean option to Thrift
Summary: In case you want getters and setters and iterators and magic. Submitted by Dave Engberg

Reviewed By: dreiss


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665239 13f79535-47bb-0310-9956-ffa450edef68
2007-08-31 00:55:28 +00:00
David Reiss
6ce97e3d8d Thrift: Forgot to commit these fixes.
Summary:
Small git error.  These changes should have gone in my last commit.

Reviewed By: mcslee

Test Plan: Same as the last one.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665238 13f79535-47bb-0310-9956-ffa450edef68
2007-08-30 23:18:31 +00:00
David Reiss
9885c6801d Thrift: Generate fingerprints for non-structs.
Summary:
This is going to be needed to support TDenseProtocol.

Reviewed By: mcslee

Test Plan:
Clean build of Thrift.
Ran if/regen.sh.  No change to generated C++ or Python.
gdb thrift -cpp ThriftTest.thrift.  Made sure they were being generated.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665237 13f79535-47bb-0310-9956-ffa450edef68
2007-08-30 23:12:37 +00:00
David Reiss
5db3e92671 Thrift: Handle absence of fastbinary.so
Summary:
- Wrap import of fastbinary in a try/catch, setting it to None if it fails.
- Don't try to fastbinary.encode/decode if fastbinary is None.
- Always generate thrift_spec, even if it is None.
- Don't try to fastbinary.encode/decode if thrift_spec is None.

Reviewed By: mcslee

Test Plan:
test/py/Test{Client,Server}.py
Manually delete my fastbinary.so, they worked fine.
Changed them to use Accelerated protocol.  They still worked fine because
the test falls through to the normal generated code.
Installed fastbinary.so, everything worked fine (eventually).

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665236 13f79535-47bb-0310-9956-ffa450edef68
2007-08-30 23:07:45 +00:00
David Reiss
c6fc329a40 Thrift: Support for explicit Python module declaration.
Summary:
Previously, Thrift used the name of the .thrift file as the python module name.
This wasn't very flexible.  Now the python module can be explicitly declared.
Also, there was no need for t_py_generator to inherit from t_oop_generator.

Reviewed By: mcslee

Test Plan:
cd test/py/explicit_module
./runtest.sh

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665234 13f79535-47bb-0310-9956-ffa450edef68
2007-08-30 00:58:43 +00:00
Mark Slee
6868eae42a Autoconf fixes
Summary: Need these after some recent changes to rebuild with Engeleman's fix

Reviewed By: aditya

Test Plan: Build compiler


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665232 13f79535-47bb-0310-9956-ffa450edef68
2007-08-29 04:36:53 +00:00
Mark Slee
a0f8bdca95 Merge patch from Dan Engeleman for Java utility constructors
Summary: As well as a packaging fix

Reviewed By: aditya

Test Plan: Generate test files, look at Java obj constructors


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665231 13f79535-47bb-0310-9956-ffa450edef68
2007-08-29 04:36:28 +00:00
David Reiss
1746e30c91 Thrift: Fix a compile error.
Summary:
The fingerprint code was generating invalid C++ code.

Blame Rev: 57192

Reviewed By: mcslee

Test Plan:
Recompiled thrift.
Thrifted DebugProtoTest with new compiler.
Compiled and rand DebugProtoTest.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665229 13f79535-47bb-0310-9956-ffa450edef68
2007-08-28 22:18:22 +00:00
David Reiss
dd7796fd8b Thrift: Fix untriggerable bug.
Reviewed By: mcslee

Test Plan: Compiled the Thrift compiler.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665228 13f79535-47bb-0310-9956-ffa450edef68
2007-08-28 21:09:06 +00:00
David Reiss
18bf22d5ba Thrift: Generate structural fingerprints for thrift structs.
Summary:
We are going to write a dense protocol soon that eliminates some metadata.
To prevent version conflicts, we want each structure to have a
structural fingerprint that will change whenever the struct changes
in a way that will affect the dense protocol.
This change computes those fingerprints and puts them in
the generated C++ code.

Reviewed By: aditya, mcslee

Test Plan:
Recompiled thrift.
Thrifted DebugProtoTest with old and new compilers.
Compared output.
Also ran thrift with those "cout"s uncommented,
examined the fingerprint material,
and verified the hashes.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665227 13f79535-47bb-0310-9956-ffa450edef68
2007-08-28 20:49:17 +00:00
David Reiss
2375312fa0 Thrift: Limited Reflection for C++.
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
2007-08-27 19:57:34 +00:00
David Reiss
382fc3043c Thrift: Native-code Binary Protocol encoder.
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
2007-08-25 18:01:30 +00:00
Mark Slee
cf3c124f29 Trivial automake fix
Summary: Apparently needed to fix some install stuff

Reviewed By: mcslee

Test Plan: Build thrift compiler


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665221 13f79535-47bb-0310-9956-ffa450edef68
2007-08-23 23:19:56 +00:00
David Reiss
e087a30585 Thrift: Make use of get_true_type.
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
2007-08-23 21:43:25 +00:00
Mark Slee
27ed6ec1f9 Merging Jake Luciani's latest perl code gen fixes
Reviewed By: dreiss

Test Plan: Watch for any weirdness on Thrift code gen, perl specific


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665206 13f79535-47bb-0310-9956-ffa450edef68
2007-08-16 01:26:31 +00:00
Mark Slee
1b65b724eb Generate a -u option for Python Service-remote CLI utility
Summary: In case you want to hit an HTTP Thrift service

Reviewed By: peter

Test Plan: ServiceClient-remote -u http://dope.vip.facebook.com/intern/smc/smcserver.php getTierByName test


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665205 13f79535-47bb-0310-9956-ffa450edef68
2007-08-16 00:27:21 +00:00
David Reiss
3429b6a9a0 Thrift: Add a useful helper function (in compiler).
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
2007-08-15 00:55:41 +00:00
David Reiss
8320a92d9b Thrift: Merging external patch.
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
2007-08-14 19:59:26 +00:00
David Reiss
cbd4bacc30 Thrift: docstring revamp step 2.
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
2007-08-14 17:12:33 +00:00
David Reiss
cdffe260f1 Thrift: docstring revamp step 1.
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
2007-08-14 17:12:31 +00:00
Mark Slee
7e2cda1316 Fix C++ enum deserialization
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
2007-08-09 03:39:18 +00:00
David Reiss
202111d2e9 Thrift: More constant enums.
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
2007-08-06 20:38:18 +00:00
Christopher Piro
5b3a8f7a8b [thrift] improved error logging and handling for Erlang bindings
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
2007-08-01 22:27:37 +00:00
David Reiss
c2532a9ac4 Thrift: Allow whole program doctext.
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
2007-07-30 23:46:11 +00:00
David Reiss
1ac0580378 Thrift: Change docstring syntax.
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
2007-07-30 22:00:27 +00:00
Mark Slee
d0767c5796 Fix Thrift compiler to support reuse of enums and constants in later constants
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
2007-07-27 22:14:41 +00:00
David Reiss
877237abcf Thrift: Catch what you throw.
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
2007-07-27 00:40:19 +00:00
David Reiss
96d2388ade Thrift: Cleaned up whitespace.
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
2007-07-26 21:10:32 +00:00
Christopher Piro
5f5fdf3a20 [thrift] maps, lists, sets, and service inheritance for Erlang
Reviewed by: cpiro

Test Plan: tested wit tutorial/tutorial.thrift

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665175 13f79535-47bb-0310-9956-ffa450edef68
2007-07-25 22:41:00 +00:00
iproctor
ff8eb9288d Thrift: Haskell library and codegen
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
2007-07-25 19:06:13 +00:00
iproctor
5ced286cec Thrift: Ruby cogeden not creating exception fields properly.
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
2007-07-25 18:50:50 +00:00
Christopher Piro
873726035a [thrift] stupid case bug in Erlang codegen
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
2007-07-24 06:20:47 +00:00
Christopher Piro
ae1f10f8f2 [thrift] misc. Erlang codegen improvements, cleanups
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
2007-07-24 04:30:15 +00:00
David Reiss
8639e1056d Thrift: add an indent to generated cpp files.
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
2007-07-21 00:23:32 +00:00
Christopher Piro
094823a46c [thrift] highly concurrent Erlang goodness
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
2007-07-18 00:26:12 +00:00
iproctor
9a41a0c51e Thrift: OCaml library and generator
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
2007-07-16 21:59:24 +00:00
Mark Slee
b1ad0141d4 Add typecasting to REST parameters in generated Thrift PHP code
Trac Bug: #4360

Reviewed By: ari

Test Plan: Honky tonk, view the new generated api_10/x packages


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665161 13f79535-47bb-0310-9956-ffa450edef68
2007-07-10 16:48:37 +00:00
Mark Slee
58dfb4fbe8 Lots of Ruby code generation improvements
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
2007-07-06 02:45:25 +00:00
Mark Slee
756b1d1b07 Make -rest an optional param to the Thrift PHP compiler
Summary: You rarely need the generated REST stuff

Reviewed By: jwang

Test Plan: Gen falcon code without REST part


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665150 13f79535-47bb-0310-9956-ffa450edef68
2007-07-06 00:30:21 +00:00
Christopher Piro
2f5afceeaa [thrift] preliminary Erlang support (initial import)
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
2007-06-29 07:17:33 +00:00
eletuchy
447d7d2365 [thrift] small fixes to java generator
Summary: - size generated collections correctly
         - StringBuilder vs StringBuffer

Reviewed By: mcslee

Test Plan: built TestThrift.thrift; it compiled, yay

Revert Plan: sure

Notes:

EImportant:


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665134 13f79535-47bb-0310-9956-ffa450edef68
2007-06-13 04:24:11 +00:00
Mark Slee
e9ce01cf40 Apply thrift license to all files in compiler
Summary: Forgot to do this last time around, only got the libs

Reviewed By: no code in here, just comments


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665113 13f79535-47bb-0310-9956-ffa450edef68
2007-05-16 02:29:53 +00:00
Mark Slee
2c44d2047e Perl generator for Thrift compiler
Summary: Submitted by Jake Luciani

Reviewed By: mcslee

Test Plan: Who likes perl? Not me. Test files to be checked in soon.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665111 13f79535-47bb-0310-9956-ffa450edef68
2007-05-16 02:18:07 +00:00
Mark Slee
e9a1edc75d Make sure isset fields of java generated objects is public
Reviewed By: rob mccool from yahoo


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665103 13f79535-47bb-0310-9956-ffa450edef68
2007-05-03 01:30:18 +00:00
peter
67bfaf2782 fixing a typo
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665102 13f79535-47bb-0310-9956-ffa450edef68
2007-05-01 04:03:22 +00:00
Mark Slee
8d725a2738 Add explicit binary type to Thrift
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
2007-04-13 01:57:12 +00:00
Mark Slee
b86c4b251e Yeeeeeeeeahhh
Summary: Missing that $ in the vairable

Reviewed By: php

Test Plan: you need that!


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665092 13f79535-47bb-0310-9956-ffa450edef68
2007-04-10 06:44:53 +00:00
Mark Slee
ec3f32009b In php generate array of enum values to string names
Summary: for peter k

Reviewed By: peter


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665091 13f79535-47bb-0310-9956-ffa450edef68
2007-04-10 06:15:25 +00:00
Martin Kraemer
a7d6c3c142 Thrift: fix error with handling TApplicationException
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
2007-03-16 02:03:32 +00:00
Mark Slee
6632e0b041 Constants lowercase in java true/false
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665060 13f79535-47bb-0310-9956-ffa450edef68
2007-03-14 09:08:38 +00:00
Mark Slee
8109757e6c Generate toString() convenience method for Thrift java structs
Reviewed By: biren


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665059 13f79535-47bb-0310-9956-ffa450edef68
2007-03-14 03:07:00 +00:00
Mark Slee
7679196f1c Various Thrift fixes, including Application Exception support in Ruby, better errror messages across languages, etc.
Reviewed By: thrift


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665058 13f79535-47bb-0310-9956-ffa450edef68
2007-03-14 02:47:35 +00:00
Mark Slee
227ac2c50e Ruby code gen fixes and some README improvements
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665053 13f79535-47bb-0310-9956-ffa450edef68
2007-03-07 05:46:50 +00:00
Mark Slee
3303f36081 Thrift CPP threading fixes
Reviewed By: karl


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665045 13f79535-47bb-0310-9956-ffa450edef68
2007-03-05 20:09:37 +00:00
Mark Slee
c2c82c97f4 Move helper structure declarations into .h file
Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665044 13f79535-47bb-0310-9956-ffa450edef68
2007-03-05 05:45:51 +00:00
Mark Slee
57cc25e2a3 Some Thrift documentation cleanups
Summary: Getting ready to hand this over to powerset, just want to have the right licenses in place and such first.

Reviewed By: thrift


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665029 13f79535-47bb-0310-9956-ffa450edef68
2007-02-28 21:43:54 +00:00
Mark Slee
7a49888fc6 TApplicationException handling in PHP generated thrift code
Reviewed By: php


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665028 13f79535-47bb-0310-9956-ffa450edef68
2007-02-27 22:11:39 +00:00
Mark Slee
b0060b0401 Python application level exceptions
Reviewed By: snakes


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665015 13f79535-47bb-0310-9956-ffa450edef68
2007-02-21 05:37:50 +00:00
Mark Slee
5e0465738e Thrift application exceptions in Java, code gen
Reviewed By: jrift


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665009 13f79535-47bb-0310-9956-ffa450edef68
2007-02-21 04:17:55 +00:00
Mark Slee
4c948d4b5c C++ Thrift server throws application exceptions for invalid message types
Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665007 13f79535-47bb-0310-9956-ffa450edef68
2007-02-21 01:40:05 +00:00
Mark Slee
2c2a648023 Gen code with /usr/bin/env python not /usr/bin/python
Summary: More reliable, lets user customize which python to use

Reviewed By: dougb


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665005 13f79535-47bb-0310-9956-ffa450edef68
2007-02-21 00:22:33 +00:00
Mark Slee
ecf490e30d Python code gen includes __init__.py and package directory
Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665004 13f79535-47bb-0310-9956-ffa450edef68
2007-02-21 00:05:18 +00:00
Mark Slee
98e962bf24 Generate Java code into proper source directory heirarchy
Reviewed By: tbr-aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665001 13f79535-47bb-0310-9956-ffa450edef68
2007-02-20 18:44:05 +00:00
Mark Slee
afc76543cd Take brackets out of cpp_type bit
Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664996 13f79535-47bb-0310-9956-ffa450edef68
2007-02-09 21:55:44 +00:00
Mark Slee
9f8361fee7 Fix code gen to getTransport() not getOutputTransport()
Reviewed By: wayne


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664995 13f79535-47bb-0310-9956-ffa450edef68
2007-02-09 02:14:43 +00:00
Mark Slee
da748dd5fe Fixes for ruby server code gen
Reviewed By: tbr-doug


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664990 13f79535-47bb-0310-9956-ffa450edef68
2007-02-07 06:03:32 +00:00
Mark Slee
6a47fed5fe Thrift supports the "senum" type now
Summary: Enumerated lists of strings, enforced only in XSD

Reviewed By: xsd


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664987 13f79535-47bb-0310-9956-ffa450edef68
2007-02-07 02:40:59 +00:00
Mark Slee
748d83f65f xsd_attrs are a FieldList now, so you can have multiple of them and they are typed
Reviewed By: xsd


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664984 13f79535-47bb-0310-9956-ffa450edef68
2007-02-07 01:20:08 +00:00
Mark Slee
81cf1e550d Thrift code-gen optimizations to use raw pointers where possible
Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664983 13f79535-47bb-0310-9956-ffa450edef68
2007-02-07 00:54:49 +00:00
Mark Slee
7df0e2a9aa Thrift support for the xsd_nillable attribute
Reviewed By: dave


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664981 13f79535-47bb-0310-9956-ffa450edef68
2007-02-06 21:03:18 +00:00
Mark Slee
86c87b0fe1 NAmespace PHP exceptions in catch block properly and add getName() method to generated structs
Reviewed By: ari


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664980 13f79535-47bb-0310-9956-ffa450edef68
2007-02-06 07:11:23 +00:00
Mark Slee
21135c300b Adding XSD attribute support
Reviewed By: dave


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664974 13f79535-47bb-0310-9956-ffa450edef68
2007-02-05 21:52:08 +00:00
Mark Slee
74eea207a0 svn adding t_doc.h
Summary: charlie you missed this one!

Reviewed By: cheever


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664973 13f79535-47bb-0310-9956-ffa450edef68
2007-02-05 21:47:03 +00:00
ccheever
f53b5cfed2 adding documentation syntax to thrift
see DocTest.thrift for examples.

todo: integrate parsed documentation into code generation

review: marc k, mcslee
test plan: DocTest.thrift


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664970 13f79535-47bb-0310-9956-ffa450edef68
2007-02-05 20:33:11 +00:00
Mark Slee
7ff3245bfa Default values and nullification for thrift code
Summary: All things are null now, unless you specify a default value!

Reviewed By: marc


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664963 13f79535-47bb-0310-9956-ffa450edef68
2007-02-01 05:26:18 +00:00
dave
29cbeb6235 Thrift: Fix xsd:sequence and xsd:all minOccurs/maxOccurs generation
The minOccurs and maxOccurs attributes should appear on the elements, rather than the containers.

for a thrift struct, we produce:
<sequence>
<element name="some_element"> <!-- max is implicitly 1 -->
<element name="some_optional_element" minOccurs="0"> <!-- max is
implicitly 1 -->
...

for a thrift list, we produce
<sequence>
<element name="the_list_element" minOccurs="0" maxOccurs="unbounded">
</sequence>

for a thrift struct tagged with xsd_all, we produce

<all>
<element name="some_element" minOccurs="0"/>  <!-- max is implicitly 1
-->
</all>

Reviewed By: mcslee

Test Plan: sandbox

Revert Plan: revertible

Notes:


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664962 13f79535-47bb-0310-9956-ffa450edef68
2007-02-01 00:17:28 +00:00
dave
492d223118 Thrift: Finish namespace generation from xsd_namespace command
In .thrift file:

xsd_namespace "http://api.facebook.com/v1"

Turns up in the xsd output as:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 targetNamespace="http://api.facebook.com/v1"
 xmlns="http://api.facebook.com/v1"
 elementFormDefault="qualified">

to properly accommodate our generated xml

Thank you, Slee.

Reviewed By: mcslee

Test Plan: sandbox

Revert Plan: revertible

Notes:


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664960 13f79535-47bb-0310-9956-ffa450edef68
2007-01-31 02:49:01 +00:00
Mark Slee
0d9199e709 xsd_namespace keyword for thrift
Summary: So you can Spaceify the Shiznits

Reviewed By: fett


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664959 13f79535-47bb-0310-9956-ffa450edef68
2007-01-31 02:08:30 +00:00
dave
4637bfbff8 Thrift: Small changes to support XSD generation
xs:restriction -> xsd:restriction
minoccurs -> minOccurs

Reviewed By: marc

Test Plan: sandbox

Revert Plan: revertible

Notes:


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664957 13f79535-47bb-0310-9956-ffa450edef68
2007-01-30 19:50:30 +00:00
Mark Slee
2006d99d25 Thrift gen'd code now checks for field ID AND type matches
Summary: Will call skip() even if FID matches when there is an invalid field type identifier

Reviewed By: corson


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664956 13f79535-47bb-0310-9956-ffa450edef68
2007-01-29 17:58:54 +00:00
Mark Slee
6d7d595858 Ruby support for Thrift
Summary: Just client support so far.

Reviewed By: tbr-doug


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664953 13f79535-47bb-0310-9956-ffa450edef68
2007-01-27 01:44:22 +00:00
Mark Slee
eb0d024ee1 Full automake/autoconf compliance for thrift
Summary: Including the compiler!!!

Reviewed By: automake


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664949 13f79535-47bb-0310-9956-ffa450edef68
2007-01-25 07:58:55 +00:00
Mark Slee
938bc38e7d Fix Makefile to use thrifty.yy and thriftl.ll
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664946 13f79535-47bb-0310-9956-ffa450edef68
2007-01-25 02:10:07 +00:00
Mark Slee
cc11b06c01 Rename some thrif tcompiler files
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664945 13f79535-47bb-0310-9956-ffa450edef68
2007-01-25 02:07:22 +00:00
Mark Slee
c42ecd5cfe No more getInputTransport vs getOutputTransport in protocols
Summary: It is just getTransport ow

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664941 13f79535-47bb-0310-9956-ffa450edef68
2007-01-24 22:57:20 +00:00
Mark Slee
bf05a6069e Generate pargs an presult helpers in C++ to be more efficient in thrift
Summary: Copy construction is the pits. Avoid it at all costs.

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664939 13f79535-47bb-0310-9956-ffa450edef68
2007-01-24 22:53:07 +00:00
Mark Slee
8896a54720 No need to generate private __construct() function if the class is already final
Reviewed By: lucas


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664935 13f79535-47bb-0310-9956-ffa450edef68
2007-01-23 23:22:35 +00:00
Mark Slee
f49041c083 Use proper name for catching exceptions
Reviewed By: tbr-dave


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664934 13f79535-47bb-0310-9956-ffa450edef68
2007-01-19 23:49:00 +00:00
Mark Slee
eb08f9e680 Thrift XSD generator populates PHP globals with type names for typedeffed stuffs
Reviewed By: dave


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664933 13f79535-47bb-0310-9956-ffa450edef68
2007-01-19 22:12:10 +00:00
Mark Slee
36bfa2e61f Allow field elements to be optional in thrift with xsd_optional keyword
Reviewed By: tbr-dave


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664932 13f79535-47bb-0310-9956-ffa450edef68
2007-01-19 20:09:51 +00:00
Mark Slee
b6200d82f6 Add comma-separated list of type "slist" to thrift
Summary: Useful for API arguments

Reviewed By: tbr-dave


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664931 13f79535-47bb-0310-9956-ffa450edef68
2007-01-19 19:14:36 +00:00
Mark Slee
782abbb756 Add xsd_all keyword to Thrift
Summary: Makes a struct an xsd_all instead of a sequence

Reviewed By: dave


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664929 13f79535-47bb-0310-9956-ffa450edef68
2007-01-19 00:17:02 +00:00
Mark Slee
0e0ff7e003 Thrift now generates XSD files
Summary: Are you fucking kidding me? This shit is robust.

Reviewed By: fetter-tbr-d00d


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664928 13f79535-47bb-0310-9956-ffa450edef68
2007-01-18 22:59:59 +00:00
Mark Slee
ace6e6dbc0 Resolve typedefs in php generation
Reviewed By: xsd


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664927 13f79535-47bb-0310-9956-ffa450edef68
2007-01-18 20:00:11 +00:00
Mark Slee
032606bb72 Fix changing struct name bug on C++ generation
Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664925 13f79535-47bb-0310-9956-ffa450edef68
2007-01-18 06:54:43 +00:00
Mark Slee
f3763a1fae Do not generate write code for null fields in Java
Summary: It will make null pointer exceptions!

Reviewed By: martin, alex


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664923 13f79535-47bb-0310-9956-ffa450edef68
2007-01-18 02:35:27 +00:00
Mark Slee
7628fd7444 Add mkdir for bin in thrift compiler
Reviewed By: dcorson


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664922 13f79535-47bb-0310-9956-ffa450edef68
2007-01-18 01:16:51 +00:00
Mark Slee
12f6631735 Fix bugs with php_namespace keyword in thrift
Reviewed By: aditya

 line, and those below, will be ignored--

M    t_php_generator.cc


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664921 13f79535-47bb-0310-9956-ffa450edef68
2007-01-17 19:19:21 +00:00
Mark Slee
5ec19933cb Resolve complex typedefs in Thrift
Summary: For function returns

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664917 13f79535-47bb-0310-9956-ffa450edef68
2007-01-16 23:53:53 +00:00
Mark Slee
a340e0d6fe Thrift should generate C++ enums first before typdefs
Summary: In case you want to typedef an enum

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664916 13f79535-47bb-0310-9956-ffa450edef68
2007-01-16 23:00:31 +00:00
Mark Slee
406a40cf16 Prefix generated _args and _result helper classes with service name
Summary: To avoid conflicts when you have two services with the same name inside one .thrift file

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664915 13f79535-47bb-0310-9956-ffa450edef68
2007-01-16 22:48:22 +00:00
Mark Slee
a45909b619 Thrift C++ code generator returns complex types by reference
Summary: Efficiency, Yo.

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664910 13f79535-47bb-0310-9956-ffa450edef68
2007-01-12 21:44:14 +00:00
Mark Slee
529bfeef97 Committing code gen changes for const ref args to functions in Thrift
Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664909 13f79535-47bb-0310-9956-ffa450edef68
2007-01-12 02:10:16 +00:00
Mark Slee
e888b376ad Add PHP namespacing support to Thrift
Summary: "php_namespace Whoa" at the top of your Thrift file, then all your defined class names start with "Whoa_"

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664908 13f79535-47bb-0310-9956-ffa450edef68
2007-01-12 01:06:24 +00:00
Mark Slee
f12865a338 Disallow keywords in Thrift files
Summary: Or else you are bound to get shitty errors in some generated languages.. They're not all covered here, but a lot of them are.

Reviewed By: dougb, bobby


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664907 13f79535-47bb-0310-9956-ffa450edef68
2007-01-12 00:23:26 +00:00
Mark Slee
706da40237 Fix exceptions throw() and virtual destructor
Reviewed By: yishan


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664897 13f79535-47bb-0310-9956-ffa450edef68
2006-12-16 00:59:29 +00:00