Class: MailBox

Inherits:
BaseElm show all
Defined in:
lib/tdl/elements/mail_box.rb

Instance Attribute Summary collapse

Attributes inherited from BaseElm

#belong_to_module, #name

Instance Method Summary collapse

Methods inherited from BaseElm

#matrix, #name_copy, #path_refs, recfg_nc, #s

Methods included from TdlSpace::ExCreateTP

#create_tp, #root_ref

Constructor Details

#initialize(name: 'mbox', depth: 100) ⇒ MailBox

Returns a new instance of MailBox.



7
8
9
10
11
12
# File 'lib/tdl/elements/mail_box.rb', line 7

def initialize(name:'mbox',depth:100)
    @name = name

    @depth = depth

end

Instance Attribute Details

#ghostObject

include AlwaysBlock include RedefOpertor



6
7
8
# File 'lib/tdl/elements/mail_box.rb', line 6

def ghost
  @ghost
end

Instance Method Details

#cond_block_proc(a, b = nil) ⇒ Object

redefine cond_block_proc



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/tdl/elements/mail_box.rb', line 43

def cond_block_proc(a,b=nil)
    unless a.eql? self
        super(a,b)
    else
        if(b.is_a? Hash)
            if b[:cond_type].eql? :if_exp
                exp_element(b[:cond_value])
            end
        elsif b.nil?
            rel = exp_element(a)
            if rel =~ /\s+end\s*$/
                rel
            else
                rel.concat(";")
            end
        else
            exp_element(a).concat(".put(").concat(exp_element(b)).concat(");")
        end
    end
end

#get(baseelm) ⇒ Object



36
37
38
39
40
# File 'lib/tdl/elements/mail_box.rb', line 36

def get(baseelm)
    b = "#{signal}.get(#{exp_element(baseelm)})"
    $__curr_logic_for_expect.last.assign_proc(nil,b)
    return nil
end

#instObject



22
23
24
# File 'lib/tdl/elements/mail_box.rb', line 22

def inst
    "mailbox #{@name} = new(#{@depth});\n"
end

#put(baseelm) ⇒ Object

def _assign_small_and_eq(b)

$__tdl_cur_always_env__.assign_proc(self,b)

end



30
31
32
33
34
# File 'lib/tdl/elements/mail_box.rb', line 30

def put(baseelm)
    b = "#{signal}.put(#{exp_element(baseelm)})"
    $__curr_logic_for_expect.last.assign_proc(nil,b)
    return nil
end

#signalObject



14
15
16
# File 'lib/tdl/elements/mail_box.rb', line 14

def signal
    "#{@name}"
end

#to_sObject



18
19
20
# File 'lib/tdl/elements/mail_box.rb', line 18

def to_s
    signal
end