Class: CType::Struct
- Inherits:
-
StructUnion
- Object
- StructUnion
- CType::Struct
- Defined in:
- lib/caphir/ctype.rb
Overview
StructUnion
Constant Summary collapse
- @@structs =
{}
Class Method Summary collapse
-
.[](val = nil) ⇒ Object
factory method.
Instance Method Summary collapse
-
#initialize(name = nil) ⇒ Struct
constructor
A new instance of Struct.
Methods inherited from StructUnion
#add, #evaluate, get, #get_members, #keyword, #lookup, #to_def, #to_init_s, #to_s
Constructor Details
#initialize(name = nil) ⇒ Struct
Returns a new instance of Struct.
158 159 160 |
# File 'lib/caphir/ctype.rb', line 158 def initialize(name = nil) super end |
Class Method Details
.[](val = nil) ⇒ Object
factory method
144 145 146 147 148 149 150 151 152 153 |
# File 'lib/caphir/ctype.rb', line 144 def Struct.[](val = nil) # for unnamed structures return Struct.send(:new) unless val result = @@structs[val] unless result result = @@structs[val] = Struct.send(:new, val) end result end |