Commit Graph

736 Commits

Author SHA1 Message Date
Roger Meier
213a664798 THRIFT-582 C(c_glib) implementation of Thrift
Patch: Anatol Pomozov and Michael Lum


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1027933 13f79535-47bb-0310-9956-ffa450edef68
2010-10-27 12:30:11 +00:00
Roger Meier
5e64d51efc THRIFT-916 t_java_generator.cc: remove compiler warnings for enumerations not handled in switch
Patch: Christian Lavoie


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1023317 13f79535-47bb-0310-9956-ffa450edef68
2010-10-16 15:54:36 +00:00
Roger Meier
421dfbea63 THRIFT-807 JavaScript: Initialization of Base Types with 0 instead of null
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1023073 13f79535-47bb-0310-9956-ffa450edef68
2010-10-15 19:12:44 +00:00
Roger Meier
3b76fa3638 THRIFT-955 remove CharLowerBuff function for mingw based Thrift Compiler
=> no lowercase names and directories which was inconsistent for using across different platforms



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1022630 13f79535-47bb-0310-9956-ffa450edef68
2010-10-14 17:56:03 +00:00
Roger Meier
0069cc4a29 THRIFT-916 no errors on GNU/Linux when compiling with CXXFLAGS="-Wall -Wextra -pedantic"
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1022220 13f79535-47bb-0310-9956-ffa450edef68
2010-10-13 18:10:18 +00:00
Bryan Duxbury
b3d0aa0c82 THRIFT-946. java: Augment FieldValueMetaData so it differentiates 'string' and 'binary' fields.
This patch adds a new method to the FieldMetaData class that indicates binary or not.

Patch: Mathias Herberts

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005220 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 20:00:03 +00:00
David Reiss
ef6a1766ce THRIFT-927. php: Option to support modifying the PHP include path
Make the PHP generator recognize a new-style namespace called "php.path".
If it is present, it is segmented and used as a path to include the
generated code.  (It goes between "packages" and the Thrit file basename.)

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005172 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:10:55 +00:00
David Reiss
44ff76f514 THRIFT-925. cpp: Add _VALUES_TO_NAMES enum map
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005143 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:10:15 +00:00
David Reiss
64637511d2 THRIFT-924. php: Fix missing comma in generated PHP struct constants
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005142 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:10:13 +00:00
David Reiss
c3b3622158 THRIFT-922. cpp: Add profiling code to help conversion to C++ templates
Add some profiling code to track when potentially unnecessary virtual
calls are made in the thrift C++ serialization and deserialization code.
This can be used to help service implementors determine which places in
their code should be updated to use an appropriate thrift template
class.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005140 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:10:10 +00:00
David Reiss
2324871334 THRIFT-928. cpp: Thrift Server Client Stats
Add the ability for Thrift servers to monitor client connections.  It is
activated by #including server/TClientInfo.h and creating 1) a
TClientInfoCallHandler passed to the processor with setEventHandler()
and 2) a TClientInforServerHandler passed to the server with
setServerEventHandler().

The result vector, showing active connections, provides client address
and the thrift call it is executing (or last executed), the time
connected, and the number of calls made since connection.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005139 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:10:08 +00:00
David Reiss
b7762a032a THRIFT-922. cpp: Update C++ generator to emit templatized code
When the "templates" option is passed to the C++ generator, it now emits
templatized versions of the client and processor.  Generated types emit
templatized read() and write() functions.

This allows the generated code to invoke the correct non-virtual
TTransport and TProtocol implementations, resulting in faster
serialization and deserialization.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005138 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:10:00 +00:00
David Reiss
c6b4cab89c THRIFT-923. cpp: Add completion notification to async clients
Add a virtual function "completed__(bool)" to xxxCobClient that is
called by recv_xxx() after reception of a response (arg = true) or an
exception (arg = false). This allows the TAsyncClient to intercede at
that point, permitting, e.g., the load-balancing of persistent
connections that would otherwise remain bound to a single server.

