Commit Graph

666 Commits

Author SHA1 Message Date
Kevin Clark
120ff31d11 THRIFT-148. py: Add support for Twisted
Author: Esteve Fernandez

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@749510 13f79535-47bb-0310-9956-ffa450edef68
2009-03-03 02:25:50 +00:00
Bryan Duxbury
f4c71c73d0 THRIFT-116. java: Isset fields for non-primitive types unnecessary
Prior commit on this issue was missing a !.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@747090 13f79535-47bb-0310-9956-ffa450edef68
2009-02-23 17:49:24 +00:00
Bryan Duxbury
f9d105c519 THRIFT-116. java: Isset fields for non-primitive types unnecessary
Missed one of the cases where isset was being used on non-primitive fields.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@746429 13f79535-47bb-0310-9956-ffa450edef68
2009-02-21 01:57:46 +00:00
Bryan Duxbury
d11f2411e2 THRIFT-116. java: Isset fields for non-primitive types unnecessary
This patch gets rid of the __isset fields for non-primitives and updates ToStringTest and EqualityTest appropriately.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@746000 13f79535-47bb-0310-9956-ffa450edef68
2009-02-19 21:21:44 +00:00
David Reiss
554ea6f936 Make the PHP generator use non-hardcoded namespaces.
- Make the PHP generator use program->get_namespace("php")
  instead of program->get_php_namespace()
- Eliminate the explicit "php_namespace" in t_program.
- Deprecate the php_namespace token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745241 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:28:37 +00:00
David Reiss
32272d9bd8 Allow the Thrift compiler to be built without the PHP generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-php
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745240 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:28:30 +00:00
David Reiss
bba692833d Remove t_php_generator.h.
t_php_generator.h is no longer included anywhere, because
the PHP generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745239 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:28:28 +00:00
David Reiss
a9ea68b907 Make the PHP generator dynamic.
- Modify the PHP generator constructor to fit the new generic interface.
- Register the PHP genrator with the central registry.
- Deprecate the old way of invoking the PHP generator.
- main.cc no longer includes t_php_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745238 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:28:24 +00:00
David Reiss
92e10d8297 Make the XSD generator use non-hardcoded namespaces.
- Make the XSD generator use program->get_namespace("xsd")
  instead of program->get_xsd_namespace()
- Eliminate the explicit "xsd_namespace" in t_program.
- Deprecate the xsd_namespace token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745237 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:28:19 +00:00
David Reiss
782cb67a3b Allow the Thrift compiler to be built without the XSD generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-xsd
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745236 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:28:13 +00:00
David Reiss
3ac5b6aa85 Remove t_xsd_generator.h.
t_xsd_generator.h is no longer included anywhere, because
the XSD generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745235 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:28:10 +00:00
David Reiss
4ba6710ea1 Make the XSD generator dynamic.
- Modify the XSD generator constructor to fit the new generic interface.
- Register the XSD genrator with the central registry.
- Deprecate the old way of invoking the XSD generator.
- main.cc no longer includes t_xsd_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745234 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:28:06 +00:00
David Reiss
f3b0db3735 Allow the Thrift compiler to be built without the Erlang generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-erl
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745233 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:28:01 +00:00
David Reiss
9f16d78553 Remove t_erl_generator.h.
t_erl_generator.h is no longer included anywhere, because
the Erlang generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745232 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:27:58 +00:00
David Reiss
a204783a06 Make the Erlang generator dynamic.
- Modify the Erlang generator constructor to fit the new generic interface.
- Register the Erlang genrator with the central registry.
- Deprecate the old way of invoking the Erlang generator.
- main.cc no longer includes t_erl_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745231 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:27:54 +00:00
David Reiss
bbbbe880a0 THRIFT-325. Include t_generator.h in main.cc
I'm about to remove all of the generator includes, but we'll still need
the generic header for the generator registry and interface.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745230 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:27:48 +00:00
David Reiss
d831a21773 THRIFT-309. Make Thrift's C# mapping .NET 2.0 (Mono 1.2.4) compatible
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@743963 13f79535-47bb-0310-9956-ffa450edef68
2009-02-13 03:09:52 +00:00
Bryan Duxbury
30e1de9fd5 THRIFT-316. java: @Override isn't generated for hashCode() without the hash code builder
Fixed with a trivial reorganization of the hashCode method generation.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@743046 13f79535-47bb-0310-9956-ffa450edef68
2009-02-10 18:36:56 +00:00
Bryan Duxbury
c707855048 THRIFT-318. java: Performance of HashSet for enumeration VALID_VALUES seems poor
Instead of a HashSet, enums will now use the special IntRangeSet implementation. 

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@743037 13f79535-47bb-0310-9956-ffa450edef68
2009-02-10 18:10:57 +00:00
David Reiss
6ad6251951 java: Fix a minor formatting problem in the gen-code
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@742192 13f79535-47bb-0310-9956-ffa450edef68
2009-02-08 22:46:38 +00:00
Bryan Duxbury
bb7826da70 THRIFT-10. java: Descriptors used during serialization should be immutable objects
-Descriptor classes all have final members, making them immutable.
-Generated structs now have static constant versions of their TStruct and TField descriptors, and will be used during writing.
-Protocols that can benefit use static constants for various common returned descriptors.
-A duplicate FieldMetaData.java that should have been removed previously was also removed.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741984 13f79535-47bb-0310-9956-ffa450edef68
2009-02-08 00:12:38 +00:00
Bryan Duxbury
f28f82631a THRIFT-159. csharp: Compiler doesn't add package scope to exceptions in catch blocks and assigns to unused local var when reading
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741917 13f79535-47bb-0310-9956-ffa450edef68
2009-02-07 17:17:43 +00:00
David Reiss
a7fc092ee1 THRIFT-256. python: Fix inheritance of services in the same IDL file
The old version of type_name did not fully qualify parent service names
when they were defined in the same IDL file, but it is necessary because
they end up in different Python files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741833 13f79535-47bb-0310-9956-ffa450edef68
2009-02-07 02:37:09 +00:00
David Reiss
8cee47cf5e THRIFT-310. python: Generate valid code for empty services
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741832 13f79535-47bb-0310-9956-ffa450edef68
2009-02-07 02:37:05 +00:00
David Reiss
0b7d6fa5ee THRIFT-314. Purge reflection.limited
This was a feature designed to allow a Thrift server to report
information about its interface.  However, the feature has
significant design problems, and is presence is currently causing
confusion without doing any good.  Therefore, it is being removed.
It will always be in source control if and when we are ready to
come back to it.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741824 13f79535-47bb-0310-9956-ffa450edef68
2009-02-07 02:36:35 +00:00
Bryan Duxbury
d20a1d3619 THRIFT-303. java: Changes to __isset interface
This patch makes __isset always private and adds a method per field to set the __isset state when not using the bean-style generator.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741805 13f79535-47bb-0310-9956-ffa450edef68
2009-02-07 01:08:58 +00:00
Bryan Duxbury
3d0abc36a9 THRIFT-132. ruby: Ruby generator should use ::Thrift::Foo namespace form
All of the Thrift library includes now prefix with ::.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@740377 13f79535-47bb-0310-9956-ffa450edef68
2009-02-03 19:18:57 +00:00
Bryan Duxbury
f5383b663e THRIFT-297. java: getFieldValue and setFieldValue should be abstract TBase methods
This patch makes getFieldValue, setFieldValue, and isSet TBase interface methods, and adds all the previously beans-only getters and setters to all Java generated classes. 

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@740169 13f79535-47bb-0310-9956-ffa450edef68
2009-02-03 00:49:25 +00:00
Bryan Duxbury
056bcb6947 THRIFT-178. java, csharp, cpp: Final Keyword
The lexer has been changed to make "final" a non-reserved word, and the java, csharp, and cpp compilers now look for the final annotation and amend their class declarations appropriately.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739788 13f79535-47bb-0310-9956-ffa450edef68
2009-02-01 16:56:29 +00:00
David Reiss
c2c8ad8f0b THRIFT-259. html: Generate "extends" link for extended services
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739700 13f79535-47bb-0310-9956-ffa450edef68
2009-02-01 05:36:10 +00:00
David Reiss
4704d4383c THRIFT-285. python: Don't generate _result structs for async functions
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739668 13f79535-47bb-0310-9956-ffa450edef68
2009-02-01 00:42:10 +00:00
T Jake Luciani
b5e6221eb5 THRIFT-270: change cpp namespaces from facebook::thrift to apache::thrift
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739644 13f79535-47bb-0310-9956-ffa450edef68
2009-01-31 22:36:20 +00:00
Bryan Duxbury
796381d857 THRIFT-290. java: Metadata map doesn't properly reference external thrift file's types
The code generator now uses full namespaces to refer to the classes.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739045 13f79535-47bb-0310-9956-ffa450edef68
2009-01-29 22:13:56 +00:00
Bryan Duxbury
9f427ee0e1 THRIFT-288. java: Generated code iterates maps during write inefficiently
Newly generated code will now use entrySet instead of keySet when serializing maps. Existing generated classes does not need to be regenerated, though they won't reap the performance improvements unless they do.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@738765 13f79535-47bb-0310-9956-ffa450edef68
2009-01-29 05:47:21 +00:00
Bryan Duxbury
1f6302fab0 THRIFT-218. java: When validation fails on serialization/deserialization, print out the invalid object
The error thrown when validation fails now contains the toString output.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@738764 13f79535-47bb-0310-9956-ffa450edef68
2009-01-29 05:38:10 +00:00
Bryan Duxbury
986d705578 THRIFT-253. java: Enhance FieldMetaData
The code generator new creates a static map of field id to metadata for each field, including information like the field TType, class of embedded structs, required/optional/default, etc. Additionally, on loading, generated classes statically register their class and metadata map with the global FieldMetaData map, so you can get the metadata for any TBase-implementing class easily.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@738708 13f79535-47bb-0310-9956-ffa450edef68
2009-01-29 01:51:08 +00:00
Bryan Duxbury
369417a5f1 THRIFT-239. java: Generate @Override annotations for all overrided methods
equals, toString, clone, and hashcode now all have a preceeding @Override annotation.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@738270 13f79535-47bb-0310-9956-ffa450edef68
2009-01-27 22:09:33 +00:00
Bryan Duxbury
8bbd8447b9 THRIFT-223 Validate method should check that enum types are assigned valid values
Enum classes now get a VALID_VALUES Set that contains all of the acceptable values. Structs' validate() method has been extended to compare an enum field's value to the valid value set, but only if the __isset flag for that field is true, meaning that non-beans generated code will not perform this validity check unless the __isset flag is manually maintained.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@735910 13f79535-47bb-0310-9956-ffa450edef68
2009-01-20 01:54:14 +00:00
Bryan Duxbury
46b77c4be6 THRIFT-224 Validate method should check that enum types are assigned valid values
Each generated enumeration type will now have a VALID_VALUES Set as a static member that contains all the values of the enumeration.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@735167 13f79535-47bb-0310-9956-ffa450edef68
2009-01-16 22:34:40 +00:00
Bryan Duxbury
afa80ea73d THRIFT-34 Java libraries should be namespaced under org.apache.thrift, not com.facebook.thrift
Library classes and tests have been moved to the proper package and directory structure, and references to com.facebook.thrift where replaced with org.apache.thrift throughout the code. The fb303 contrib project still contains com.facebook packages.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@734855 13f79535-47bb-0310-9956-ffa450edef68
2009-01-15 23:47:51 +00:00
David Reiss
46bb4aeb5e THRIFT-242. python: Used named arguments in __init__ instead of a dict
This is a wire-compatible but non-source-compatible change.
When initializing structures, you must use

