mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 18:58:51 +00:00
93a0664aff
Summary: * got rid of most of the otp_base jonx ... save that for a future release unfortunately * cleaned up the tutorial server, added -erl to tutorial.thrift's shebang * made better README and TODO Test Plan: checked out a copy, read my directions, built and ran the tutorial, and pretended that it didn't blow git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665273 13f79535-47bb-0310-9956-ffa450edef68
26 lines
773 B
Erlang
26 lines
773 B
Erlang
%%% Copyright (c) 2007- Facebook
|
|
%%% Distributed under the Thrift Software License
|
|
%%%
|
|
%%% See accompanying file LICENSE or visit the Thrift site at:
|
|
%%% http://developers.facebook.com/thrift/
|
|
|
|
-define(CLASS(Obj), element(1, Obj)).
|
|
|
|
-define(DEFINE_ATTR(Attr), attr(This, get, Attr, _Value) -> This#?MODULE.Attr;
|
|
attr(This, set, Attr, Value) -> This#?MODULE{Attr=Value}
|
|
).
|
|
|
|
%%% static: use only if you're sure This is class ?MODULE and not a super/subclass
|
|
-define(ATTR(Attr), This#?MODULE.Attr).
|
|
|
|
%%% convenience for implementing inspect/1
|
|
%%% e.g. -> "foo=5"
|
|
-define(FORMAT_ATTR(Attr),
|
|
io_lib:write_atom(Attr) ++ "=" ++ io_lib:print(?ATTR(Attr))
|
|
).
|
|
|
|
-define(ATTR_DUMMY,
|
|
attr(dummy, dummy, dummy, dummy) ->
|
|
throw(dummy_attr_used)
|
|
).
|