A new "no_client_completion" flag inhibits generation of this mechanism.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005131 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:45 +00:00
David Reiss
f62126dbb3 THRIFT-928. cpp: Prefix function name with service name
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005130 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:43 +00:00
David Reiss
ef7200f6e8 THRIFT-928. cpp: Include request/response size in processor callbacks
Required updating transport interface.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005129 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:42 +00:00
David Reiss
18cd0f0334 THRIFT-928. cpp: Make clients call writeEnd on their transports before flush
Changing the order of these calls makes more sense from the perspective
of logical operations.  It also simplifies the upcoming stats collection
code.  No clients should be affected.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005128 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:39 +00:00
David Reiss
5ddabb8e3f THRIFT-923. cpp: Implement a fully nonblocking server and client
There are three major parts of this:
1/ New callback-style interfaces for for a few key Thrift components:
   TAsyncProcessor for servers and TAsyncChannel for clients.
2/ Concrete implementations of TAsyncChannel and a server for
   TAsyncProcessor based on evhttp.
3/ Async-style code generation for C++

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005127 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:37 +00:00
David Reiss
d7192063e1 THRIFT-928. cpp: Processor-level event callbacks
- Add a TProcessorEventHandler callback interface.
- Add methods to TProcessor to hold an instance of the interface.
- Add code to the compiler to make the processor call callbacks at key points.
- Add an optional processor event handler to the test server.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005126 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:33 +00:00
Bryan Duxbury
1df96ce22f THRIFT-945. java: TAsyncClient class's currentMethod is never set, hence a second call on the same client will fail if a previous call is ongoing.
This patch adds a test for the problem and fixes the issue by setting the current method after a call has been started.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1004865 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 00:28:10 +00:00
David Reiss
41d3058dbf THRIFT-868. Make const values work properly with typdefs
Just requires calling get_true_type in the right spot.  Because "the
right spot" is under src/parse, get_true_type had to be moed from
t_generator to t_type.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1004703 13f79535-47bb-0310-9956-ffa450edef68
2010-10-05 16:39:29 +00:00
David Reiss
9e7ba8cbac compiler: Move t_type::generate_fingerprint to a .cc file
Forcing all of the functions under src/parse to be defined in header
files is silly and sometimes painful.  Createa a "parse.cc" file for
functions that don't belong in header files.  To start, move
generate_fingerprint there, because it requires including md5.h.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1004702 13f79535-47bb-0310-9956-ffa450edef68
2010-10-05 16:39:27 +00:00
Bryan Duxbury
a406b90fa2 THRIFT-787. compiler: Enums are not read correctly
This patch removes unnecessary enum value resolution code from all the individual generators. It's been unnecessary since forever ago when we made the compiler force the global resolution of values.

Patch: Christian Lavoie

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1001966 13f79535-47bb-0310-9956-ffa450edef68
2010-09-27 23:37:44 +00:00
Anthony F. Molinaro
71a58a8764 THRIFT-918 : better haskell tests
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1001883 13f79535-47bb-0310-9956-ffa450edef68
2010-09-27 19:27:40 +00:00
Anthony F. Molinaro
daef1c8ed0 THRIFT-743: seems to compile and doesn't break other tests, so seems fine for now
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1001353 13f79535-47bb-0310-9956-ffa450edef68
2010-09-26 04:25:36 +00:00
T Jake Luciani
6461d56d02 THRIFT-911: fix for trailing commas in sets, lists, maps, consts
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@999728 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 02:33:06 +00:00
Bryan Duxbury
75a33e858f THRIFT-906. hs: Improve type mappings
This patch fixes the type mappings to be more sane. It *will* break existing code, but the breakages should be well worth it.

Patch: Christian Lavoie

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@999700 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 00:48:56 +00:00
Bryan Duxbury
1237dcb099 THRIFT-880. javame: JavaME code generator and runtime library
This patch adds a new generator and library that produces code suitable for use in JavaME environments.

Patch: David Engberg

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@999022 13f79535-47bb-0310-9956-ffa450edef68
2010-09-20 17:49:09 +00:00
Bryan Duxbury
f38b2f10fb THRIFT-901. hs: Allow the bindings to compile without -fglasgow-exts and with -Wall -Werror
Forgot a small chunk of the previous patch.

Patch: Christian Lavoie

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@999019 13f79535-47bb-0310-9956-ffa450edef68
2010-09-20 17:41:40 +00:00
Bryan Duxbury
e59a80fbf9 THRIFT-901. hs: Allow the bindings to compile without -fglasgow-exts and with -Wall -Werror
This patch makes the bindings compile with pedantic warning levels, and individually declares each required language extension.