Foo(bar=1, baz="qux")
Foo(**{"bar": 1, "baz": "qux"})

instead of

Foo({"bar": 1, "baz": "qux"})


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@734536 13f79535-47bb-0310-9956-ffa450edef68
2009-01-14 22:34:15 +00:00
David Reiss
7bcf866c16 THRIFT-249. java: Add @param lines to function docstrings
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@732116 13f79535-47bb-0310-9956-ffa450edef68
2009-01-06 20:54:27 +00:00
David Reiss
c654416843 THRIFT-129. csharp: Make all Thrift structures extend TBase
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@732081 13f79535-47bb-0310-9956-ffa450edef68
2009-01-06 19:49:33 +00:00
David Reiss
b0f31ef92f THRIFT-46. csharp: Throw the correct exception for an unknown method
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@732080 13f79535-47bb-0310-9956-ffa450edef68
2009-01-06 19:49:29 +00:00
David Reiss
6319133cac THRIFT-25. csharp: Various compiler and library improvements
Compiler:
- Thrift structures are serializable.
- The member fields of thrift structures are now private and only accessible
  through Properties, which keep the appropriate __isset up to date.

Library
- Addition of TBufferedTransport, which can be used to wrap other Transports.
- Addition of TThreadedServer, which manually manages threads instead of
  relying on .NET ThreadPool.
- Servers use a log delegate that defaults to System.Console but allows
  servers to use log4net without introducing the dependency.

ThriftTest Visual Studio Project
- Test client and server that use ThriftTest.thrift. The project references
  thrift.exe and Thrift.dll from the subversion tree and automatically builds
  generated code. This makes it very easy to test changes in both the compiler
  and library.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@732079 13f79535-47bb-0310-9956-ffa450edef68
