You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2008/07/10 11:30:47 UTC
svn commit: r675486 - in /incubator/qpid/branches/qpid.0-10/cpp/rubygen:
cppgen.rb framing.0-10/Session.rb framing.0-10/structs.rb
Author: gsim
Date: Thu Jul 10 02:30:46 2008
New Revision: 675486
URL: http://svn.apache.org/viewvc?rev=675486&view=rev
Log:
Assume accept-mode=1 (i.e. none required) where not explicitly specified on a message.transfer
Modified:
incubator/qpid/branches/qpid.0-10/cpp/rubygen/cppgen.rb
incubator/qpid/branches/qpid.0-10/cpp/rubygen/framing.0-10/Session.rb
incubator/qpid/branches/qpid.0-10/cpp/rubygen/framing.0-10/structs.rb
Modified: incubator/qpid/branches/qpid.0-10/cpp/rubygen/cppgen.rb
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/cpp/rubygen/cppgen.rb?rev=675486&r1=675485&r2=675486&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/cpp/rubygen/cppgen.rb (original)
+++ incubator/qpid/branches/qpid.0-10/cpp/rubygen/cppgen.rb Thu Jul 10 02:30:46 2008
@@ -206,6 +206,13 @@
/^(int|uint|char|boolean|bit)/ === type_ ? fqtypename : "const #{fqtypename}&"
end
def param_default() "=#{fqtypename}()" end
+
+ # Default value is normally the C++ default but over-ridden in specific cases
+ def default_value()
+ defval = cpptype.default_value;
+ if name == "accept-mode" and parent.name == "transfer" then defval = "1"; end
+ return defval
+ end
end
class AmqpMethod
Modified: incubator/qpid/branches/qpid.0-10/cpp/rubygen/framing.0-10/Session.rb
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/cpp/rubygen/framing.0-10/Session.rb?rev=675486&r1=675485&r2=675486&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/cpp/rubygen/framing.0-10/Session.rb (original)
+++ incubator/qpid/branches/qpid.0-10/cpp/rubygen/framing.0-10/Session.rb Thu Jul 10 02:30:46 2008
@@ -61,8 +61,8 @@
end
class AmqpField
- def unpack() "p[arg::#{cppname}|#{cpptype.default_value}]"; end
- def sig_default() signature+"="+cpptype.default_value; end
+ def unpack() "p[arg::#{cppname}|#{default_value}]"; end
+ def sig_default() signature+"="+default_value; end
end
class AmqpMethod
Modified: incubator/qpid/branches/qpid.0-10/cpp/rubygen/framing.0-10/structs.rb
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/cpp/rubygen/framing.0-10/structs.rb?rev=675486&r1=675485&r2=675486&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/cpp/rubygen/framing.0-10/structs.rb (original)
+++ incubator/qpid/branches/qpid.0-10/cpp/rubygen/framing.0-10/structs.rb Thu Jul 10 02:30:46 2008
@@ -48,7 +48,7 @@
def default_initialisation(s)
params = s.fields.select {|f| ValueTypes.include?(f.cpptype.name) || (!is_packed(s) && f.type_ == "bit")}
- strings = params.collect {|f| "#{f.cppname}(0)"}
+ strings = params.collect {|f| "#{f.cppname}(#{f.default_value})"}
strings << "flags(0)" if (is_packed(s))
if strings.empty?
return ""