Patch: Christian Lavoie

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@998955 13f79535-47bb-0310-9956-ffa450edef68
2010-09-20 15:21:37 +00:00
Bryan Duxbury
d920765c66 THRIFT-882. java: deep copy of binary fields does not copy ByteBuffer characteristics (arrayOffset, position)
This patch ensures that binary fields are copied correctly.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@998275 13f79535-47bb-0310-9956-ffa450edef68
2010-09-17 19:27:36 +00:00
David Reiss
bdd6261b33 Fix enum value lookups in C++
The recent enum change was causing enums to break if used as constant
values by the C++ generator.  The problem was that we were searching for
the fully-qualified constant name (enum_name.VALUE_NAME) in the enum
values.  This didn't affect Java because it just uses symbolic names in
the generated code.  Fix it by grabbing the base name before doing the
search.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996610 13f79535-47bb-0310-9956-ffa450edef68
2010-09-13 17:32:14 +00:00
David Reiss
8d7667c27f Don't segfault if t_enum::get_constant_by_name fails
The recent enum change was causing t_enum::get_constant_by_name to fail
in t_const_value::get_integer.  This was causing a difficult-to-debug
segfault.  Check for failure and throw an exeception.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996609 13f79535-47bb-0310-9956-ffa450edef68
2010-09-13 17:32:13 +00:00
Bryan Duxbury
d4235e0a47 THRIFT-870. java: Java constants don't get Javadoc comments
Fix a trivial oversight.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996592 13f79535-47bb-0310-9956-ffa450edef68
2010-09-13 16:28:53 +00:00
Bryan Duxbury
a7420b6593 THRIFT-894. java: Make default accessors for binary fields return byte[]; provide new accessors to get ByteBuffer version
This patch causes the underlying ByteBuffer that backs a binary field to be hidden behind a default accessor that provides a byte[] interface. This should allow users who skipped 0.4 to update their generated code without breaking any of their other code. A new accessor has been added that allows a way down to the underlying ByteBuffer for those experts who want to take advantage.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996579 13f79535-47bb-0310-9956-ffa450edef68
2010-09-13 15:42:36 +00:00
Bryan Duxbury
76ecb91c3d THRIFT-897. compiler: Don't allow unqualified enum constant access
Fix some confusion in the java generator about adding the class name.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996327 13f79535-47bb-0310-9956-ffa450edef68
2010-09-12 15:29:38 +00:00
Bryan Duxbury
cb0218f5c8 THRIFT-897. compiler: Don't allow unqualified enum constant references
Missed a spot.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996325 13f79535-47bb-0310-9956-ffa450edef68
2010-09-12 15:22:21 +00:00
Bryan Duxbury
9f0a786dad THRIFT-897. compiler: Don't allow unqualified constant access to enum values
This patch makes it illegal to refer to enum values by just their names in the IDL. Now, you must also provide the enum type's name as well.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996320 13f79535-47bb-0310-9956-ffa450edef68
2010-09-12 14:38:36 +00:00
David Reiss
b6c50e5658 THRIFT-895. cpp: By default, generate enums as class-scoped enums
Most of the other Thrift languages either have enum values that are
scoped to the type or emulate enums in that way.  Now C++ does the same
by default.  "enum Foo" in a .thrift file will be generated as Foo::type
so the values can be called Foo::value1, etc.  The "pure_enums" compiler
option restores the old behavior.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996015 13f79535-47bb-0310-9956-ffa450edef68
2010-09-10 23:00:40 +00:00
Bryan Duxbury
04650afb87 THRIFT-544. erl: multiple enums with the same key generate invalid code
This adds the enum name to the generated constants to avoid collisions.

Patch: Ben Taitelbaum

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@995924 13f79535-47bb-0310-9956-ffa450edef68
2010-09-10 18:49:53 +00:00
Bryan Duxbury
bbff4a8e7e Fix to the catch-all namespace commit
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@992458 13f79535-47bb-0310-9956-ffa450edef68
2010-09-03 20:36:02 +00:00
David Reiss
fb790d7262 Allow "*" as a catch-all namespace.
In an IDL file, you can can now declare "namespace * foo",
which will apply to any language not explicitly specified.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@992012 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 16:41:45 +00:00
Bryan Duxbury
c377c32168 THRIFT-257. py: Support validation of required fields
Patch: Esteve Fernandez

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991987 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 15:37:19 +00:00
Bryan Duxbury
c43ec6247a THRIFT-634. csharp: C# Compiler Generates Incorrect Code For Fields which begin with an uppercase letter
Added a '_' to the backing field, and changed all the field references to refer to the property instead.

