Class: Erlang::ETF::Reference

Inherits:
Object
  • Object
show all
Includes:
Term
Defined in:
lib/erlang/etf/reference.rb

Overview

1 N 4 1
101 Node ID Creation

Encode a reference object (an object generated with make_ref/0). The Node term is an encoded atom, i.e. ATOM_EXT, SMALL_ATOM_EXT or ATOM_CACHE_REF. The ID field contains a big-endian unsigned integer, but should be regarded as uninterpreted data since this field is node specific. Creation is a byte containing a node serial number that makes it possible to separate old (crashed) nodes from a new one.

In ID, only 18 bits are significant; the rest should be 0. In Creation, only 2 bits are significant; the rest should be 0. See NEW_REFERENCE_EXT.

(see REFERENCE_EXT)

Constant Summary

Constants included from Term

Term::BERT_PREFIX, Term::BIN_LSB_PACK, Term::BIN_MSB_PACK

Instance Method Summary collapse

Methods included from Term

#==, #__erlang_evolve__, #__erlang_type__, #__ruby_evolve__, included

Constructor Details

#initialize(node, id, creation) ⇒ Reference

Returns a new instance of Reference.



43
44
45
46
47
# File 'lib/erlang/etf/reference.rb', line 43

def initialize(node, id, creation)
  @node     = node
  @id       = id
  @creation = creation
end