Class: Ref

Inherits:
Base show all
Defined in:
lib/functions/ref.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#frame_optimized, #name

Instance Method Summary collapse

Methods inherited from Base

#add_arduino_code, #add_cycle_level_scope, #add_top_level_scope, #append_tsortable, #buildit, #cycle_level_arduino_code, #depends_on, #param_keys, #resolve_frame_optimized, #top_level_scope_arduino_code

Constructor Details

#initialize(params) ⇒ Ref

Returns a new instance of Ref.



6
7
8
9
10
11
12
13
14
15
# File 'lib/functions/ref.rb', line 6

def initialize(params)
  super(params)
  @identifier = params[:identifier]
  if $refs.has_key?(@identifier)
    @ref_name = $refs[@identifier]
    @frame_optimized = $refs_frame_optimized[@identifier]
  else
    raise "non-existant ref #{@identifier}"
  end
end

Instance Attribute Details

#identifierObject

Returns the value of attribute identifier.



3
4
5
# File 'lib/functions/ref.rb', line 3

def identifier
  @identifier
end

#ref_nameObject

Returns the value of attribute ref_name.



4
5
6
# File 'lib/functions/ref.rb', line 4

def ref_name
  @ref_name
end

Instance Method Details

#arduino_codeObject



17
18
19
20
# File 'lib/functions/ref.rb', line 17

def arduino_code
  [
  ]
end

#top_level_scope_codeObject



22
23
24
25
26
# File 'lib/functions/ref.rb', line 22

def top_level_scope_code
  [
    "long *#{@name} = #{@ref_name};"
  ]
end