Class: Babeltrace::CTF::Declaration
- Inherits:
-
Object
- Object
- Babeltrace::CTF::Declaration
- Defined in:
- lib/babeltrace/ctf/events.rb,
ext/babeltrace_c/babeltrace.c
Direct Known Subclasses
ArrayDecl, EnumDecl, FloatDecl, IntegerDecl, SequenceDecl, StringDecl, StructDecl, UntaggedVariantDecl, VariantDecl
Instance Attribute Summary collapse
-
#declaration ⇒ Object
readonly
Returns the value of attribute declaration.
Class Method Summary collapse
Instance Method Summary collapse
- #field_type ⇒ Object
-
#initialize(declaration) ⇒ Declaration
constructor
A new instance of Declaration.
Constructor Details
#initialize(declaration) ⇒ Declaration
Returns a new instance of Declaration.
468 469 470 |
# File 'lib/babeltrace/ctf/events.rb', line 468 def initialize(declaration) @declaration = declaration end |
Instance Attribute Details
#declaration ⇒ Object (readonly)
Returns the value of attribute declaration.
440 441 442 |
# File 'lib/babeltrace/ctf/events.rb', line 440 def declaration @declaration end |
Class Method Details
.create(decl) ⇒ Object
442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 |
# File 'lib/babeltrace/ctf/events.rb', line 442 def self.create(decl) return nil if decl.pointer.null? case decl.field_type when :INTEGER IntegerDecl::new(decl) when :FLOAT FloatDecl::new(decl) when :ENUM EnumDecl::new(decl) when :STRING StringDecl::new(decl) when :STRUCT StructDecl::new(decl) when :UNTAGGED_VARIANT UntaggedVariantDecl::new(decl) when :VARIANT VariantDecl::new(decl) when :ARRAY ArrayDecl::new(decl) when :SEQUENCE SequenceDecl::new(decl) else raise "Unknow declaration type #{d.decl.field_type}!" end end |
Instance Method Details
#field_type ⇒ Object
472 473 474 |
# File 'lib/babeltrace/ctf/events.rb', line 472 def field_type @declaration.field_type end |