Patch: Jon S Akhtar

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991960 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 14:58:51 +00:00
Bryan Duxbury
1316ed9d16 THRIFT-673. py: Generated Python code has whitespace issues
This patch trims several forms of trailing whitespace.

Patch: Ian Eure

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991945 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 14:20:01 +00:00
Bryan Duxbury
727d67dcfa THRIFT-721. py: THttpClient ignores url parameters
Respect query string in THttpClient and generated remotes. Also, add an error message on unknown methods.

Patch: Thomas Kho

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991786 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 01:00:19 +00:00
Bryan Duxbury
773b8dbf30 THRIFT-805. cocoa: Don't generate process_XXXX methods for oneway methods
Patch: Brad Taylor

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991783 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 00:43:16 +00:00
Bryan Duxbury
e02d6118bf THRIFT-838. cocoa: Generated Cocoa classes have useless @dynamic declarations
This patch removes the @dynamic properties.

Patch: Kevin Ballard

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991779 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 00:29:08 +00:00
Bryan Duxbury
cd9f200b9d THRIFT-884. html: HTML Generator: add Key attribute to the Data Types Tables
This patch adds the Key attribute to the Data Types Tables.

Patch: Roger Meier

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991775 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 00:12:22 +00:00
Bryan Duxbury
0f4078dbf5 THRIFT-860. ocaml: copy method and reset method
The attached patch provides the class copying and reset-to-default values methods.

Patch: Lev Walkin

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991774 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 00:07:20 +00:00
David Reiss
5ad126044d THRIFT-874. Include missing time.h in two compiler files
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991255 13f79535-47bb-0310-9956-ffa450edef68
2010-08-31 16:51:30 +00:00
David Reiss
4563acdd23 THRIFT-865. Make Thrift buildable without libfl
yywrap is only needed if we need one lexer context to traverse multiple
input files.  This feature isn't used by Thrift, so we disable it with
"option noyywrap".  With yywrap disabled, there is no need to link to
libfl if flex is the lex implementation used.

With this patch, release tarballs can be built without lex.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991254 13f79535-47bb-0310-9956-ffa450edef68
2010-08-31 16:51:29 +00:00
David Reiss
ef5e81b1ac THRIFT-507. Only use Boost for building the C++ library
- Make AX_BOOST_BASE warn instead of fataling if Boost is not found.
- If Boost is not found, disable compilation of the C++ library.
- Do not use CPPFLAGS or LDFLAGS from Boost when building the compiler.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991253 13f79535-47bb-0310-9956-ffa450edef68
2010-08-31 16:51:28 +00:00
David Reiss
aca320d395 THRIFT-507. Stop using boost::lexical_cast in the compiler
We were using boost::lexical_cast to convert an integer to a string,
but using a stringstream is only slightly more complicated.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991252 13f79535-47bb-0310-9956-ffa450edef68
2010-08-31 16:51:26 +00:00
David Reiss
38f8959779 THRIFT-507. ruby: Stop using boost::tokenizer
Previously, the Ruby generated used boost::tokenizer to produce a
vector of namespace components from a dot-delimited namespace string.
We can do this manually with only a slight increase in complexity.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991251 13f79535-47bb-0310-9956-ffa450edef68
2010-08-31 16:51:25 +00:00
David Reiss
bfab32a3b3 THRIFT-507. smalltalk: Remove an unnecessary include (boost/tokenizer)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991250 13f79535-47bb-0310-9956-ffa450edef68
2010-08-31 16:51:24 +00:00
David Reiss
eb207273ea erlang: Make the gen-code return a special value for bogus functions
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990978 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:27 +00:00
David Reiss
f32d0fb900 Rollback a few recent Erlang changes to fix blame data
My combined patch for THRIFT-599 was committed, but it is preferable
commit the individual patches to preserve the more detailed log and
blame data.  I'll recommit r987018 as a sequence of patches and r988722
as its own rev.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990957 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:00 +00:00
Bryan Duxbury
4d8a9cd569 THRIFT-877. compiler: smalltalk namespace doesn't work
This patch adds a special case to map 'smalltalk' to 'st' when checking for valid namespace declarations.

