Class: Schema::Type
Defined Under Namespace
Classes: GroupAnyPointer, GroupEnum, GroupInterface, GroupList, GroupStruct, List, Which
Instance Method Summary
collapse
decode_pointer, from_pointer, #initialize
Constructor Details
This class inherits a constructor from Capnp::Struct
Instance Method Details
#any_pointer ⇒ Object
677
|
# File 'lib/capnp/generator/schema.capnp.rb', line 677
def any_pointer = GroupAnyPointer.new(@data, @data_size, @pointers, @pointers_size)
|
#bool ⇒ Object
553
|
# File 'lib/capnp/generator/schema.capnp.rb', line 553
def bool = nil
|
#data ⇒ Object
601
|
# File 'lib/capnp/generator/schema.capnp.rb', line 601
def data = nil
|
#enum ⇒ Object
620
|
# File 'lib/capnp/generator/schema.capnp.rb', line 620
def enum = GroupEnum.new(@data, @data_size, @pointers, @pointers_size)
|
#float32 ⇒ Object
589
|
# File 'lib/capnp/generator/schema.capnp.rb', line 589
def float32 = nil
|
#float64 ⇒ Object
593
|
# File 'lib/capnp/generator/schema.capnp.rb', line 593
def float64 = nil
|
#int16 ⇒ Object
561
|
# File 'lib/capnp/generator/schema.capnp.rb', line 561
def int16 = nil
|
#int32 ⇒ Object
565
|
# File 'lib/capnp/generator/schema.capnp.rb', line 565
def int32 = nil
|
#int64 ⇒ Object
569
|
# File 'lib/capnp/generator/schema.capnp.rb', line 569
def int64 = nil
|
#int8 ⇒ Object
557
|
# File 'lib/capnp/generator/schema.capnp.rb', line 557
def int8 = nil
|
#interface ⇒ Object
658
|
# File 'lib/capnp/generator/schema.capnp.rb', line 658
def interface = GroupInterface.new(@data, @data_size, @pointers, @pointers_size)
|
#is_any_pointer? ⇒ Boolean
804
|
# File 'lib/capnp/generator/schema.capnp.rb', line 804
def is_any_pointer? = which? == Which::AnyPointer
|
#is_bool? ⇒ Boolean
555
|
# File 'lib/capnp/generator/schema.capnp.rb', line 555
def is_bool? = which? == Which::Bool
|
#is_data? ⇒ Boolean
603
|
# File 'lib/capnp/generator/schema.capnp.rb', line 603
def is_data? = which? == Which::Data
|
#is_enum? ⇒ Boolean
637
|
# File 'lib/capnp/generator/schema.capnp.rb', line 637
def is_enum? = which? == Which::Enum
|
#is_float32? ⇒ Boolean
591
|
# File 'lib/capnp/generator/schema.capnp.rb', line 591
def is_float32? = which? == Which::Float32
|
#is_float64? ⇒ Boolean
595
|
# File 'lib/capnp/generator/schema.capnp.rb', line 595
def is_float64? = which? == Which::Float64
|
#is_int16? ⇒ Boolean
563
|
# File 'lib/capnp/generator/schema.capnp.rb', line 563
def is_int16? = which? == Which::Int16
|
#is_int32? ⇒ Boolean
567
|
# File 'lib/capnp/generator/schema.capnp.rb', line 567
def is_int32? = which? == Which::Int32
|
#is_int64? ⇒ Boolean
571
|
# File 'lib/capnp/generator/schema.capnp.rb', line 571
def is_int64? = which? == Which::Int64
|
#is_int8? ⇒ Boolean
559
|
# File 'lib/capnp/generator/schema.capnp.rb', line 559
def is_int8? = which? == Which::Int8
|
#is_interface? ⇒ Boolean
675
|
# File 'lib/capnp/generator/schema.capnp.rb', line 675
def is_interface? = which? == Which::Interface
|
#is_list? ⇒ Boolean
618
|
# File 'lib/capnp/generator/schema.capnp.rb', line 618
def is_list? = which? == Which::List
|
#is_struct? ⇒ Boolean
656
|
# File 'lib/capnp/generator/schema.capnp.rb', line 656
def is_struct? = which? == Which::Struct
|
#is_text? ⇒ Boolean
599
|
# File 'lib/capnp/generator/schema.capnp.rb', line 599
def is_text? = which? == Which::Text
|
#is_uint16? ⇒ Boolean
579
|
# File 'lib/capnp/generator/schema.capnp.rb', line 579
def is_uint16? = which? == Which::Uint16
|
#is_uint32? ⇒ Boolean
583
|
# File 'lib/capnp/generator/schema.capnp.rb', line 583
def is_uint32? = which? == Which::Uint32
|
#is_uint64? ⇒ Boolean
587
|
# File 'lib/capnp/generator/schema.capnp.rb', line 587
def is_uint64? = which? == Which::Uint64
|
#is_uint8? ⇒ Boolean
575
|
# File 'lib/capnp/generator/schema.capnp.rb', line 575
def is_uint8? = which? == Which::Uint8
|
#is_void? ⇒ Boolean
551
|
# File 'lib/capnp/generator/schema.capnp.rb', line 551
def is_void? = which? == Which::Void
|
#list ⇒ Object
605
|
# File 'lib/capnp/generator/schema.capnp.rb', line 605
def list = GroupList.new(@data, @data_size, @pointers, @pointers_size)
|
#struct ⇒ Object
639
|
# File 'lib/capnp/generator/schema.capnp.rb', line 639
def struct = GroupStruct.new(@data, @data_size, @pointers, @pointers_size)
|
#text ⇒ Object
597
|
# File 'lib/capnp/generator/schema.capnp.rb', line 597
def text = nil
|
#to_obj ⇒ Object
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
|
#uint16 ⇒ Object
577
|
# File 'lib/capnp/generator/schema.capnp.rb', line 577
def uint16 = nil
|
#uint32 ⇒ Object
581
|
# File 'lib/capnp/generator/schema.capnp.rb', line 581
def uint32 = nil
|
#uint64 ⇒ Object
585
|
# File 'lib/capnp/generator/schema.capnp.rb', line 585
def uint64 = nil
|
#uint8 ⇒ Object
573
|
# File 'lib/capnp/generator/schema.capnp.rb', line 573
def uint8 = nil
|
#void ⇒ Object
549
|
# File 'lib/capnp/generator/schema.capnp.rb', line 549
def void = nil
|
#which? ⇒ Boolean
812
|
# File 'lib/capnp/generator/schema.capnp.rb', line 812
def which? = Which.from_integer(read_u16(0, 0))
|