Class: Schema::Type

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

Defined Under Namespace

Classes: GroupAnyPointer, GroupEnum, GroupInterface, GroupList, GroupStruct, List, Which

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

#any_pointerObject



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

def any_pointer = GroupAnyPointer.new(@data, @data_size, @pointers, @pointers_size)

#boolObject



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

def bool = nil

#dataObject



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

def data = nil

#enumObject



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

def enum = GroupEnum.new(@data, @data_size, @pointers, @pointers_size)

#float32Object



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

def float32 = nil

#float64Object



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

def float64 = nil

#int16Object



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

def int16 = nil

#int32Object



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

def int32 = nil

#int64Object



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

def int64 = nil

#int8Object



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

def int8 = nil

#interfaceObject



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

def interface = GroupInterface.new(@data, @data_size, @pointers, @pointers_size)

#is_any_pointer?Boolean

Returns:

  • (Boolean)


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

def is_any_pointer? = which? == Which::AnyPointer

#is_bool?Boolean

Returns:

  • (Boolean)


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

def is_bool? = which? == Which::Bool

#is_data?Boolean

Returns:

  • (Boolean)


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

def is_data? = which? == Which::Data

#is_enum?Boolean

Returns:

  • (Boolean)


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

def is_enum? = which? == Which::Enum

#is_float32?Boolean

Returns:

  • (Boolean)


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

def is_float32? = which? == Which::Float32

#is_float64?Boolean

Returns:

  • (Boolean)


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

def is_float64? = which? == Which::Float64

#is_int16?Boolean

Returns:

  • (Boolean)


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

def is_int16? = which? == Which::Int16

#is_int32?Boolean

Returns:

  • (Boolean)


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

def is_int32? = which? == Which::Int32

#is_int64?Boolean

Returns:

  • (Boolean)


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

def is_int64? = which? == Which::Int64

#is_int8?Boolean

Returns:

  • (Boolean)


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

def is_int8? = which? == Which::Int8

#is_interface?Boolean

Returns:

  • (Boolean)


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

def is_interface? = which? == Which::Interface

#is_list?Boolean

Returns:

  • (Boolean)


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

def is_list? = which? == Which::List

#is_struct?Boolean

Returns:

  • (Boolean)


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

def is_struct? = which? == Which::Struct

#is_text?Boolean

Returns:

  • (Boolean)


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

def is_text? = which? == Which::Text

#is_uint16?Boolean

Returns:

  • (Boolean)


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

def is_uint16? = which? == Which::Uint16

#is_uint32?Boolean

Returns:

  • (Boolean)


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

def is_uint32? = which? == Which::Uint32

#is_uint64?Boolean

Returns:

  • (Boolean)


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

def is_uint64? = which? == Which::Uint64

#is_uint8?Boolean

Returns:

  • (Boolean)


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

def is_uint8? = which? == Which::Uint8

#is_void?Boolean

Returns:

  • (Boolean)


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

def is_void? = which? == Which::Void

#listObject



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

def list = GroupList.new(@data, @data_size, @pointers, @pointers_size)

#structObject



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

def struct = GroupStruct.new(@data, @data_size, @pointers, @pointers_size)

#textObject



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

def text = nil

#to_objObject



864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
# File 'lib/capnp/generator/schema.capnp.rb', line 864

def to_obj
  res = {}
  case which?
  when Which::Void then res["void"] = void
  when Which::Bool then res["bool"] = bool
  when Which::Int8 then res["int8"] = int8
  when Which::Int16 then res["int16"] = int16
  when Which::Int32 then res["int32"] = int32
  when Which::Int64 then res["int64"] = int64
  when Which::Uint8 then res["uint8"] = uint8
  when Which::Uint16 then res["uint16"] = uint16
  when Which::Uint32 then res["uint32"] = uint32
  when Which::Uint64 then res["uint64"] = uint64
  when Which::Float32 then res["float32"] = float32
  when Which::Float64 then res["float64"] = float64
  when Which::Text then res["text"] = text
  when Which::Data then res["data"] = data
  when Which::List then res["list"] = list.to_obj
  when Which::Enum then res["enum"] = enum.to_obj
  when Which::Struct then res["struct"] = struct.to_obj
  when Which::Interface then res["interface"] = interface.to_obj
  when Which::AnyPointer then res["any_pointer"] = any_pointer.to_obj
  end
  res
end

#uint16Object



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

def uint16 = nil

#uint32Object



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

def uint32 = nil

#uint64Object



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

def uint64 = nil

#uint8Object



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

def uint8 = nil

#voidObject



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

def void = nil

#which?Boolean

Returns:

  • (Boolean)


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

def which? = Which.from_integer(read_u16(0, 0))