Patch: Bruce Lowekamp

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990866 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 17:09:58 +00:00
David Reiss
e3ba3490de Clean up some style from r987565
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@989948 13f79535-47bb-0310-9956-ffa450edef68
2010-08-26 21:49:45 +00:00
Bryan Duxbury
66467a7779 THRIFT-693. java: Thrift compiler generated java code that throws compiler warnings about deprecated methods.
This patch removes the deprecated methods from TBase and makes some generator changes to accommodate.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@987805 13f79535-47bb-0310-9956-ffa450edef68
2010-08-21 17:48:18 +00:00
Bryan Duxbury
c39817c9a7 THRIFT-859. py: Allow py:twisted to be generated in different namespace than py
This patch adds support for the 'twisted' sub-namespace to the python code generator.

Patch: Bruce Lowekamp

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@987566 13f79535-47bb-0310-9956-ffa450edef68
2010-08-20 16:45:13 +00:00
Bryan Duxbury
681f5eae6d compiler: make a standard way for language generators to accept sub-namespaces
This patch adds a new method to t_generator that allows the compiler to avoid special cases in checking for sub-namespaces in the Thrift IDL.

Patch: Bruce Lowekamp

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@987565 13f79535-47bb-0310-9956-ffa450edef68
2010-08-20 16:42:04 +00:00
Bryan Duxbury
d3879f80c6 THRIFT-599. erl: Don't use unnecessary processes in the Erlang transports and clients
The only user-visible changes are to the client. Every thrift call now returns {NewClient, Result} instead of just Result.

Patch: David Reiss (assist to Anthony Molinaro)

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@987018 13f79535-47bb-0310-9956-ffa450edef68
2010-08-19 05:06:02 +00:00
Bryan Duxbury
4d0e2b48bf THRIFT-852. Missing newline causes many compiler warnings
This patch adds a newline to the end of t_generator_registry.h

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@985771 13f79535-47bb-0310-9956-ffa450edef68
2010-08-15 22:57:07 +00:00
Bryan Duxbury
66c334792b THRIFT-827. ocaml: OCaml generator to take default values into account
A patch to the OCaml generator which uses default values defined in the .thrift file to initialize the members of the generated class. 

Patch: Lev Walkin

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@985041 13f79535-47bb-0310-9956-ffa450edef68
2010-08-12 23:37:47 +00:00
David Reiss
e2350512c9 THRIFT-676. cpp: Move __isset definition for SWIG-compatibility
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@984979 13f79535-47bb-0310-9956-ffa450edef68
2010-08-12 21:15:04 +00:00
Bryan Duxbury
07b2ed1df5 THRIFT-832. html: HTML generator shows unspecified struct fields as 'required'
This patch causes required/optional/default to reported appropriately.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@984868 13f79535-47bb-0310-9956-ffa450edef68
2010-08-12 17:21:06 +00:00
Bryan Duxbury
34b530f099 THRIFT-570. Thrift compiler does not error when duplicate method names are present
This patch causes the compiler to throw an exception when duplicate method names are found.

Patch: Bruce Simpson

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@984628 13f79535-47bb-0310-9956-ffa450edef68
2010-08-12 01:48:51 +00:00
Bryan Duxbury
f5abd26858 THRIFT-830. java: Switch binary field implementation from byte[] to ByteBuffer
This patch switches the implementation of binary fields to ByteBuffer in the Java generated code, yielding up to 2.5x speed boost.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982839 13f79535-47bb-0310-9956-ffa450edef68
2010-08-06 00:18:25 +00:00
Bryan Duxbury
7f3285eddb THRIFT-434. ruby compiler should warn when a reserved word is used
This patch adds a bunch of new reserved words to the lexer.

Patch: Michael Stockton

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982827 13f79535-47bb-0310-9956-ffa450edef68
2010-08-05 23:28:14 +00:00
Bryan Duxbury
8fc413fbfd THRIFT-554. multiple enums with the same key generate invalid code
This patch causes multiple enums with the same name to trigger a parser error.

