Sha256: 4c4a499f5321b74ea9da4ed5a39f3f7ac93ee3376ad00259bdfa2eb20ce79bf5

Contents?: true

Size: 1020 Bytes

Versions: 8

Compression:

Stored size: 1020 Bytes

Contents

# Author::    Eric Crane  (mailto:eric.crane@mac.com)
# Copyright:: Copyright (c) 2019 Eric Crane.  All rights reserved.
#
# The Object Heap.
# The collection of objects that are currently in play in
# the running engine.
#

module Gloo
  module Core
    class Heap

      # The context is a reference to an object, usually a container.
      # The context will be the root by default.
      attr_reader :context

      # TODO:  Do I need a running script context?
      # how to resolve relative reference.

      attr_reader :it, :root, :error

      # Set up the object heap.
      def initialize
        $log.debug 'object heap intialized...'

        @root = Gloo::Objs::Container.new
        @root.name = 'root'

        @context = Pn.root
        @it = It.new
        @error = Error.new
      end

      # Unload the given obj--remove it from the heap.
      def unload( obj )
        can = obj.parent.nil? ? @root : obj.parent
        return unless can

        can.remove_child obj
      end

    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
gloo-0.6.1 lib/gloo/core/heap.rb
gloo-0.6.0 lib/gloo/core/heap.rb
gloo-0.5.4 lib/gloo/core/heap.rb
gloo-0.5.3 lib/gloo/core/heap.rb
gloo-0.5.2 lib/gloo/core/heap.rb
gloo-0.5.1 lib/gloo/core/heap.rb
gloo-0.5.0 lib/gloo/core/heap.rb
gloo-0.4.0 lib/gloo/core/heap.rb