Class: Schema::Node::GroupStruct

Inherits:
Capnp::Struct show all
Defined in:
lib/capnp/generator/schema.capnp.rb

Constant Summary collapse

DEFAULT_DATA_WORD_COUNT =
0
DEFAULT_POINTER_COUNT =
0
DEFAULT_IS_GROUP =
false
DEFAULT_DISCRIMINANT_COUNT =
0
DEFAULT_DISCRIMINANT_OFFSET =
0

Instance Method Summary collapse

Methods inherited from Capnp::Struct

decode_pointer, from_pointer, #initialize

Constructor Details

This class inherits a constructor from Capnp::Struct

Instance Method Details

#data_word_countObject



38
# File 'lib/capnp/generator/schema.capnp.rb', line 38

def data_word_count = read_u16(14, 0)

#discriminant_countObject



50
# File 'lib/capnp/generator/schema.capnp.rb', line 50

def discriminant_count = read_u16(30, 0)

#discriminant_offsetObject



53
# File 'lib/capnp/generator/schema.capnp.rb', line 53

def discriminant_offset = read_u32(32, 0)

#fieldsObject



55
# File 'lib/capnp/generator/schema.capnp.rb', line 55

def fields = Schema::Field::List.from_pointer(read_pointer(3))

#is_groupObject



47
# File 'lib/capnp/generator/schema.capnp.rb', line 47

def is_group = (read_u8(28, 0x00) & 0x1) != 0

#pointer_countObject



41
42
# File 'lib/capnp/generator/schema.capnp.rb', line 41

def pointer_count = read_u16(24, 0)
# DEFAULT_PREFERRED_LIST_ENCODING = Schema::ElementSize::Empty

#preferred_list_encodingObject



44
# File 'lib/capnp/generator/schema.capnp.rb', line 44

def preferred_list_encoding = Schema::ElementSize.from_integer(read_u16(26, 0))

#to_objObject



57
58
59
60
61
62
63
64
65
66
67
# File 'lib/capnp/generator/schema.capnp.rb', line 57

def to_obj
  res = {}
  res["data_word_count"] = data_word_count
  res["pointer_count"] = pointer_count
  res["preferred_list_encoding"] = preferred_list_encoding
  res["is_group"] = is_group
  res["discriminant_count"] = discriminant_count
  res["discriminant_offset"] = discriminant_offset
  res["fields"] = fields&.to_obj
  res
end