2009-01-06 19:49:22 +00:00
Kevin Clark
d6b7182df5 THRIFT-246. rb: Generate #struct_fields rather than reflect.
Author: Bryan Duxbury


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731806 13f79535-47bb-0310-9956-ffa450edef68
2009-01-06 01:34:28 +00:00
Kevin Clark
41baeaba96 THRIFT-157. rb: Quote strings and qualify class names properly
Author: Dave Engberg


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731763 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 23:10:17 +00:00
David Reiss
8eaebfedc1 THRIFT-235. java: Explicitly cast integer constants to double
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731723 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 21:03:01 +00:00
David Reiss
25be92bf0d THRIFT-222. java: Better exposure if __isset in beans style
- Generate an isSet method for each field to test its set-ness.
- Generate a generic isSet method that checks by field id.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731722 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 21:02:58 +00:00
David Reiss
2db737df8f java: Add a helper function to implement nocamel style
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731721 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 21:02:55 +00:00
David Reiss
b936ffdbd1 THRIFT-191. java: Create a static field id -> name map for each struct
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731720 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 21:02:52 +00:00
David Reiss
5455f00348 THRIFT-138. java: Fix copy constructor for binary fields
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731719 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 21:02:48 +00:00
David Reiss
888f88b05d THRIFT-241. python: Generate a better implementation of __repr__
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731685 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 20:14:52 +00:00
T Jake Luciani
41687fc6cf THRIFT-193: Patch for proper namespace support in perl compiler
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@728863 13f79535-47bb-0310-9956-ffa450edef68
2008-12-23 03:45:43 +00:00
David Reiss
a8efac862a THRIFT-225. java/cpp: Handle non-i32 integer constants properly
Java generates a warning when converting from an integer constant
to a byte or short without an explicit cast.  This change adds a
cast to byte and short literals in Java.

Both Java and C++ fail to compile integer literals larger than 2^31
unless they are decorated with "L" (for Java) or "LL" (for g++).
This change adds the appropriate decorations.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@727130 13f79535-47bb-0310-9956-ffa450edef68
2008-12-16 20:28:13 +00:00
David Reiss
a230999667 THRIFT-121. Support arbitrary type annotations
Adds syntax for attaching arbitrary key/value pairs to types.
These annotations can be accessed by individual generators to alter
the code they produce.

This version supports annotations on container types and structures.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@724954 13f79535-47bb-0310-9956-ffa450edef68
2008-12-10 01:52:48 +00:00
David Reiss
603d50437c THRIFT-138. java: Create deep-copy constructors for Thrift structs
- Create a copy constructor for every Thrift struct.  The constructor
  performs a deep copy on the argument, resulting in no shared state.
- Make thrift structions implement Cloneable and implement .clone()
  using the copy constructor.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@722332 13f79535-47bb-0310-9956-ffa450edef68
2008-12-02 02:06:31 +00:00
David Reiss
fd71808e35 THRIFT-142. java: Better handling of required fields
- On reading, behave the same way as the C++ code:
  throw an exception if a required field is missing.
- In addition, throw an exception if a required field is missing
  when writing.  For the JavaBeans code, this means that __isset
  is false (because it is maintained automatically).  For non-beans
  code, this means that the field is null.  Non-nullable fields are
  not checked in non-beans code.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719727 13f79535-47bb-0310-9956-ffa450edef68
2008-11-21 21:55:52 +00:00
David Reiss
e31b77e90e THRIFT-194. cpp: Properlyl namespace exception types in catch
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719721 13f79535-47bb-0310-9956-ffa450edef68
2008-11-21 21:36:41 +00:00
David Reiss
30a9360e3f THRIFT-172. java: Improve toString output for binary fields
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719720 13f79535-47bb-0310-9956-ffa450edef68
2008-11-21 21:31:36 +00:00
David Reiss
7f5e184785 THRIFT-139. java: Fix indentation in beans mode
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719701 13f79535-47bb-0310-9956-ffa450edef68
2008-11-21 20:25:14 +00:00
David Reiss
466b3fafcd Remove compiler/cpp/version.h in "make clean"
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719380 13f79535-47bb-0310-9956-ffa450edef68
2008-11-20 21:24:32 +00:00
Kevin Clark
031baf7086 Merge branch 'THRIFT-143'
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@714070 13f79535-47bb-0310-9956-ffa450edef68
2008-11-14 17:11:39 +00:00
Kevin Clark
159383f789 rb: raise if an object is serialized without required fields [THRIFT-143]
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@712945 13f79535-47bb-0310-9956-ffa450edef68
2008-11-11 05:46:04 +00:00
Kevin Clark
cfca336fad rb: Add docstrings to generated ruby code [THRIFT-147]
Author: Bryan Duxbury


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@709309 13f79535-47bb-0310-9956-ffa450edef68
2008-10-31 00:32:25 +00:00
David Reiss
f33e03c6fa THRIFT-179. java: Include per-field docstrings in generated code
This also involves refactoring a bit of the functionality into
t_oop_generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@708737 13f79535-47bb-0310-9956-ffa450edef68
2008-10-29 00:07:49 +00:00
David Reiss
f011bd4312 Make t_field inherit from t_doc instead of reimplementing it
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@708736 13f79535-47bb-0310-9956-ffa450edef68
2008-10-29 00:07:45 +00:00
David Reiss
66f5e9ba0b Make a pointer const to fix a warning
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@707213 13f79535-47bb-0310-9956-ffa450edef68
2008-10-22 22:07:03 +00:00
David Reiss
80096e278c Add a missing include to fix compilation on Ubuntu 8.10
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@707212 13f79535-47bb-0310-9956-ffa450edef68
2008-10-22 22:07:00 +00:00
David Reiss
dc0aada961 THRIFT-173. Commit the html generator
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@706466 13f79535-47bb-0310-9956-ffa450edef68
2008-10-21 00:09:23 +00:00
Kevin Clark
7dc7f75e7c rb: Create constants for field ids in generated structs [THRIFT-165]
Author: Bryan Duxbury


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@705330 13f79535-47bb-0310-9956-ffa450edef68
2008-10-16 19:15:20 +00:00
David Reiss
31997ca9ee THRIFT-139. java: Expose field ids in more useful ways
- Define constants in each structure class that provide access to the
  field ids by name (at compile time).  Use them for (de)serialization.
- For beans-mode code, generate a generic getter and setter for accessing
  fields by field id.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@703028 13f79535-47bb-0310-9956-ffa450edef68
2008-10-09 00:08:46 +00:00
David Reiss
a0b4409f57 THRIFT-152. java: Set isset appropriately in structure constructors
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@702697 13f79535-47bb-0310-9956-ffa450edef68
2008-10-08 04:49:25 +00:00
David Reiss
8684554e29 THRIFT-119. java: structs' toString omits unset optional fields
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@700860 13f79535-47bb-0310-9956-ffa450edef68
2008-10-01 18:32:47 +00:00
David Reiss
931d69be9e THRIFT-120. java: Make the nocamel option work for more methods
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@700668 13f79535-47bb-0310-9956-ffa450edef68
2008-10-01 03:24:54 +00:00
David Reiss
5af01bcbdc THRIFT-100. java: Set __isset better in beans style
When setX(null) is called on a structure, set __isset.x to false.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@700667 13f79535-47bb-0310-9956-ffa450edef68
2008-10-01 03:24:50 +00:00
Mark Slee
6341d13a1f Python generator exception namespacing, THRIFT-150
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@700277 13f79535-47bb-0310-9956-ffa450edef68
2008-09-29 22:01:30 +00:00
Kevin Clark
5ad6d4a7e3 rb: Add pretty inspect, optional field hint for Thrift::Struct
Author: Bryan Duxbury


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@689193 13f79535-47bb-0310-9956-ffa450edef68
2008-08-26 20:02:07 +00:00
David Reiss
400a543b04 THRIFT-91. cpp: Fix compilation on Fedora Core 9
It turns out that __STDC_LIMIT_MACROS is not portable.
Include limits.h at least until cstdint becomes mainstream.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@679885 13f79535-47bb-0310-9956-ffa450edef68
2008-07-25 19:48:39 +00:00
David Reiss
70e329f0b8 java: Add nocamel option to not CamelCase field accessors [THRIFT-42]
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@676699 13f79535-47bb-0310-9956-ffa450edef68
2008-07-14 19:35:50 +00:00
David Reiss
aabfa63c47 (THRIFT-40) Remove stray \n's from the generated version.h
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672945 13f79535-47bb-0310-9956-ffa450edef68
2008-06-30 22:27:29 +00:00
David Reiss
4d8edc5269 (THRIFT-40) Fix compilation and version string on OS X.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672943 13f79535-47bb-0310-9956-ffa450edef68
2008-06-30 21:55:52 +00:00
David Reiss
f14541626d Partial handlling of 64-bit integer constants.
- Parse integer constants in Thrift files as 64-bit ints.
- Die if an overflow occurs.
- Warn if an enum value cannot fit in 32 bits.
- Add a simple test for the above.

