Class: Orocos::Attribute

Inherits:
TaskContextAttribute show all
Defined in:
ext/rorocos/rorocos.cc,
lib/orocos/task_context.rb,
lib/orocos/async/orocos.rb

Overview

Attributes and properties are in Orocos ways to parametrize the task contexts. Instances of Orocos::Attribute actually represent both at the same time.

Instance Attribute Summary

Attributes inherited from TaskContextAttribute

#dynamic_operation

Attributes inherited from AttributeBase

#log_port, #log_stream, #name, #orocos_type_name, #task, #type

Instance Method Summary collapse

Methods inherited from TaskContextAttribute

#do_write_dynamic, #dynamic?, #initialize

Methods inherited from AttributeBase

#==, #doc, #doc?, #ensure_type_available, #full_name, #initialize, #log_current_value, #log_value, #new_sample, #pretty_print, #raw_read, #read, #type_name, #write

Constructor Details

This class inherits a constructor from Orocos::TaskContextAttribute

Instance Method Details

#do_read(type_name, value) ⇒ Object


58
59
60
# File 'lib/orocos/task_context.rb', line 58

def do_read(type_name, value)
    task.do_attribute_read(name, type_name, value)
end

#do_write(type_name, value, direct: false) ⇒ Object


51
52
53
54
55
56
57
# File 'lib/orocos/task_context.rb', line 51

def do_write(type_name, value, direct: false)
    if !direct && dynamic?
        do_write_dynamic(value)
    else
        task.do_attribute_write(name, type_name, value)
    end
end

#log_metadataObject


47
48
49
# File 'lib/orocos/task_context.rb', line 47

def 
    super.merge('rock_stream_type' => 'attribute')
end

#to_async(options = Hash.new) ⇒ Object


27
28
29
30
31
32
# File 'lib/orocos/async/orocos.rb', line 27

def to_async(options = Hash.new)
    if use = options.delete(:use)
        Orocos::Async::CORBA::Attribute.new(use,self,options)
    else to_async(Hash[:use => task.to_async].merge(options))
    end
end

#to_proxy(options = Hash.new) ⇒ Object


34
35
36
# File 'lib/orocos/async/orocos.rb', line 34

def to_proxy(options = Hash.new)
    task.to_proxy(options).attribute(name,:type => type)
end