class Telemetry::Incoming::Message

Public Class Methods

new(str) click to toggle source
# File lib/telemetry/message.rb, line 17
def initialize(str)
    message = YAML.load(str)
    @annotations = message.annotations
    @data = if @annotations[:type] == :typelib
                begin
                    Orocos.load_typekit_for @annotations[:type_name],false
                    if @annotations[:type_name] == "/transformer/TransformerStatus" || @annotations[:type_name] == "/aggregator/StreamAlignerStatus"
                       @annotations = Hash.new
                       nil
                    else
                       data = Base64.decode64(message.data)
                       Orocos.registry.get(@annotations[:type_name]).wrap(data)
                    end
                rescue Orocos::TypekitTypeNotFound => e
                    e
                end
            else
                message.data
            end
end