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.
457 458 459 |
# File 'lib/babeltrace/ctf/events.rb', line 457 def initialize(declaration) @declaration = declaration end |
Instance Attribute Details
#declaration ⇒ Object (readonly)
Returns the value of attribute declaration.
429 430 431 |
# File 'lib/babeltrace/ctf/events.rb', line 429 def declaration @declaration end |
Class Method Details
.create(decl) ⇒ Object
431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 |
# File 'lib/babeltrace/ctf/events.rb', line 431 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
461 462 463 |
# File 'lib/babeltrace/ctf/events.rb', line 461 def field_type @declaration.field_type end |