diff options
author | Matthias Radestock <matthias@rabbitmq.com> | 2010-11-06 13:04:14 +0000 |
---|---|---|
committer | Matthias Radestock <matthias@rabbitmq.com> | 2010-11-06 13:04:14 +0000 |
commit | f4afcfacaff0ca73ed6592ca79ff2421c5c92455 (patch) | |
tree | fb3d113a07101f7820b8607798cf0e13f78ae284 | |
parent | a4a20e29a4c99a6903ce7c35f7c559d0f1ba7c05 (diff) | |
download | rabbitmq-server-f4afcfacaff0ca73ed6592ca79ff2421c5c92455.tar.gz |
add wrapper for protocol specific types
-rw-r--r-- | src/rabbit_framing.erl | 64 | ||||
-rw-r--r-- | src/rabbit_types.erl | 2 |
2 files changed, 65 insertions, 1 deletions
diff --git a/src/rabbit_framing.erl b/src/rabbit_framing.erl new file mode 100644 index 00000000..a0c8f4d5 --- /dev/null +++ b/src/rabbit_framing.erl @@ -0,0 +1,64 @@ +%% The contents of this file are subject to the Mozilla Public License +%% Version 1.1 (the "License"); you may not use this file except in +%% compliance with the License. You may obtain a copy of the License at +%% http://www.mozilla.org/MPL/ +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +%% License for the specific language governing rights and limitations +%% under the License. +%% +%% The Original Code is RabbitMQ. +%% +%% The Initial Developers of the Original Code are LShift Ltd, +%% Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd. +%% +%% Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd, +%% Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd +%% are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial +%% Technologies LLC, and Rabbit Technologies Ltd. +%% +%% Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift +%% Ltd. Portions created by Cohesive Financial Technologies LLC are +%% Copyright (C) 2007-2010 Cohesive Financial Technologies +%% LLC. Portions created by Rabbit Technologies Ltd are Copyright +%% (C) 2007-2010 Rabbit Technologies Ltd. +%% +%% All Rights Reserved. +%% +%% Contributor(s): ______________________________________. +%% + +%% TODO auto-generate + +-module(rabbit_framing). + +-ifdef(use_specs). + +-export_type([protocol/0, + amqp_field_type/0, amqp_property_type/0, + amqp_table/0, amqp_array/0, amqp_value/0, + amqp_method_name/0, amqp_method/0, amqp_method_record/0, + amqp_method_field_name/0, amqp_property_record/0, + amqp_exception/0, amqp_exception_code/0, amqp_class_id/0]). + +-type(protocol() :: 'rabbit_framing_amqp_0_8' | 'rabbit_framing_amqp_0_9_1'). + +-define(protocol_type(T), type(T :: rabbit_framing_amqp_0_8:T | + rabbit_framing_amqp_0_9_1:T)). + +-?protocol_type(amqp_field_type()). +-?protocol_type(amqp_property_type()). +-?protocol_type(amqp_table()). +-?protocol_type(amqp_array()). +-?protocol_type(amqp_value()). +-?protocol_type(amqp_method_name()). +-?protocol_type(amqp_method()). +-?protocol_type(amqp_method_record()). +-?protocol_type(amqp_method_field_name()). +-?protocol_type(amqp_property_record()). +-?protocol_type(amqp_exception()). +-?protocol_type(amqp_exception_code()). +-?protocol_type(amqp_class_id()). + +-endif. diff --git a/src/rabbit_types.erl b/src/rabbit_types.erl index edc73f70..3758c71b 100644 --- a/src/rabbit_types.erl +++ b/src/rabbit_types.erl @@ -143,7 +143,7 @@ -type(connection() :: pid()). --type(protocol() :: 'rabbit_framing_amqp_0_8' | 'rabbit_framing_amqp_0_9_1'). +-type(protocol() :: rabbit_framing:protocol()). -type(user() :: #user{username :: rabbit_access_control:username(), |