I ran all of the generators over BrokenConstants.thrift before adding the
overflow, and they appeared to work.  However, the code generated was not
always valid (for example, the 64-bit constant must have an LL suffix in C++).


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672907 13f79535-47bb-0310-9956-ffa450edef68
2008-06-30 20:45:47 +00:00
David Reiss
dd08f6d5a5 (THRIFT-40) Add -version switch to the compiler to show the Thrift version
The version is determined by configure.ac. After this version is shown the
revision. For subversion, it is simply the current revision as given by
`svnversion`. For git, the latest svn revision that HEAD includes is shown,
followed by the offset of HEAD from that commit, followed by a truncated sha1
for HEAD. If the offset is 0, the offset and sha1 are omitted.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672900 13f79535-47bb-0310-9956-ffa450edef68
2008-06-30 20:24:24 +00:00
Kevin Clark
2bd3a30b91 rb: Use File.dirname(__FILE__) in generated requires [THRIFT-57]
This means you no longer have to put the gen-rb folder in $:

Author: Kevin Ballard <kevin@rapleaf.com>


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@671963 13f79535-47bb-0310-9956-ffa450edef68
2008-06-26 17:49:49 +00:00
Kevin Clark
3836f9ba35 rb: require 'thrift' first in generated service definitions [THRIFT-38]
From kevin@rapleaf.com


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670979 13f79535-47bb-0310-9956-ffa450edef68
2008-06-24 01:05:51 +00:00
Kevin Clark
23193757bc rb: Implement type-checking in Thrift::Struct.new and field accessors
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669015 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:18:07 +00:00
Kevin Clark
8d79e3f954 Convert fields of type Thrift::Types::SET to use the Set library.
Also teach Thrift::Struct how to compare itself with ==


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668959 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:09:15 +00:00
Kevin Clark
18e21565b3 Fix the requires generated by the compiler
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668934 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:03:17 +00:00
Kevin Clark
2960044415 rb: Add more classes/modules to the Thrift namespace. Provide backwards compatable mappings.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668904 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:54:13 +00:00
David Reiss
4d1c712ad1 Eliminate some trailing whitespace from the generated Python code.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666492 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:18:03 +00:00
David Reiss
ab55ed53e3 Include limits.h in the compiler for PATH_MAX
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666491 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:17:00 +00:00
David Reiss
cc0c9e98b5 Clean up some bad/missed merges from the alterl merge.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666486 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:16:29 +00:00
David Reiss
e20b972088 [erl] fix generator to use unexpanded structs for reply_types on functions
This fixes a bug where thrift_client would return a tuple rather than a tagged record when the called function returned a struct.

Test plan:
  in tutorial client:
    Log: {sharedStruct,1,<<"RARG">>}
  instead of:
    Log: {1,<<"RARG">>}


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666482 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:15:54 +00:00
David Reiss
9f2a5d7799 Rename "alterl" to "erl".
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666481 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:15:45 +00:00
David Reiss
f2e66c1cb7 Remove all of the old Erlang stuff in preparation for renaming alterl.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666480 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:14:38 +00:00
David Reiss
1a2f2187cd Another whitespace rampage
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666477 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:14:01 +00:00
David Reiss
81b473b4a1 Fix warning in generated source for alterl bindings
Summary:
  - Was previously including both the fall-through to the base service as well as the "dummy" fallthrough function clause. This generated a warning like:

  gen-erl/redacted_thrift.erl:134: Warning: this clause cannot match because a previous clause at line 132 always matches

  Now we only include the "dummy" function if there is no base class to fall through to.

Test plan: Generated tutorial.thrift and shared.thrift, compiled without warnings

Notes: It's probably possible to have a circular inheritance graph, which would cause an infinite loop at runtime. Do we care about this?


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666423 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 00:58:41 +00:00
David Reiss
1d8b752971 Implement inheritance in the alterl generator
Summary:
  - Simply forwards function_info calls through to the base service

Test plan: cpiro will test it?


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666422 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 00:58:33 +00:00
David Reiss
cdf8d1994a Implement async_void in alterl bindings
Summary:
  - reply_type for async void functions is now async_void instead of
    the empty struct definition
  - async void functions should return "ok". otherwise the processor
    will crash and the connection will be killed. Is this behaviour
    expected?

Test Plan: tested using testAsync() in ThriftTest. Didn't used to work
           but works now


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666415 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 00:57:35 +00:00
David Reiss
982c72de7b Properly handle exceptions
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666384 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:58:33 +00:00
David Reiss
11300fe872 Properly uncapitalize package names when referencing structs
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666379 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:57:52 +00:00
David Reiss
0c9b516506 Fix generation when multiple services are in the same service definition
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666378 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:57:44 +00:00
David Reiss
76f0d11dc9 Generator for alternative erl bindings, as well as a few more changes to lib code.
- Exceptions don't work yet, but it looks like everything else does.
- Seems to work fine on our pricing service
- Code could need some cleanup


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666377 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:57:35 +00:00
David Reiss
a1e0a6f0d8 Don't generate a constants file if there are no constants (Java only).
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666372 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:56:43 +00:00
David Reiss
87e9ac6382 Fix a bug with initialization in JavaBean-style generated code.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666371 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:56:34 +00:00
David Reiss
5245f40b3e Print an error instead of segfaulting with a bad compiler command line.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666370 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:56:26 +00:00
David Reiss
9d866ac231 Add newlines to some warning messages in the compiler.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666369 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:56:19 +00:00
David Reiss
0babe40d74 Fix some warnings caused by treating string literals as non-const.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666368 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:56:12 +00:00
David Reiss
d14f4f86d4 Fix some indentation in the PHP generator.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666366 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:55:54 +00:00
David Reiss
c0092f973d PHP Generator: Throw an exception on bad types.
Summary:
Previously, if you set a structure field to, say, an int when it was
supposed to be a container (array) or struct (object), the serialization
code would either produce corrupt output (container) or cause a fatal
error (struct).  Now they both throw exceptions.