Patch: Ben Taitelbaum

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982825 13f79535-47bb-0310-9956-ffa450edef68
2010-08-05 23:23:04 +00:00
Bryan Duxbury
20dbec7cfe THRIFT-782. perl: Perl code for writing containers doesn't count length of write*Begin or write*End
This patch adds appropriate accounting of the start and end bytes when writing out container types.
Patch: Conrad Hughes

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982812 13f79535-47bb-0310-9956-ffa450edef68
2010-08-05 22:28:13 +00:00
Bryan Duxbury
5226eeaaaa THRIFT-751. java: Add clear() method to TBase
This patch adds a clear() method to the TBase interface and causes the compiler to generate implementations.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982774 13f79535-47bb-0310-9956-ffa450edef68
2010-08-05 20:44:53 +00:00
Bryan Duxbury
c412a2fad4 THRIFT-133. add missing file to makefile.am
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982359 13f79535-47bb-0310-9956-ffa450edef68
2010-08-04 18:51:57 +00:00
Bryan Duxbury
c687712d18 THRIFT-133. fix a small bug with smalltalk.prefix and smalltalk.package namespaces.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@980538 13f79535-47bb-0310-9956-ffa450edef68
2010-07-29 18:39:06 +00:00
Bryan Duxbury
e0ac3abd53 THRIFT-133. 'namespace ruby' should error out, or be an alias to 'namespace rb'
This patch causes 'namespace ruby' (or any unrecognized generator name) to produce an error.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@980498 13f79535-47bb-0310-9956-ffa450edef68
2010-07-29 16:24:41 +00:00
David Reiss
95c005a7c6 THRIFT-395. python: Add option to treat strings as UTF-8 unicode
Add the "utf8strings" option to the Python generator.  If set, all
Thrift strings (not binary) will be expected to be unicode objects, not
str.  They will be encoded as UTF-8 before serialization and decoded as
UTF-8 after deserialization.

The accelerator module for TBinaryProtocol is not affected.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@959516 13f79535-47bb-0310-9956-ffa450edef68
2010-07-01 05:36:25 +00:00
Bryan Duxbury
162b3ac646 THRFIT-804. java: CompareTo is broken for unions set to map, set, or list
This patch fixes TUnion's compareTo, and factors out the standard part of the comparison to TBaseHelper.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@957350 13f79535-47bb-0310-9956-ffa450edef68
2010-06-23 21:17:48 +00:00
Bryan Duxbury
656683c776 THRIFT-808. Segfault when constant declaration references a struct field that doesn't exist
This patch causes a useful error to be printed instead of an anonymous segfault.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@957270 13f79535-47bb-0310-9956-ffa450edef68
2010-06-23 16:57:51 +00:00
Bryan Duxbury
2e1aab5db7 THRIFT-767. rb: ruby compiler does not keep comments for enum values
This patch makes sure that we print an rdoc comment above each of the enum values.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@957268 13f79535-47bb-0310-9956-ffa450edef68
2010-06-23 16:54:17 +00:00
Bryan Duxbury
d58ccec660 THRIFT-768. java: Async client for Java
This patch adds an implementation of a fully-asynchronous client that makes use of NIO. Stubs for the async method calls are generated along with the existing synchronous ones.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@948492 13f79535-47bb-0310-9956-ffa450edef68
2010-05-26 16:34:48 +00:00
Bryan Duxbury
c8ee35805d revert an unintentional commit to the java generator
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@940861 13f79535-47bb-0310-9956-ffa450edef68
2010-05-04 14:01:14 +00:00
Bryan Duxbury
a1e268c54b THRIFT-770. build: Get 'make dist' to work without first compiling source code
This patch ditches the old print_version.sh method and instead generates the compiler's version.h via the Makefile.

Patch: Anthony Molinaro

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@940630 13f79535-47bb-0310-9956-ffa450edef68
2010-05-03 21:33:00 +00:00
Bryan Duxbury
6a68187338 THRIFT-647. php: PHP library is missing install target
This patch adds a 'make install' target to a new PHP makefile. 

