Skip to content

Commit

Permalink
Layout changes
Browse files Browse the repository at this point in the history
    * ridlbe/c++11/templates/cli/hdr/bitset.erb:
    * ridlbe/c++11/templates/cli/inl/bitset_inl.erb:
  • Loading branch information
jwillemsen committed Aug 14, 2023
1 parent 79540d8 commit 99dff61
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
8 changes: 4 additions & 4 deletions ridlbe/c++11/templates/cli/hdr/bitset.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public:
%unless base.nil?
using <%= base.cxxname %>::<%= base.cxxname %>;
%end
%_ms = bitfields.dup
%_ms = bitfields.dup.find_all {|bitf| !bitf.cxxname.empty? }
/// Constructor which accepts value for all members
explicit inline <%= cxxname %> (
%unless base.nil?
Expand All @@ -27,11 +27,9 @@ public:
% end
%end

%bitfields.each do |_m|
% unless _m.cxxname.empty?
%bitfields.find_all {|bitf| !bitf.cxxname.empty? }.each do |_m|
inline void <%= _m.cxxname %> (<%= _m.cxx_in_type %> _x11_<%= _m.cxxname %>) { this->_taox11_<%= cxxname.downcase %>.<%= _m.cxxname %> = _x11_<%= _m.cxxname %>; }
inline <%= _m.cxx_in_type %> <%= _m.cxxname %> () const { return this->_taox11_<%= cxxname.downcase %>.<%= _m.cxxname %>; }
% end
%end

/// Exchange the value of two bitsets in an efficient matter
Expand All @@ -47,4 +45,6 @@ private:
} _taox11_<%= cxxname.downcase %>;
}; // <%= cxxname %>

inline void swap (<%= scoped_cxx_out_type %> m1, <%= scoped_cxx_out_type %> m2) { m1.swap (m2); }

% visit_template('typecode') if generate_typecode_support?
35 changes: 16 additions & 19 deletions ridlbe/c++11/templates/cli/inl/bitset_inl.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,27 @@
%# Constructor inlines
%#
%# Initializer CTOR
% _ms = bitfields.dup
%_ms = bitfields.dup.find_all {|bitf| !bitf.cxxname.empty? }
inline <%= scoped_cxxtype %>::<%= cxxname %> (
% unless base.nil?
% unless base.nil?
<%= base.cxxname %> _base<%= _ms.empty? ? ')' : ',' %>
% end
% unless _ms.empty?
% while !_ms.empty?
% _m = _ms.shift
% end
% unless _ms.empty?
% while !_ms.empty?
% _m = _ms.shift
<%= "#{_m.cxx_byval_type} #{_m.cxxname}" %><%= _ms.empty? ? ')' : ',' %>
% end
% end
% _pfx = nil
% unless base.nil?
% end
% end
% _pfx = nil
% unless base.nil?
: <%= base.cxxname %> (std::move(_base))<% unless _ms.empty? %>,<% end %>
% end
<% if base.nil? %>:<% else %>,<% end %> _taox11_<%= cxxname.downcase %> {
%# Change formatting
% bitfields.each do |_m|
% unless _m.cxxname.empty?
<%= _pfx %><%= _m.cxxname %>
% end
% str = ""
% bitfields.find_all {|bitf| !bitf.cxxname.empty? }.each do |_m|
% str = "#{str}#{_pfx}#{_m.cxxname}"
% _pfx = ', ' unless _pfx
% end
% _pfx = ', ' unless _pfx
% end
}
<% if base.nil? %>:<% else %>,<% end %> _taox11_<%= cxxname.downcase %> { <%= str %> }
{
}

Expand Down

0 comments on commit 99dff61

Please sign in to comment.