Class: IDL::Type

Inherits:
Object
  • Object
show all
Defined in:
lib/ridl/type.rb

Defined Under Namespace

Classes: Any, Array, Boolean, Char, Component, Const, Double, Enum, Eventtype, Exception, Fixed, Float, Home, Integer, Interface, LongDouble, Native, NodeType, Object, Porttype, ScopedName, Sequence, String, Struct, TemplateModule, UndefinedType, Union, ValueBase, Valuebox, Valuetype, Void, WChar, WString

Constant Summary collapse

Octet =
Integer.newclass(0..0xFF, 8)
UShort =
Integer.newclass(0..0xFFFF, 16)
ULong =
Integer.newclass(0..0xFFFFFFFF, 32)
ULongLong =
Integer.newclass(0..0xFFFFFFFFFFFFFFFF, 64)
Short =
Integer.newclass(-0x8000...0x8000, 16)
Long =
Integer.newclass(-0x80000000...0x80000000, 32)
LongLong =
Integer.newclass(-0x8000000000000000...0x8000000000000000, 64)

Instance Method Summary collapse

Instance Method Details

#instantiate(_context) ⇒ Object



48
49
50
# File 'lib/ridl/type.rb', line 48

def instantiate(_context)
  self
end

#is_anonymous?Boolean

Returns:



32
33
34
# File 'lib/ridl/type.rb', line 32

def is_anonymous?
  false
end

#is_complete?Boolean

Returns:



26
27
28
# File 'lib/ridl/type.rb', line 26

def is_complete?
  true
end

#is_local?(recurstk = nil) ⇒ Boolean

Returns:



29
30
31
# File 'lib/ridl/type.rb', line 29

def is_local?(recurstk = nil)
  false
end

#is_node?(node_class) ⇒ Boolean

Returns:



35
36
37
# File 'lib/ridl/type.rb', line 35

def is_node?(node_class)
  false
end

#is_template?Boolean

Returns:



41
42
43
# File 'lib/ridl/type.rb', line 41

def is_template?
  false
end

#matches?(idltype) ⇒ Boolean

Returns:



44
45
46
# File 'lib/ridl/type.rb', line 44

def matches?(idltype)
  self.class == idltype.class
end

#narrow(obj) ⇒ Object



20
21
22
# File 'lib/ridl/type.rb', line 20

def narrow(obj)
  obj
end

#resolved_nodeObject



38
39
40
# File 'lib/ridl/type.rb', line 38

def resolved_node
  nil
end

#resolved_typeObject



23
24
25
# File 'lib/ridl/type.rb', line 23

def resolved_type
  self
end

#typeerror(val) ⇒ Object

Raises:

  • (RuntimeError)


17
18
19
# File 'lib/ridl/type.rb', line 17

def typeerror(val)
  raise RuntimeError, "#{val.inspect} cannot narrow to #{self.typename}"
end

#typenameObject



14
15
16
# File 'lib/ridl/type.rb', line 14

def typename
  self.class.name
end