Class: Fhlow::Package

Inherits:
Leaf
  • Object
show all
Defined in:
lib/module_fhlow/leafs/Package.rb

Overview

This is a concrete implementation of the abstract class Leaf. A Package represents one Leaf with the prefix “pkg”.

Instance Attribute Summary

Attributes inherited from Leaf

#conf, #name, #prefix

Instance Method Summary collapse

Methods inherited from Leaf

#fetchDependencies, #fetchOneDependency, #getPath, #getTarget, #printMe

Constructor Details

#initialize(_name, _parent, _log, _pen) ⇒ Package

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/Package.rb', line 16

def initialize(_name, _parent, _log, _pen)
    super("pkg", _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, Packages 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
# File 'lib/module_fhlow/leafs/Package.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 Packages are needed
    if _deptype == "Packages"
        _files.push(getPath+"src/"+name+"-p.vhd")
    end
end


34
35
36
# File 'lib/module_fhlow/leafs/Package.rb', line 34

def print(_prefix="    ", _depth=0, _caller=nil)
    @pen.print _prefix, @pen.lightyellow, @prefix, @name, @pen.clear, "\n"
end