Class: OpenCV::PtrFlannSearchParams
- Inherits:
-
Object
- Object
- OpenCV::PtrFlannSearchParams
- Extended by:
- FFI::DataConverter
- Defined in:
- lib/ruby/ropencv/ropencv_types.rb
Instance Attribute Summary collapse
- #__obj_ptr__ ⇒ Object readonly private
Sepcializing collapse
Class Method Summary collapse
-
.from_native(ptr, context) ⇒ Object
private
can be overwritten by the user.
- .new(*args) ⇒ Object
- .rbind_from_native(ptr, context) ⇒ Object private
- .rbind_to_native(obj, context) ⇒ Object private
-
.to_native(obj, context) ⇒ Object
private
can be overwritten by the user.
Instance Method Summary collapse
-
#__owner__? ⇒ Boolean
private
returns true if the underlying pointer is owner of the real object.
-
#addref ⇒ Object
methods wrapper for void Ptr_flann_SearchParams::addref().
-
#delete_obj ⇒ Object
wrapper for void Ptr_flann_SearchParams::delete_obj().
-
#empty ⇒ Object
wrapper for bool Ptr_flann_SearchParams::empty().
-
#initialize(ptr) ⇒ PtrFlannSearchParams
constructor
private
A new instance of PtrFlannSearchParams.
-
#obj ⇒ Object
wrapper for const cv::flann::SearchParams *obj.
-
#release ⇒ Object
wrapper for void Ptr_flann_SearchParams::release().
Constructor Details
#initialize(ptr) ⇒ PtrFlannSearchParams
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of PtrFlannSearchParams.
18994 18995 18996 18997 18998 18999 19000 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18994 def initialize(ptr) @__obj_ptr__ = if ptr.is_a? PtrFlannSearchParamsStruct ptr else PtrFlannSearchParamsStruct.new(FFI::AutoPointer.new(ptr,PtrFlannSearchParamsStruct.method(:release))) end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args) ⇒ Object
19010 19011 19012 19013 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 19010 def method_missing(m,*args) raise "Ptr #<Rbind::RPtr:0x007f84c21276b0> is empty. Cannot call #{m} on it!" if empty obj.method(m).call(*args) end |
Instance Attribute Details
#__obj_ptr__ ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18991 18992 18993 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18991 def __obj_ptr__ @__obj_ptr__ end |
Class Method Details
.from_native(ptr, context) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
can be overwritten by the user
18986 18987 18988 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18986 def self.from_native(ptr,context) rbind_from_native(ptr,context) end |
.new(*args) ⇒ Object
18943 18944 18945 18946 18947 18948 18949 18950 18951 18952 18953 18954 18955 18956 18957 18958 18959 18960 18961 18962 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18943 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(PtrFlannSearchParamsStruct) raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1 return super(args.first) end # wrapper for Ptr_flann_SearchParams::Ptr_flann_SearchParams(const Ptr_flann_SearchParams other) @@ptr_flann_search_params_ptr_flann_search_params_defaults0 ||= [nil] if(args.size >= 1 && args.size <= 1) args.size.upto(0) do |i| args[i] = @@ptr_flann_search_params_ptr_flann_search_params_defaults0[i] end begin return Rbind::ptr_flann_search_params_ptr_flann_search_params(*args) rescue TypeError => e @error = e end end raise ArgumentError, "no constructor for #{self}(#{args.inspect})" end |
.rbind_from_native(ptr, context) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18974 18975 18976 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18974 def self.rbind_from_native(ptr,context) PtrFlannSearchParams.new(ptr) end |
.rbind_to_native(obj, context) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18965 18966 18967 18968 18969 18970 18971 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18965 def self.rbind_to_native(obj,context) if obj.is_a? PtrFlannSearchParams obj.__obj_ptr__ else raise TypeError, "expected kind of #{name}, was #{obj.class}" end end |
.to_native(obj, context) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
can be overwritten by the user
18980 18981 18982 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18980 def self.to_native(obj,context) rbind_to_native(obj,context) end |
Instance Method Details
#__owner__? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
returns true if the underlying pointer is owner of the real object
19005 19006 19007 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 19005 def __owner__? @__obj_ptr__[:bowner] end |
#addref ⇒ Object
methods wrapper for void Ptr_flann_SearchParams::addref()
19023 19024 19025 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 19023 def addref() Rbind::ptr_flann_search_params_addref( self) end |
#delete_obj ⇒ Object
wrapper for void Ptr_flann_SearchParams::delete_obj()
19033 19034 19035 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 19033 def delete_obj() Rbind::ptr_flann_search_params_delete_obj( self) end |
#empty ⇒ Object
wrapper for bool Ptr_flann_SearchParams::empty()
19038 19039 19040 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 19038 def empty() Rbind::ptr_flann_search_params_empty( self) end |
#obj ⇒ Object
wrapper for const cv::flann::SearchParams *obj
19043 19044 19045 19046 19047 19048 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 19043 def obj() result = Rbind::ptr_flann_search_params_get_obj( self) # store owner insight the pointer to not get garbage collected result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__? result end |
#release ⇒ Object
wrapper for void Ptr_flann_SearchParams::release()
19028 19029 19030 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 19028 def release() Rbind::ptr_flann_search_params_release( self) end |