Class: TurboRex::MSRPC::MIDL::DataType::BaseType

Inherits:
TurboRex::MSRPC::MIDL::DataType show all
Defined in:
lib/turborex/msrpc/midl.rb

Constant Summary collapse

SYMBOL_NAME_TABLE =
[
 :boolean, 
 :byte, 
 :char, 
 :double, 
 :float, 
 :handle_t, 
 :hyper, 
 :__int8,
 :__int16,
 :int, 
 :__int32,
 :__int3264, 
 :__int64,
 :long, 
 :short, 
 :small, 
 :wchar_t,
 :error_status_t
]
BYTESIZE_MAPPING =
{
  boolean: 1,
  byte: 1,
  char: 1,
  double: 8,
  float: 4,
  handle_t: :variable,
  hyper: 8,
  int: 4,
  __int3264: :variable,
  long: 4,
  short: 2,
  small: 1,
  wchar_t: 2,
  error_status_t: 4
}

Instance Attribute Summary collapse

Attributes inherited from TurboRex::MSRPC::MIDL::DataType

#bytesize, #symbol_name

Instance Method Summary collapse

Constructor Details

#initialize(symbol_name, signed) ⇒ BaseType

Returns a new instance of BaseType.



180
181
182
183
184
185
# File 'lib/turborex/msrpc/midl.rb', line 180

def initialize(symbol_name, signed)
  raise TurboRex::Exception::MSRPC::UnknownSymbolName unless index = SYMBOL_NAME_TABLE.index(symbol_name.to_sym)
  @symbol_name ||= SYMBOL_NAME_TABLE[index]
  @signed = signed
  @bytesize = BYTESIZE_MAPPING[@symbol_name]
end

Instance Attribute Details

#signedObject (readonly)

Returns the value of attribute signed.



140
141
142
# File 'lib/turborex/msrpc/midl.rb', line 140

def signed
  @signed
end