Class: Upl::Inter::Agc

Inherits:
Object show all
Defined in:
lib/upl/inter.rb

Overview

keep track of object_id atoms that were assigned in prolog, and prolog now wants to garbage collect them.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAgc

Returns a new instance of Agc.



52
53
54
# File 'lib/upl/inter.rb', line 52

def initialize
  @id_objects = {}
end

Class Method Details

.instanceObject



56
57
58
# File 'lib/upl/inter.rb', line 56

def self.instance
  @instance ||= new
end

Instance Method Details

#deregister(obj) ⇒ Object



64
65
66
# File 'lib/upl/inter.rb', line 64

def deregister obj
  @id_objects.delete obj.object_id
end

#register(obj) ⇒ Object



60
61
62
# File 'lib/upl/inter.rb', line 60

def register obj
  @id_objects[obj.object_id] = obj
end