Skip to content

Commit

Permalink
Starter support for bitset
Browse files Browse the repository at this point in the history
    * ridlbe/ccmx11/facets/dds/templates/idl/dds/bitset.erb:
      Added.

    * ridlbe/ccmx11/facets/dds/writers/ddsidl.rb:
    * ridlbe/ccmx11/visitors/import.rb:
  • Loading branch information
jwillemsen committed Nov 26, 2024
1 parent 4fe64e3 commit 2551fb7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
11 changes: 11 additions & 0 deletions ridlbe/ccmx11/facets/dds/templates/idl/dds/bitset.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

// generated from <%= ridl_template_path %>
/// @copydoc <%= doc_scoped_name %>
% annotations.each do |_a|
<%= _a.idl_stringified %>
% end
%# todo bitfield annotations and type
bitset <%= unescaped_name %><% unless base.nil? %> : <%= base.unescaped_name %><% end %> {
<%= bitfields.collect {|e| "/// @copydoc #{e.doc_scoped_name}\n bitfield<#{e.bits}> #{e.name}" }.join(",\n ") %>
};

7 changes: 6 additions & 1 deletion ridlbe/ccmx11/facets/dds/writers/ddsidl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ def visit_enum(node)

def visit_bitmask(node)
check_namespace_begin
visitor(BitMaskVisitor).visit_bitmask(node)
visitor(BitmaskVisitor).visit_bitmask(node)
end

def visit_bitset(node)
check_namespace_begin
visitor(BitsetVisitor).visit_bitset(node)
end

def declare_union(node)
Expand Down
1 change: 1 addition & 0 deletions ridlbe/ccmx11/visitors/import.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module CCMX11
SequenceVisitor = Cxx11::SequenceVisitor
EnumVisitor = Cxx11::EnumVisitor
BitmaskVisitor = Cxx11::BitmaskVisitor
BitsetVisitor = Cxx11::BitsetVisitor
ArrayVisitor = Cxx11::ArrayVisitor
TypedefVisitor = Cxx11::TypedefVisitor
UnionVisitor = Cxx11::UnionVisitor
Expand Down

0 comments on commit 2551fb7

Please sign in to comment.