Class: AutoC::HashMap
- Inherits:
-
Association
- Object
- Type
- Composite
- Collection
- Association
- AutoC::HashMap
- Defined in:
- lib/autoc/hash_map.rb
Defined Under Namespace
Constant Summary
Constants inherited from Composite
Composite::DEFINITIONS, Composite::PRIVATE
Constants included from Entity
Constants included from STD
STD::ASSERT_H, STD::BOOL, STD::CHAR, STD::COMPLEX, STD::COMPLEX_H, STD::DOUBLE, STD::DOUBLE_COMPLEX, STD::DOUBLE_T, STD::FLOAT, STD::FLOAT_COMPLEX, STD::FLOAT_T, STD::INT, STD::INTMAX_T, STD::INTPTR_T, STD::INTTYPES_H, STD::LONG, STD::LONG_DOUBLE, STD::LONG_DOUBLE_COMPLEX, STD::LONG_LONG, STD::MALLOC_H, STD::MATH_H, STD::PTRDIFF_T, STD::SHORT, STD::SIGNED_CHAR, STD::SIZE_T, STD::STDBOOL_H, STD::STDDEF_H, STD::STDLIB_H, STD::STRING_H, STD::UINTMAX_T, STD::UINTPTR_T, STD::UNSIGNED, STD::UNSIGNED_CHAR, STD::UNSIGNED_LONG, STD::UNSIGNED_LONG_LONG, STD::UNSIGNED_SHORT, STD::WCHAR_T
Instance Attribute Summary
Attributes inherited from Association
Attributes inherited from Collection
Attributes inherited from Composite
Attributes inherited from Type
Instance Method Summary collapse
- #_node ⇒ Object
- #_node_class ⇒ Object
- #_range_class ⇒ Object
- #_set ⇒ Object
- #_set_class ⇒ Object
-
#initialize(*args, **kws) ⇒ HashMap
constructor
A new instance of HashMap.
- #orderable? ⇒ Boolean
- #range ⇒ Object
- #render_interface(stream) ⇒ Object
Methods inherited from Association
#comparable?, #copyable?, #destructible?, #hashable?, #type_tag
Methods inherited from Collection
#comparable?, #copyable?, #destructible?, #hashable?, new, #type_tag
Methods inherited from Composite
allocator, allocator=, #const_lvalue, #const_rvalue, decorator, decorator=, #defgroup, #hasher, hasher, hasher=, #identifier, #ingroup, #inspect, #internal?, #lvalue, #memory, new, #prefix, #private?, #public?, #respond_to_missing?, #rvalue, #to_value, #type_tag
Methods included from Entity
#<=>, #complexity, #dependencies, #forward_declarations, #implementation, #interface, #position, #references, #total_dependencies, #total_references
Methods inherited from Type
abstract, #comparable?, #constructible?, #copy, #copyable?, #custom_constructible?, #custom_create, #default_constructible?, #default_create, #destroy, #destructible?, #hashable?, #inspect, #to_s, #to_type
Constructor Details
#initialize(*args, **kws) ⇒ HashMap
Returns a new instance of HashMap.
32 33 34 35 |
# File 'lib/autoc/hash_map.rb', line 32 def initialize(*args, **kws) super dependencies << _set end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class AutoC::Composite
Instance Method Details
#_node ⇒ Object
26 |
# File 'lib/autoc/hash_map.rb', line 26 def _node = @_node ||= _node_class.new(identifier(:_node, abbreviate: true), { index: index, element: element }, _master: self, visibility: :internal) |
#_node_class ⇒ Object
20 |
# File 'lib/autoc/hash_map.rb', line 20 def _node_class = Record |
#_range_class ⇒ Object
18 |
# File 'lib/autoc/hash_map.rb', line 18 def _range_class = Range |
#_set ⇒ Object
28 |
# File 'lib/autoc/hash_map.rb', line 28 def _set = @_set ||= _set_class.new(identifier(:_set, set_operations: false, abbreviate: true), _node, _master: self, visibility: :internal) |
#orderable? ⇒ Boolean
30 |
# File 'lib/autoc/hash_map.rb', line 30 def orderable? = _set.orderable? |
#range ⇒ Object
24 |
# File 'lib/autoc/hash_map.rb', line 24 def range = @range ||= _range_class.new(self, visibility: visibility) |
#render_interface(stream) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/autoc/hash_map.rb', line 37 def render_interface(stream) if public? stream << %{ /** #{defgroup} @brief Unordered collection of elements of type #{element} associated with unique index of type #{index}. For iteration over the set elements refer to @ref #{range}. @see C++ [std::unordered_map<K,T>](https://en.cppreference.com/w/cpp/container/unordered_map) @since 2.0 */ /** #{ingroup} @brief Opaque structure holding state of the hash map @since 2.0 */ } else stream << PRIVATE end stream << %{ typedef struct { #{_set} set; /**< @private */ } #{signature}; } end |