Reviewed By: mcslee

Test Plan: Looked at generated code.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666365 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:55:46 +00:00
David Reiss
c89e4de509 Make sure list<byte> is List<Byte> in Java gen'd code.
Reviewed By: dreiss

Test Plan: Generate list<byte> into Java


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666357 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:54:32 +00:00
David Reiss
8df6c82aa7 Switch md5 implementations.
Specifically, switch from the legally-ambiguous RSA implementation to
a zlib-licensed RFC-based implementation from SourceForge.

Generated some files with "dense" and made sure the output hadn't changed.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665679 13f79535-47bb-0310-9956-ffa450edef68
2008-05-04 03:00:22 +00:00
David Reiss
de59292f38 Remove an unnecessary include of boost/lexical_cast.hpp
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665678 13f79535-47bb-0310-9956-ffa450edef68
2008-05-01 20:51:03 +00:00
David Reiss
28f298dd5d Memory-based transport rewrite.
The old implementations of the memory-based transports (TBufferedTransport,
TFramedTransport, and TMemoryBuffer) shared very little code and all worked
a bit differently.  This change unifies them all as subclasses of a single
base (TBufferBase) which handles the fast-path operations (when requests
can be satisfied by the buffer) with inline methods (that will eventually
be made nonvirtual in the template branch) and calls out to pure-virutal
methods to handle full/empty buffers.  All of the buffer-management is now
done in terms of "base and bound" pointers rather than "pos" integers.

These classes were moved to TBufferTransports.{h,cpp}.  The .h is included
in TTransportUtils for backwards compatibility.

Also added a "TShortReadTransport" to assist testing transports.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665676 13f79535-47bb-0310-9956-ffa450edef68
2008-05-01 06:17:36 +00:00
David Reiss
9a4edfa07f Properly handle constants of typedef'ed types.
Also throw an error in the compiler if we cannot generate a constant for a
declared const because of its type.  Added a test of this functionality in
ConstantsDemo.thrift.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665675 13f79535-47bb-0310-9956-ffa450edef68
2008-05-01 05:52:50 +00:00
David Reiss
372126079c Eliminate an unused local variable.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665674 13f79535-47bb-0310-9956-ffa450edef68
2008-05-01 05:52:49 +00:00
David Reiss
74672b6719 Java: In toString for generated structs, handle nulls.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665671 13f79535-47bb-0310-9956-ffa450edef68
2008-04-29 23:09:11 +00:00
David Reiss
051fbd4e57 Thrift REST parsing allows null object params
Summary: If JSON objects are passed in allow them to be null and don'\''t default construct.

Reviewed By: dreiss

Test Plan: Regenerate API code and test on object args.

Revert: OK

DiffCamp Revision: 12407


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665670 13f79535-47bb-0310-9956-ffa450edef68
2008-04-29 00:29:45 +00:00
David Reiss
739cbe2b86 Add a few missing includes.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665657 13f79535-47bb-0310-9956-ffa450edef68
2008-04-15 05:44:00 +00:00
iproctor
8361bf0565 ocaml and haskell thrift clients now calling readMessageEnd
Summary: I neglected to make the call to readMessageEnd if the client read an app exception in the haskell and ocaml code. Fixed now. The test cases for both now also compile with the new ThriftTest.thrift (though haskell's is still not doing anything but echoing  the args)

Reviewed By: dreiss

Test Plan: Ran test code. This bug would actually never show up because there's only tbinaryprotocol implemented for these languages and that does nothing on a readMessageEnd.

Revert: OK

DiffCamp Revision: 11377


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665651 13f79535-47bb-0310-9956-ffa450edef68
2008-04-10 00:31:55 +00:00
David Reiss
c5c542538b Fix some indentation.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665639 13f79535-47bb-0310-9956-ffa450edef68
2008-04-03 23:16:46 +00:00
David Reiss
8bfba63dfb C#: Generate proper code for services that inherit from other services.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665632 13f79535-47bb-0310-9956-ffa450edef68
2008-04-02 22:10:13 +00:00
David Reiss
f5ece05649 Fix a segfault in the compiler.
We weren't initializing our pointers properly, resulting in
a difficult-to-trigger segfault.

Reviewed By: mcslee, bhamadani

Test Plan: Built the modified search IDL.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665627 13f79535-47bb-0310-9956-ffa450edef68
2008-04-02 00:23:31 +00:00
David Reiss
07ef3a930a Make the Perl generator use non-hardcoded namespaces.
- Make the Perl generator use program->get_namespace("perl")
  instead of program->get_perl_package()
- Eliminate the explicit "perl_package" in t_program.
- Deprecate the perl_package token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665624 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:42:39 +00:00
David Reiss
fdc21aa713 Allow the Thrift compiler to be built without the Perl generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-perl
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665623 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:42:34 +00:00
David Reiss
fb63533c78 Remove t_perl_generator.h.
t_perl_generator.h is no longer included anywhere, because
the Perl generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665622 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:42:30 +00:00
David Reiss
2b386c50d7 Make the Perl generator dynamic.
- Modify the Perl generator constructor to fit the new generic interface.
- Register the Perl genrator with the central registry.
- Deprecate the old way of invoking the Perl generator.
- main.cc no longer includes t_pl_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665621 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:42:23 +00:00
David Reiss
6a4b82c4b7 Make the Ruby generator use non-hardcoded namespaces.
- Make the Ruby generator use program->get_namespace("ruby")
  instead of program->get_ruby_namespace()
- Eliminate the explicit "ruby_namespace" in t_program.
- Deprecate the ruby_namespace token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665620 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:42:16 +00:00
David Reiss
ae253583e7 Allow the Thrift compiler to be built without the Ruby generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-ruby
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665619 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:42:11 +00:00
David Reiss
6e93b454ec Remove t_rb_generator.h.
t_rb_generator.h is no longer included anywhere, because
the Ruby generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665618 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:42:06 +00:00
David Reiss
a640cea9ae Make the Ruby generator dynamic.
- Modify the Ruby generator constructor to fit the new generic interface.
- Register the Ruby genrator with the central registry.
- Deprecate the old way of invoking the Ruby generator.
- main.cc no longer includes t_rb_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665617 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:42:01 +00:00
David Reiss
c53b184c12 Remove an unused helper function in the Ruby generator.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665616 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:58 +00:00
David Reiss
320e45ce8b Make the Python generator use non-hardcoded namespaces.
- Make the Python generator use program->get_namespace("py")
  instead of program->get_py_module()
- Eliminate the explicit "py_module" in t_program.
- Deprecate the py_module token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665615 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:54 +00:00
David Reiss
bfd26dcecc Allow the Thrift compiler to be built without the Python generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-py
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665614 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:49 +00:00
David Reiss
0d6eb969e1 Remove t_py_generator.h.
t_py_generator.h is no longer included anywhere, because
the Python generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665613 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:45 +00:00
David Reiss
558e3993e1 Make the Python generator dynamic.
- Modify the Python generator constructor to fit the new generic interface.
- Register the Python genrator with the central registry.
- Deprecate the old way of invoking the Python generator.
- main.cc no longer includes t_py_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665612 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:40 +00:00
David Reiss
9d65bf061f Make the C# generator use non-hardcoded namespaces.
- Make the C# generator use program->get_namespace("csharp")
  instead of program->get_csharp_namespace()
- Eliminate the explicit "csharp_namespace" in t_program.
- Deprecate the csharp_namespace token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665611 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:37 +00:00
David Reiss
ce4f4f0cbd Allow the Thrift compiler to be built without the C# generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-csharp
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665610 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:31 +00:00
David Reiss
2dfdb2d7f7 Remove t_csharp_generator.h.
t_csharp_generator.h is no longer included anywhere, because
the C# generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.

Also cleaned up its includes a little bit.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665609 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:27 +00:00
David Reiss
861869b734 Make the C# generator dynamic.
- Modify the C# generator constructor to fit the new generic interface.
- Register the C# genrator with the central registry.
- Deprecate the old way of invoking the C# generator.
- main.cc no longer includes t_csharp_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665608 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:23 +00:00
David Reiss
919ae80934 Fix a stale debug message.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665607 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:11 +00:00
David Reiss
54b602b746 Make the Cocoa generator use non-hardcoded namespaces.
- Make the Cocoa generator use program->get_namespace("cocoa")
  instead of program->get_cocoa_prefix()
- Eliminate the explicit "cocoa_prefix" in t_program.
- Deprecate the cocoa_prefix token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665606 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:06 +00:00
David Reiss
4b349aabc9 Allow the Thrift compiler to be built without the Cocoa generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-cocoa
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665605 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:02 +00:00
David Reiss
e21ce4c6ca Remove t_cocoa_generator.h.
t_cocoa_generator.h is no longer included anywhere, because
the Cocoa generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665604 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:59 +00:00
David Reiss
d01c64dec5 Make the Cocoa generator dynamic.
- Modify the Cocoa generator constructor to fit the new generic interface.
- Register the Cocoa genrator with the central registry.
- Deprecate the old way of invoking the Cocoa generator.
- main.cc no longer includes t_cocoa_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665603 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:55 +00:00
David Reiss
be9757568f Put a newline at the end of the generated header file in the Cocoa generator.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665602 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:52 +00:00
David Reiss
3b45501b52 Make the Smalltalk generator use non-hardcoded namespaces.
- Make the Smalltalk generator use program->get_namespace("smalltalk.*")
  instead of program->get_smalltalk_{category|prefix}()
- Eliminate the explicit "smalltalk_{category|prefix}" in t_program.
- Deprecate the smalltalk_{category|prefix} tokens.
- Update example .thrift files and syntax files.

This was a little more complex than the others.  We now convert "." to "-"
in Smalltalk categories, because we no longer lex them as tok_st_identifier.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665601 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:46 +00:00
David Reiss
b3ac8a6c72 Allow the Thrift compiler to be built without the Smalltalk generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-st
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665600 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:42 +00:00
David Reiss
2b6ba090dc Remove t_st_generator.h.
t_st_generator.h is no longer included anywhere, because
the Smalltalk generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665599 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:38 +00:00
David Reiss
a890b5714e Make the Smalltalk generator dynamic.
- Modify the Smalltalk generator constructor to fit the new generic interface.
- Register the Smalltalk genrator with the central registry.
- Deprecate the old way of invoking the Smalltalk generator.
- main.cc no longer includes t_st_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665598 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:35 +00:00
David Reiss
73dc1431d1 Make the Smalltalk generator respect the "-o" flag.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665597 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:30 +00:00
David Reiss
22812f8be8 Allow the Thrift compiler to be built without the Haskell generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-hs
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665596 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:26 +00:00
David Reiss
42e6d51437 Remove t_hs_generator.h.
t_hs_generator.h is no longer included anywhere, because
the Haskell generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665595 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:20 +00:00
David Reiss
af3ab2619d Make the Haskell generator dynamic.
- Modify the Haskell generator constructor to fit the new generic interface.
- Register the Haskell genrator with the central registry.
- Deprecate the old way of invoking the Haskell generator.
- main.cc no longer includes t_hs_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665594 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:16 +00:00
David Reiss
3d671b5e53 Allow the Thrift compiler to be built without the OCaml generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-ocaml
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665593 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:11 +00:00
David Reiss
7bb71df6ef Remove t_ocaml_generator.h.
t_ocaml_generator.h is no longer included anywhere, because
the Ocaml generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665592 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:08 +00:00
David Reiss
f0521b1305 Make the OCaml generator dynamic.
- Modify the OCaml generator constructor to fit the new generic interface.
- Register the OCaml genrator with the central registry.
- Deprecate the old way of invoking the OCaml generator.
- main.cc no longer includes t_ocaml_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665591 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:05 +00:00
David Reiss
b4d7b89efd Make generate_program virtual.
Haskell and OCaml need to override this to put typedefs at the end.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665590 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:01 +00:00
David Reiss
237171ee81 Whitespace-only change for consistency.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665589 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:39:58 +00:00
David Reiss
f10984b589 Include <cassert> in main.cc.
We are doing an assert in main, but the assert header is being pulled in
by an include that is about to go.  Make it explicit.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665587 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:39:52 +00:00
David Reiss
c934268249 Delete code generators after using them.
This has been leaking memory in the compiler, but it has also been
preventing the dynamic generators destructors from being called.
This can prevent a stream from being flushed properly.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665586 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:39:49 +00:00
David Reiss
4b83d6ddeb Allow nested namespaces to be used in perl.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665584 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 19:45:19 +00:00
David Reiss
0c703cc2f8 Fix some small bugs in the Perl generator.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665582 13f79535-47bb-0310-9956-ffa450edef68
2008-03-25 18:38:56 +00:00
David Reiss
62f0d5428d Remove an unnecessary "else" from the generated Thrift code.
The "if" block here always results in a return (or an exception),
so there is no need for an "else".  We can just put the rest of the code
under the "if" block.  This actually makes a little more sense because
the "if" block here is an exceptional case.

Also deleted a stale comment.

Reviewed By: lhastings

Test Plan: diff'ed the old and new code.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665580 13f79535-47bb-0310-9956-ffa450edef68
2008-03-21 21:50:41 +00:00
Mark Slee
dcdf25b003 Fix compiler __construct gen in php
Reviewed By: dreiss

Test Plan: Build payments


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665578 13f79535-47bb-0310-9956-ffa450edef68
2008-03-19 20:16:35 +00:00
David Reiss
968bed847e Initialize the binary_ field of t_base_type.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665574 13f79535-47bb-0310-9956-ffa450edef68
2008-03-18 18:22:26 +00:00
David Reiss
cdfbeb8d75 Public access to the protocols in C# Thrift clients.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665573 13f79535-47bb-0310-9956-ffa450edef68
2008-03-18 18:22:14 +00:00
David Reiss
b79acc9f60 Some optimizations to the C# generated code.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665572 13f79535-47bb-0310-9956-ffa450edef68
2008-03-18 18:21:58 +00:00
David Reiss
6d94390375 Don't allow async (no return) functions that throw exceptions.
This wouldn't work anyway.  Better to catch it early.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665570 13f79535-47bb-0310-9956-ffa450edef68
2008-03-14 00:51:42 +00:00
Christopher Piro
21c95a31ee [thrift] cleanup generated trailing whitespace in php
Summary: Verfolgenplaatze sind verboten!

Reviewed By: kder

Test Plan: no

Revert Plan: yes


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665569 13f79535-47bb-0310-9956-ffa450edef68
2008-03-12 04:28:43 +00:00
dweatherford
6b53bbb778 [thrift] Move readMessageEnd inside of else block for accelerated protocol
Summary: Otherwise, readMessageEnd will be performed twice; once in the extension and once in PHP-land. Since TBinaryProtocol readMessageEnd is a no-op this isn't a huge deal, but it's bad style.
Reviewed By: mcslee
Test Plan: Inspect generated php code
Revert: OK
TracCamp Project: Thrift
DiffCamp Revision: 9155


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665567 13f79535-47bb-0310-9956-ffa450edef68
2008-03-11 02:42:45 +00:00
David Reiss
0e913a6381 Add an accessor for the I/O protocols of Thrift clients.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665565 13f79535-47bb-0310-9956-ffa450edef68
2008-03-07 20:28:31 +00:00
David Reiss
6987535d65 Change the Java help to be a little more consistent.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665553 13f79535-47bb-0310-9956-ffa450edef68
2008-03-04 21:10:41 +00:00
David Reiss
4ac9267cf8 Don't declare getStaticLimitedReflection if gen_reflection_limited_ is off.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665552 13f79535-47bb-0310-9956-ffa450edef68
2008-03-04 21:10:38 +00:00
David Reiss
a014788f73 Changed an awkward if/else if/else to be slightly less awkward.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665551 13f79535-47bb-0310-9956-ffa450edef68
2008-03-04 21:10:34 +00:00
dweatherford
cf997a45c6 [thrift] PHP thrift_protocol extension, revision 2.0
Summary:
  All PHP serialization and deserialization can now happen in extension-land,
  which should be much faster. This includes reading message headers and all
  complex types (structs, exceptions, whatever).

  The compiler has been updated to always emit the $_TSPEC static array for
  generated PHP code, since the new extension depends on it.

  As before, the PHP code gates enabling the accelerated serialization on
  the protocol being an instance of TBinaryProtocolAcclerated and the function
  for the [de]serialization operation existing.

  The function names have changed since the last version of the extension,
  so old and new generated code can coexist, and new generated code can run on
  a server with the old extension (but it will not use accelerated serialization).

Reviewed by: hzhao
Test Plan: Generated a couple of endpoints and called their services through the
  new extension. Both use a variety of nested complex types. Built and ran the
  extension in php-5.2.3 in debug mode, killed the reported memory leaks.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665548 13f79535-47bb-0310-9956-ffa450edef68
2008-03-04 01:08:23 +00:00
David Reiss
9f646157f0 Fix a typo in a warning message in thrifty.yy.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665547 13f79535-47bb-0310-9956-ffa450edef68
2008-03-02 21:59:48 +00:00
David Reiss
14feb4127c Generate quality overrides of hashCode for Thrift structs (in Java).
This feature is turned off by default because it adds a new dependency:
Apache Commons Lang.  This package seems enough like Boost that
I would be open to turning this feature on by default.

Also updated test/java/build.xml to use this new option.
ant test still passes.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665542 13f79535-47bb-0310-9956-ffa450edef68
2008-03-02 06:29:23 +00:00
David Reiss
3b15ebc251 Add support for .equals() to Java structs.
- Add a new method to t_java_generator that generates a .equals() method.
- Add a correct but useless implementation of hashCode for structs.
  (This is required by conventino when overriding .equals().)
- Add java_package to DebugProtoTest and OptionalRequiredTest.
- Add a new structure to OptionalRequiredTest to assist testing the behavior
  of .equals() with respect to null and unset fields.
- Clean up test/java/build.xml a bit.  (It still has a ways to go.)
- Add EqualityTest.java to test .equals().
- Add IdentityTest.java to test that writing and reading a structure
  preserves equality.

Tested by runnint atn test.
I also looked at the generated code for OptionalRequiredTest.thrift.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665541 13f79535-47bb-0310-9956-ffa450edef68
2008-03-02 06:29:19 +00:00
David Reiss
4b6a3c7a68 Fix a subtle bug in cpp_use_include_path.
Summary:
I thought I had eliminated all the places where work was only done
if cpp_use_include_path was set.  I guess I missed one.

Reviewed By: mcslee, mrabkin, kholst

Test Plan:
Built BigGrep and looked at the generated code.

Revert Plan: ok

DiffCamp Revision: 8375


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665530 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 22:28:12 +00:00
David Reiss
cf2e8d9af3 Add an operator< for Thrift structs (in C++).
Some people want to use sets of Thrift structs.  This has interesting
implications, but it is a reasonable request.  However, in C++,
this requires structures to have a less-than operator.
It seems a little dangerous to auto-generate an arbitrary comparator,
but allowing users to define their own operator< implementations
seems fine.  This change makes that a lot easier.

The one downside of this change is that developers who try to compare
structures with operator< (including trying to make sets of them)
will now get a linker error instead of a compiler error.
However, the old compiler error was so scary that
I'm not sure this is any worse.

Reviewed By: kholst, mcslee

Test Plan: make check


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665527 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 19:38:51 +00:00
David Reiss
10ae20f684 Fix a warning message.
Forgot to update this when copy-pasting.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665521 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 07:45:10 +00:00
David Reiss
4ce2874fd5 Make limited reflection optional (off by default).
Limited reflection is deprecated, and it is slowing down compilation.
This change will disable generation of static reflection by default,
but it adds a command line argument to re-enable it.

Tested by running make check and building the C++ test client and server.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665520 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 07:45:05 +00:00
Mark Slee
b1b8079e62 Make compiler work on cpp_includes with < in them
Reviewed By: spiantino

Test Plan: build multifeed aggregator


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665518 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 04:29:34 +00:00
David Reiss
e8a87de867 Allow the Thrift compiler to be built without the Java generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-java
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665517 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 02:39:25 +00:00
David Reiss
22585733e1 Allow the Thrift compiler to be built without the C++ generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-cpp
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665516 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 01:55:33 +00:00
David Reiss
771f8c797b Make the Java generator use non-hardcoded namespaces.
- Make the Java generator use program->get_namespace("java")
  instead of program->get_java_namespace()
- Eliminate the explicit "java_namespace" in t_program.
- Deprecate the java_namespace token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665514 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 01:55:25 +00:00
David Reiss
9a08dc6184 Make the C++ generator use non-hardcoded namespaces.
- Make the C++ generator use program->get_namespace("cpp")
  instead of program->get_cpp_namespace()
- Eliminate the explicit "cpp_namespace" in t_program.
- Deprecate the cpp_namespace token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665513 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 01:55:17 +00:00
David Reiss
79eca14125 Infrastructure for a language-neutral namespace declaration.
Altered the once-deprecated "namespace" directive in .thrift files
to take two identifiers: the language and the namespace.
They are stored in a map inside of the program object.
Future changes will convert specific generators to use this map
and deprecate the old language-specific tokens.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665512 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 01:55:13 +00:00
David Reiss
dc61be9650 Remove t_java_generator.h.
t_java_generator.h is no longer included anywhere, because
the Java generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.

Also cleaned up its includes a little bit.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665511 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 01:55:09 +00:00
David Reiss
e1404d21ac Make the Java generator dynamic.
- Modify the Java generator constructor to fit the new generic interface.
- Register the Java genrator with the central registry.
- Deprecate the old way of invoking the Java generator.
- main.cc no longer includes t_java_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665510 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 01:55:05 +00:00
David Reiss
52812f98db Remove t_cpp_generator.h.
t_cpp_generator.h is no longer included anywhere, because
the C++ generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.

Also cleaned up its includes a little bit.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665509 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 01:54:59 +00:00
David Reiss
400cd4be38 Make the C++ generator dynamic.
- Modify the C++ generator constructor to fit the new generic interface.
- Register the C++ genrator with the central registry.
- Deprecate the old way of invoking the C++ generator.
- main.cc no longer includes t_cpp_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665508 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 01:54:55 +00:00
David Reiss
bd0db88477 Infrastructure for loading code generators a bit more dynamically.
Add a generic and easy-to-use mechanism for Thrift code generators to
register themselves centrally.  The central registry is used to
obtain documentation for the options accepted by individual generators
and get instances of individual generators.  It also does a little bit of
option parsing that will be useful for all generators.

Obviously, this change cannot be tested on its own.  I can only say
that Thrift still builds and runs correctly.  Subsequent changes
will apply this infrastructure to specific code generators.
Steve Grimm has assured me that this is standard Git practice.

In fact, I ran this test after converting the C++ and Java generators:

dreiss@dreiss-vmware:dynamic_generators:thrift/test$ mkdir old new
dreiss@dreiss-vmware:dynamic_generators:thrift/test$ cd old
dreiss@dreiss-vmware:dynamic_generators:thrift/test/old$ ../../compiler/cpp/thrift -cpp -dense -java -javabean ../DebugProtoTest.thrift
[WARNING::1] -cpp is deprecated.  Use --gen cpp
[WARNING::1] -java is deprecated.  Use --gen java
[WARNING::1] -javabean is deprecated.  Use --gen java:beans
dreiss@dreiss-vmware:dynamic_generators:thrift/test/old$ cd ../new/
dreiss@dreiss-vmware:dynamic_generators:thrift/test/new$ ../../compiler/cpp/thrift --gen cpp:dense --gen java --gen java:beans ../DebugProtoTest.thrift
dreiss@dreiss-vmware:dynamic_generators:thrift/test/new$ cd ..
dreiss@dreiss-vmware:dynamic_generators:thrift/test$ diff -ur old/ new/
dreiss@dreiss-vmware:dynamic_generators:thrift/test$


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665507 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 01:54:51 +00:00
David Reiss
9cc2c13710 Make warnings from the Thrift compiler a little clearer.
Reviewed by: mcslee

Warning and error messages from the Thrift compiler include
the file currently being parsed and the line number.
This change sets those to dummy values for stages that
have nothing to do with parsing.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665506 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 01:54:47 +00:00
David Reiss
0e18224473 Tighten integration with Ruby exceptions by tying in Exception#message
For Thrift exceptions that contain only a single string field, integrate
these even more tightly with Ruby exceptions by aliasing Ruby's
Exception#message field with the Thrift field.

Ruby exception objects created by Thrift will now display properly in
Ruby backtraces, etc. without any special handling by client code.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665503 13f79535-47bb-0310-9956-ffa450edef68
2008-02-26 06:40:25 +00:00
David Reiss
68ccc699a3 Move Ruby fielded object creation from generated constructor to ThriftStruct
Rather than the generated code needing to handle simple fielded
creation of objects, the ThriftStruct module constructor is extended to
handle hash arguments. Statements such as

  o = ThriftObject.new :field1 => value1, :field2 => value2, ...

are supported as before, and the string form,

  o = ThriftObject.new "field1" => value1, "field2" => value2, ...

disabled by the previous patch now also works.

Placing this code in the module is also just a cleaner solution.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665502 13f79535-47bb-0310-9956-ffa450edef68
2008-02-26 06:40:22 +00:00
David Reiss
ebbfbd8395 Ruby exception constructor bugfix
The Ruby exception constructor is modified to accept 0 arguments, which is
how Thrift library code creates exception objects. Without this fix, Thrift
Ruby clients that receive exception objects crash.

The call to super (resolving to ThriftStruct#initialize) is retained, but
is called with the default value (an empty hash) instead of passing the
message along.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665501 13f79535-47bb-0310-9956-ffa450edef68
2008-02-26 06:40:16 +00:00
David Reiss
2ca456a8ae Make "make clean" rules a bit more standard.
Summary:
make-generic is some sort of internal undocumented thing.
make-local is what is supposed to be used for this stuff.
Also use $(RM) instead of "rm -f".

Reviewed By: marc

Test Plan: make clean


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665498 13f79535-47bb-0310-9956-ffa450edef68
2008-02-24 16:42:18 +00:00
David Reiss
c91d07c784 Fix a typo in the C# generator.
Actually, it is not a typo.  The original authors didn't convert one call
to get_java_package to get_csharp_namespace.

Tested by building Thrift.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665489 13f79535-47bb-0310-9956-ffa450edef68
2008-02-20 05:30:55 +00:00
David Reiss
399442be81 Fix a typo
Reviewed By: mcslee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665488 13f79535-47bb-0310-9956-ffa450edef68
2008-02-20 02:28:05 +00:00
David Reiss
c005b1b65e Thrift: Distinguish between string and binary types in C++ and Java.
Summary:
The upcoming TJSONProtocol handles string and binary types quite differently.
This change makes that distinction in all parts of the C++ binding.

Java already distinguished between string and binary, but this change
also updates the Java skip method to skip over strings as binary
so we don't get encoding errors when skipping binary data.

Reviewed By: mcslee

Test Plan: make check

Revert Plan: ok

Other Notes:
I just pulled this out of Chad Walters' JSON patch.
The only other change was adding readBinary (or was it writeBinary)
to TDenseProtocol.  Maybe inheriting from TBinaryProtocol wasn't a good idea.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665481 13f79535-47bb-0310-9956-ffa450edef68
2008-02-15 01:38:18 +00:00
eletuchy
bbf8062e4f [thrift] making generated php struct readers more compact
Summary: introducing a $bin_accel variable in struct reader scope that
         can be reference by the deserializers of each field

Reviewed By: dreiss, mcslee

Test Plan: regenerated a thrift service, compared before and after calls

Revert Plan: sure


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665478 13f79535-47bb-0310-9956-ffa450edef68
2008-02-13 22:44:24 +00:00
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