module Pione::TupleSpace

TupleSpace is a namespace for classes tuple space related.

Constants

TUPLE

tuple type table @api private

Public Class Methods

[](identifier) click to toggle source

Returns a tuple class corresponding to a tuple identifier. @return [Class]

tuple class
# File lib/pione/tuple-space/basic-tuple.rb, line 271
def [](identifier)
  TUPLE[identifier]
end
from_array(ary) click to toggle source

Return a tuple data object converted from an array. @return [TupleObject]

tuple object
# File lib/pione/tuple-space/basic-tuple.rb, line 285
def from_array(ary)
  raise TupleFormatError.new(ary) unless ary.size > 0
  raise TupleFormatError.new(ary) unless ary.respond_to?(:to_a)
  _ary = ary.to_a
  identifier = _ary.first
  raise TupleFormatError.new(identifier) unless TUPLE.has_key?(identifier)
  args = _ary[1..-1]
  TUPLE[identifier].new(*args)
end
identifiers() click to toggle source

Returns identifiers. @return [Array<Symbol>]

all tuple identifiers in PIONE system.
# File lib/pione/tuple-space/basic-tuple.rb, line 278
def identifiers
  TUPLE.keys
end