-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #402 from jwillemsen/jwi-bitmaskidl4
Update bitmask prototype to IDL4 to C++ mapping proposal, fixed CDR insertion, test extensions
- Loading branch information
Showing
7 changed files
with
108 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,28 @@ | ||
|
||
// generated from <%= ridl_template_path %> | ||
/// @copydoc <%= doc_scoped_name %> | ||
enum class <%= cxxname %> : <%= bitbound.cxx_type %> | ||
class <%= cxxname %> | ||
{ | ||
<%= bitvalues.collect {|e| "/// @copydoc #{doc_scoped_name}::#{e.name}\n #{e.cxxname} = 0x01 << #{e.position}" }.join(",\n ") %> | ||
};// <%= cxxname %> | ||
public: | ||
enum _flags : <%= bitbound.cxx_type %> | ||
{ | ||
<%= bitvalues.collect {|e| "/// @copydoc #{doc_scoped_name}::#{e.name}\n #{e.cxxname} = 0x01 << #{e.position}" }.join(",\n ") %> | ||
}; | ||
<%= cxxname %> () = default; | ||
<%= cxxname %> (<%= bitbound.cxx_in_type %> _v) : _value(_v) {} | ||
operator <%= bitbound.cxx_type %>() const { return _value; } | ||
%# <%= cxx_return_type %> operator~ () { return ~_value; } | ||
%# <%= cxx_return_type %> operator| () { return _value | _taox11_y; } | ||
%# <%= cxx_return_type %> operator^ () { return _value ^ _taox11_y; } | ||
%# <%= cxx_return_type %> operator& () { return _value & _taox11_y; } | ||
<%= cxx_return_type %>& operator |= (<%= bitbound.cxx_in_type %> _taox11_rhs) { _value |= _taox11_rhs; return *this; } | ||
<%= cxx_return_type %>& operator &= (<%= bitbound.cxx_in_type %> _taox11_rhs) { _value &= _taox11_rhs; return *this; } | ||
<%= cxx_return_type %>& operator ^= (<%= bitbound.cxx_in_type %> _taox11_rhs) { _value ^= _taox11_rhs; return *this; } | ||
<%= cxx_out_type %> operator= (<%= cxx_in_type %>) = default; | ||
<%= cxx_out_type %> operator= (<%= cxx_move_type %>) = default; | ||
<%= cxxname %> (<%= cxx_in_type %>) = default; | ||
<%= cxxname %> (<%= cxx_move_type %>) = default; | ||
private: | ||
<%= bitbound.cxx_member_type %> _value <%= bitbound.value_initializer %>; | ||
}; // <%= cxxname %> | ||
|
||
inline <%= cxx_return_type %> operator~ (<%= cxx_in_type %> _taox11_t) { return static_cast<<%= cxxname %>>(~static_cast<<%= bitbound.cxx_type %>>(_taox11_t)); } | ||
inline <%= cxx_return_type %> operator| (<%= cxx_in_type %> _taox11_t, <%= cxx_in_type %> _taox11_y) { return static_cast<<%= cxxname %>>(static_cast<<%= bitbound.cxx_type %>>(_taox11_t) | static_cast<<%= bitbound.cxx_type %>>(_taox11_y)); } | ||
inline <%= cxx_return_type %> operator^ (<%= cxx_in_type %> _taox11_t, <%= cxx_in_type %> _taox11_y) { return static_cast<<%= cxxname %>>(static_cast<<%= bitbound.cxx_type %>>(_taox11_t) ^ static_cast<<%= bitbound.cxx_type %>>(_taox11_y)); } | ||
inline <%= cxx_return_type %> operator& (<%= cxx_in_type %> _taox11_t, <%= cxx_in_type %> _taox11_y) { return static_cast<<%= cxxname %>>(static_cast<<%= bitbound.cxx_type %>>(_taox11_t) & static_cast<<%= bitbound.cxx_type %>>(_taox11_y)); } | ||
inline <%= cxx_return_type %> operator |= (<%= cxx_inout_type %> _taox11_lhs, <%= cxx_in_type %> _taox11_rhs) { _taox11_lhs = _taox11_lhs | _taox11_rhs; return _taox11_lhs; } | ||
inline <%= cxx_return_type %> operator &= (<%= cxx_inout_type %> _taox11_lhs, <%= cxx_in_type %> _taox11_rhs) { _taox11_lhs = _taox11_lhs & _taox11_rhs; return _taox11_lhs; } | ||
inline <%= cxx_return_type %> operator ^= (<%= cxx_inout_type %> _taox11_lhs, <%= cxx_in_type %> _taox11_rhs) { _taox11_lhs = _taox11_lhs ^ _taox11_rhs; return _taox11_lhs; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters