Method: OpenC3::Structure#append_item
- Defined in:
- lib/openc3/packets/structure.rb
#append_item(name, bit_size, data_type, array_size = nil, endianness = @default_endianness, overflow = :ERROR) ⇒ StrutureItem
Define an item at the end of the structure. This creates a new instance of the item_class as given in the constructor and adds it to the items hash. It also resizes the buffer to accommodate the new item.
301 302 303 304 305 306 307 |
# File 'lib/openc3/packets/structure.rb', line 301 def append_item(name, bit_size, data_type, array_size = nil, endianness = @default_endianness, overflow = :ERROR) if data_type == :DERIVED return define_item(name, 0, bit_size, data_type, array_size, endianness, overflow) else return define_item(name, @defined_length_bits, bit_size, data_type, array_size, endianness, overflow) end end |