Class: OpenCV::Std::Runtime_Error

Inherits:
Object
  • Object
show all
Extended by:
FFI::DataConverter
Defined in:
lib/ropencv/ropencv_types.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


78811
78812
78813
78814
78815
78816
78817
78818
# File 'lib/ropencv/ropencv_types.rb', line 78811

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(Runtime_ErrorStruct)
        raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1
        return super(args.first)
    end

    raise ArgumentError, "no constructor for #{self}(#{args.inspect})"
end

.nullObject

returns a null pointer to the object



78807
78808
78809
# File 'lib/ropencv/ropencv_types.rb', line 78807

def self.null
    new(Runtime_ErrorStruct.new)
end

Instance Method Details

#cast_toexception(parse_ownership) ⇒ Std::Exception Also known as: castToexception

Note:

method wrapper for std::exception* std::runtime_error::castToexception(bool parse_ownership)

methods

Parameters:

  • parse_ownership (Bool)

Returns:



78896
78897
78898
78899
78900
78901
78902
78903
78904
# File 'lib/ropencv/ropencv_types.rb', line 78896

def cast_toexception(parse_ownership)
    __validate_pointer__
    result = Rbind::std_runtime_error_cast_toexception( self, parse_ownership)
    if result.respond_to?(:__owner__?) && !result.__owner__?
    # store owner insight the pointer to not get garbage collected
        result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) 
    end
    result
end

#to_sObject

converts Runtime_Error into a string by crawling through all its attributes



78884
78885
78886
# File 'lib/ropencv/ropencv_types.rb', line 78884

def to_s
    "#<std::runtime_error >"
end