blob: c525cdb05bbfeb3684a9aa2ef2cbef2212827920 [file] [log] [blame]
Christopher Piro094823a2007-07-18 00:26:12 +00001%%% Copyright (c) 2007- Facebook
2%%% Distributed under the Thrift Software License
David Reiss0c90f6f2008-02-06 22:18:40 +00003%%%
Christopher Piro094823a2007-07-18 00:26:12 +00004%%% See accompanying file LICENSE or visit the Thrift site at:
5%%% http://developers.facebook.com/thrift/
6
7-module(tBinaryProtocolFactory).
8
9-include("oop.hrl").
10
11-include("thrift.hrl").
12-include("protocol/tBinaryProtocol.hrl").
13-include("protocol/tBinaryProtocolFactory.hrl").
14
15-behavior(oop).
16
17-export([attr/4, super/0, inspect/1]).
18
19-export([new/0, getProtocol/2]).
20
21%%%
22%%% define attributes
23%%% 'super' is required unless ?MODULE is a base class
24%%%
25
26?DEFINE_ATTR(super).
David Reiss0c90f6f2008-02-06 22:18:40 +000027
Christopher Piro094823a2007-07-18 00:26:12 +000028%%%
29%%% behavior callbacks
30%%%
David Reiss0c90f6f2008-02-06 22:18:40 +000031
Christopher Piro094823a2007-07-18 00:26:12 +000032%%% super() -> SuperModule = atom()
33%%% | none
34
35super() ->
36 tProtocolFactory.
37
38%%% inspect(This) -> string()
39
40inspect(_This) ->
41 "".
42
43%%%
44%%% class methods
45%%%
46
47new() ->
48 Super = (super()):new(),
49 #?MODULE{super=Super}.
50
51%%%
52%%% instance methods
53%%%
54
55getProtocol(_This, Trans) ->
56 oop:start_new(tBinaryProtocol, [Trans]).
57