Class: Class

Inherits:
Object show all
Defined in:
lib/roby/state/state_model.rb,
lib/roby/distributed_object.rb,
lib/roby/droby/enable.rb

Instance Method Summary collapse

Instance Method Details

#droby_dump(dest) ⇒ Object



17
18
19
# File 'lib/roby/droby/enable.rb', line 17

def droby_dump(dest)
    raise "can't dump class #{self}"
end

#private_modelObject

Declares that neither this model nor its subclasses should be sent to remote peers.

I.e., from the point of view of our peers, instances of this model are actually instances of its superclass.



20
# File 'lib/roby/distributed_object.rb', line 20

def private_model; @private_model = true end

#private_model?Boolean

If true, this model will never get sent to remote peers.

Returns:

  • (Boolean)


4
5
6
7
8
9
10
11
12
13
# File 'lib/roby/distributed_object.rb', line 4

def private_model?
    if !@private_model.nil?
        @private_model
    else
        klass = superclass
        if superclass.respond_to?(:private_model?)
            superclass.private_model?
        end
    end
end

#to_state_variable_model(field, name) ⇒ Object

Implementation of a conversion to StateVariableModel

It makes it possible to use a class to initialize a state leaf model with

state.model.path.to.value = MyClass


7
8
9
10
11
# File 'lib/roby/state/state_model.rb', line 7

def to_state_variable_model(field, name)
    model = Roby::StateVariableModel.new(field, name)
    model.type = self
    return model
end