Patch: Anthony Molinaro

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@940325 13f79535-47bb-0310-9956-ffa450edef68
2010-05-02 22:39:31 +00:00
Bryan Duxbury
97d21c853d THRIFT-760. java: Generated client code does not set or check the sequence ID in messages
The Java generated clients weren't paying attention to sequence ids. Now they are\!

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@938169 13f79535-47bb-0310-9956-ffa450edef68
2010-04-26 18:16:46 +00:00
Bryan Duxbury
0137af6bf1 THRIFT-611. Under Windows when compiling using MinGW, includes are incorrectly resolved due to '/' <-> '\' havoc.
This patch ensures the proper slashes are used based on the platform.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@937070 13f79535-47bb-0310-9956-ffa450edef68
2010-04-22 21:21:46 +00:00
Bryan Duxbury
321eb7a2bd THRIFT-518. as3: Add the AS3 generator and library
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@937067 13f79535-47bb-0310-9956-ffa450edef68
2010-04-22 21:17:39 +00:00
Bryan Duxbury
15e2930ccf THRIFT-761. java: Include the symbolic name of a typedef field in the field metadata
This patch adds a new isTypedef() method to FieldValueMetaData and converts MetaDataTest to a testcase in TestStruct.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@936588 13f79535-47bb-0310-9956-ffa450edef68
2010-04-22 01:05:02 +00:00
Bryan Duxbury
60229785cb THRIFT-763. java: Variable capture bug in generated struct compareTo
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@936583 13f79535-47bb-0310-9956-ffa450edef68
2010-04-22 00:27:41 +00:00
Bryan Duxbury
0fab12e968 THRIFT-759. java: Make TBase implement Comparable
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@936581 13f79535-47bb-0310-9956-ffa450edef68
2010-04-22 00:22:34 +00:00
Bryan Duxbury
49b38015a6 THRIFT-753. java: Don't look up TFieldIdEnum values with a map
Instead of using a generated map, use a big switch statement.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@930618 13f79535-47bb-0310-9956-ffa450edef68
2010-04-04 04:01:07 +00:00
Bryan Duxbury
b1f7f7973b THRIFT-746. java: Generated services Iface/Client inner classes do not derive from base classes
This patch causes all generated Client classes to inherit from TServiceClient, an interface that provides a way to get the protocols the Client is using. Also, it causes a new TServiceClientFactory implementation to generated for each Service, which provides a generic, reflection-free way to get Clients. These changes make it easier to build generic pools of Client objects.

Patch: Mathias Herberts

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@930601 13f79535-47bb-0310-9956-ffa450edef68
2010-04-03 23:19:52 +00:00
Bryan Duxbury
ea7910faf3 THRIFT-663. java: JavaBean code generator produces incorrect setter methods
This patch causes the beans option to suppress the builder-style setter methods. It also adds a new 'private-members' option that leaves the builder-style methods, but makes the actual instance variables private.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@930474 13f79535-47bb-0310-9956-ffa450edef68
2010-04-03 05:04:48 +00:00
Bryan Duxbury
5557beffae THRIFT-723: java: Thrift buffers with set and map types in Java should implement Comparable
This makes structs that contain sets and maps in their hierarchy Comparable.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@928944 13f79535-47bb-0310-9956-ffa450edef68
2010-03-29 23:57:09 +00:00
Bryan Duxbury
15b7b28794 THRIFT-701. java: Generated classes take up more space in jar than needed
Use a static {} block instead of an anonymous inner class to define metaDataMap. This saves some space in jars generated by avoiding the internal class.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@926466 13f79535-47bb-0310-9956-ffa450edef68
2010-03-23 05:39:18 +00:00
Bryan Duxbury
3f4ca0e8fd THRIFT-734. java: Can't use primitive types in service definitions for bean generated code
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@923566 13f79535-47bb-0310-9956-ffa450edef68
2010-03-16 03:13:26 +00:00
David Reiss
ac110e4f1c cpp: Eliminate circular dependency between thrift libraries
Previously, Thrift.cpp contained TApplicationException, which was using
TProtocol methods, defined in TProtocol.h.  This caused a circular
dependency since libprotocol depends on Thrift.h.  This change moves
TApplicationException into its own file.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@920682 13f79535-47bb-0310-9956-ffa450edef68
2010-03-09 05:20:07 +00:00
David Reiss
e574a065a9 THRIFT-660. php: Use the accelerator to write return values from servers
Previously, we only used the acclerator module for clients to
write calls and read returns.  Now PHP servers will use it for
writing returns.  We cannot use it to read calls on the server side
(without modifications), because the module requires that
the structure type be known before reading the message header.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@920663 13f79535-47bb-0310-9956-ffa450edef68
2010-03-09 05:19:22 +00:00
David Reiss
4dd7801e90 THRIFT-655. Allow structs to be typedef'ed
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@920657 13f79535-47bb-0310-9956-ffa450edef68
2010-03-09 05:19:08 +00:00
David Reiss
53c10e09e1 THRIFT-564. Support arbitrary annotations on struct fields
This is subtly different from a type annotation, since some bits of
metadata only make sense in the context of a single structure field,
like whether the field is required, or whether the C++ code should use
a pointer for it.

This change doesn't define any meaningful annotations.  It just sets up
the parsing infrastructure.

I have no idea if $10 will work with older versions of yacc.  It seems
to work fine with bison.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@919325 13f79535-47bb-0310-9956-ffa450edef68
2010-03-05 07:51:51 +00:00