Class: AutoC::Association Abstract
- Inherits:
-
Collection
- Object
- Type
- Composite
- Collection
- AutoC::Association
- Defined in:
- lib/autoc/association.rb
Overview
Generator for C types for direct access using index of specific type (hash/tree maps, string, vector etc.)
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 collapse
-
#index ⇒ Object
readonly
Returns the value of attribute index.
Attributes inherited from Collection
Attributes inherited from Composite
Attributes inherited from Type
Instance Method Summary collapse
-
#comparable? ⇒ Boolean
For associative container to be comparable both hashable element and index types are required.
-
#copyable? ⇒ Boolean
For associative container to be copyable both hashable element and index types are required.
-
#destructible? ⇒ Boolean
The associative destructible element and index types mandates creation of the container’s destructor.
-
#hashable? ⇒ Boolean
For associative container to be hashable both hashable element and index types are required.
-
#initialize(type, element, index, **kws) ⇒ Association
constructor
A new instance of Association.
-
#orderable? ⇒ Boolean
For associative container to be orderable both hashable element and index types are required.
- #type_tag ⇒ Object
Methods inherited from Collection
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
Methods included from Entity
#<=>, #complexity, #dependencies, #forward_declarations, #implementation, #interface, #position, #references, #total_dependencies, #total_references
Methods inherited from Type
abstract, #constructible?, #copy, #custom_constructible?, #custom_create, #default_constructible?, #default_create, #destroy, #inspect, #to_s, #to_type
Constructor Details
#initialize(type, element, index, **kws) ⇒ Association
Returns a new instance of Association.
20 21 22 23 |
# File 'lib/autoc/association.rb', line 20 def initialize(type, element, index, **kws) super(type, element, **kws) dependencies << (@index = index.to_type) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class AutoC::Composite
Instance Attribute Details
#index ⇒ Object (readonly)
Returns the value of attribute index.
18 19 20 |
# File 'lib/autoc/association.rb', line 18 def index @index end |
Instance Method Details
#comparable? ⇒ Boolean
For associative container to be comparable both hashable element and index types are required
29 |
# File 'lib/autoc/association.rb', line 29 def comparable? = super && index.comparable? |
#copyable? ⇒ Boolean
For associative container to be copyable both hashable element and index types are required
26 |
# File 'lib/autoc/association.rb', line 26 def copyable? = super && index.copyable? |
#destructible? ⇒ Boolean
The associative destructible element and index types mandates creation of the container’s destructor
35 |
# File 'lib/autoc/association.rb', line 35 def destructible? = super || index.destructible? |
#hashable? ⇒ Boolean
For associative container to be hashable both hashable element and index types are required
38 |
# File 'lib/autoc/association.rb', line 38 def hashable? = super && index.hashable? |
#orderable? ⇒ Boolean
For associative container to be orderable both hashable element and index types are required
32 |
# File 'lib/autoc/association.rb', line 32 def orderable? = super && index.orderable? |
#type_tag ⇒ Object
40 |
# File 'lib/autoc/association.rb', line 40 def type_tag = "#{signature}<#{element},#{index}>" |