Class: HDLRuby::High::Std::SequencerFunctionE
- Inherits:
-
Object
- Object
- HDLRuby::High::Std::SequencerFunctionE
- Defined in:
- lib/HDLRuby/std/sequencer_func.rb
Overview
Describes a sequencer eigen function. Here, an eigen function is a function definition specilized with arguments types.
Instance Attribute Summary collapse
-
#funcT ⇒ Object
readonly
Returns the value of attribute funcT.
Instance Method Summary collapse
-
#==(obj) ⇒ Object
Comparison of eigen functions.
-
#body ⇒ Object
Gets the body of the function.
-
#each_argT(&ruby_block) ⇒ Object
Iterates over the argument types.
-
#initialize(funcT, argTs) ⇒ SequencerFunctionE
constructor
Creates a new eigen function with function type +funcT+ and arguments types +argTs+.
-
#name ⇒ Object
Gets the name of the function.
-
#overflow ⇒ Object
Gets the stack overflow code of the function.
Constructor Details
#initialize(funcT, argTs) ⇒ SequencerFunctionE
Creates a new eigen function with function type +funcT+ and arguments types +argTs+.
116 117 118 119 |
# File 'lib/HDLRuby/std/sequencer_func.rb', line 116 def initialize(funcT, argTs) @funcT = funcT @argTs = argTs.to_a end |
Instance Attribute Details
#funcT ⇒ Object (readonly)
Returns the value of attribute funcT.
112 113 114 |
# File 'lib/HDLRuby/std/sequencer_func.rb', line 112 def funcT @funcT end |
Instance Method Details
#==(obj) ⇒ Object
Comparison of eigen functions.
147 148 149 150 151 152 153 154 |
# File 'lib/HDLRuby/std/sequencer_func.rb', line 147 def ==(obj) # Is obj an eigen function? return false unless obj.is_a?(SequencerFunctionE) # Has obj the same function type? return false unless self.funcT == obj.funcT # Has obj the same argument types? return obj.each_argT.zip(self.each_argT).all? {|t0,t1| t0 == t1 } end |
#body ⇒ Object
Gets the body of the function.
127 128 129 |
# File 'lib/HDLRuby/std/sequencer_func.rb', line 127 def body @funcT.body end |
#each_argT(&ruby_block) ⇒ Object
Iterates over the argument types.
Returns an enumerator if no ruby block is given.
139 140 141 142 143 144 |
# File 'lib/HDLRuby/std/sequencer_func.rb', line 139 def each_argT(&ruby_block) # No ruby block? Return an enumerator. return to_enum(:each_argT) unless ruby_block # A ruby block? Apply it on each agument type. @argTs.each(&ruby_block) end |
#name ⇒ Object
Gets the name of the function.
122 123 124 |
# File 'lib/HDLRuby/std/sequencer_func.rb', line 122 def name @funcT.name end |
#overflow ⇒ Object
Gets the stack overflow code of the function.
132 133 134 |
# File 'lib/HDLRuby/std/sequencer_func.rb', line 132 def overflow @funcT.overflow end |