Class: Roby::DRoby::V5::DRobyID
Overview
These objects are used in distributed Roby to identify objects across the various Roby instances
Class Attribute Summary collapse
-
.droby_id_allocator ⇒ Object
readonly
Returns the value of attribute droby_id_allocator.
Instance Attribute Summary collapse
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#id ⇒ Object
readonly
The object ID.
Class Method Summary collapse
Instance Method Summary collapse
-
#==(other) ⇒ Object
(also: #eql?)
:nodoc:.
-
#initialize(id) ⇒ DRobyID
constructor
A new instance of DRobyID.
- #inspect ⇒ Object
- #pretty_print(pp) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(id) ⇒ DRobyID
Returns a new instance of DRobyID.
12 13 14 15 |
# File 'lib/roby/droby/v5/droby_id.rb', line 12 def initialize(id) @id = id @hash = id.hash end |
Class Attribute Details
.droby_id_allocator ⇒ Object (readonly)
Returns the value of attribute droby_id_allocator.
37 38 39 |
# File 'lib/roby/droby/v5/droby_id.rb', line 37 def droby_id_allocator @droby_id_allocator end |
Instance Attribute Details
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
22 23 24 |
# File 'lib/roby/droby/v5/droby_id.rb', line 22 def hash @hash end |
#id ⇒ Object (readonly)
The object ID
10 11 12 |
# File 'lib/roby/droby/v5/droby_id.rb', line 10 def id @id end |
Class Method Details
.allocate ⇒ Object
41 42 43 |
# File 'lib/roby/droby/v5/droby_id.rb', line 41 def self.allocate DRobyID.new(droby_id_allocator.increment) end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
:nodoc:
17 18 19 |
# File 'lib/roby/droby/v5/droby_id.rb', line 17 def ==(other) # :nodoc: other.kind_of?(DRobyID) && other.id == id end |
#inspect ⇒ Object
28 29 30 |
# File 'lib/roby/droby/v5/droby_id.rb', line 28 def inspect to_s end |
#pretty_print(pp) ⇒ Object
32 33 34 |
# File 'lib/roby/droby/v5/droby_id.rb', line 32 def pretty_print(pp) pp.text to_s end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/roby/droby/v5/droby_id.rb', line 24 def to_s "#<DRobyID:#{id}>" end |