Class: Fhlow::Library
Overview
This is a concrete implementation of the abstract class Leaf. A Library represents one Leaf with the prefix “lib”.
Instance Attribute Summary
Attributes inherited from Leaf
Instance Method Summary collapse
-
#getFiles(_deptype, _istoplevel = true, _caller = nil, _files = Array.new) ⇒ Object
This function returns an Array of filenames in respect of the dependency tree.
-
#initialize(_name, _parent, _log, _pen) ⇒ Library
constructor
Calls the constructor of Leaf.
- #print(_prefix = " ", _depth = 0, _caller = nil) ⇒ Object
Methods inherited from Leaf
#fetchDependencies, #fetchOneDependency, #getPath, #getTarget, #printMe
Constructor Details
#initialize(_name, _parent, _log, _pen) ⇒ Library
Calls the constructor of Leaf.
_name-
The Name of the Leaf.
_parent-
The reference to the parent.
_conf-
The configuration information from higher levels.
_log-
The reference to the Log object.
_pen-
The reference to a Pen object.
16 17 18 |
# File 'lib/module_fhlow/leafs/Library.rb', line 16 def initialize(_name, _parent, _log, _pen) super("lib", _name, _parent, _log, _pen) end |
Instance Method Details
#getFiles(_deptype, _istoplevel = true, _caller = nil, _files = Array.new) ⇒ Object
This function returns an Array of filenames in respect of the dependency tree.
_deptype-
Type of the requested dependencies (could be Units, BhvUnits, Librarys and so on)
_istoplevel-
Is used to indicate the first entrance to this function.
_caller-
Reference to the caller of the function. This is needed to request architectures.
_files-
The Array of the files which will be filled with the requested filenames and returned in the end.
25 26 27 28 29 30 31 32 33 |
# File 'lib/module_fhlow/leafs/Library.rb', line 25 def getFiles(_deptype, _istoplevel=true, _caller=nil, _files=Array.new) @dependencies[_deptype].each { |dep| dep.getFiles(_deptype, false, self, _files)} unless @dependencies[_deptype].nil? # only act if Libraries are needed case _deptype when "SimulationLibraries", "Libraries" _files.push( { @name => @conf["Self"]["Files"].collect { |file| getPath+"src/"+file } } ) end end |
#print(_prefix = " ", _depth = 0, _caller = nil) ⇒ Object
35 36 37 38 |
# File 'lib/module_fhlow/leafs/Library.rb', line 35 def print(_prefix=" ", _depth=0, _caller=nil) # TODO: find a way to print only [Dependencies] -> Libraries without [Target*] -> SimulationLibraries #@pen.print _prefix, @pen.yellow, @prefix, @name, @pen.clear, "\n" end |