Class: FFI::Clang::Types::Elaborated

Inherits:
Type
  • Object
show all
Defined in:
lib/ffi/clang/types/elaborated.rb

Overview

Represents an elaborated type (e.g., struct, union, enum with an elaborated type specifier). Elaborated types may include type qualifiers and nested name specifiers.

Instance Attribute Summary

Attributes inherited from Type

#translation_unit, #type

Instance Method Summary collapse

Methods inherited from Type

#==, #alignof, #canonical, #const_qualified?, create, #declaration, #initialize, #kind, #kind_spelling, #non_reference_type, #pod?, #ref_qualifier, #restrict_qualified?, #sizeof, #spelling, #to_s, #volatile_qualified?

Constructor Details

This class inherits a constructor from FFI::Clang::Types::Type

Instance Method Details

#anonymous?Boolean

Check if this is an anonymous elaborated type. Example anonymous union where ‘u` is an elaborated type:

typedef struct {

union { int idata; } u;

} SomeStruct;

Returns:

  • (Boolean)


29
30
31
# File 'lib/ffi/clang/types/elaborated.rb', line 29

def anonymous?
  self.declaration.anonymous?
end

#named_typeObject

Get the named type that this elaborated type refers to.



15
16
17
# File 'lib/ffi/clang/types/elaborated.rb', line 15

def named_type
  Type.create Lib.get_named_type(@type), @translation_unit
end

#pointer?Boolean

Check if this elaborated type is a pointer in its canonical form.

Returns:

  • (Boolean)


35
36
37
# File 'lib/ffi/clang/types/elaborated.rb', line 35

def pointer?
  self.canonical.is_a?(Pointer)
end