Class: OpenCV::Std::Vector::Std_Vector_Char
- Inherits:
-
Object
- Object
- OpenCV::Std::Vector::Std_Vector_Char
- Extended by:
- FFI::DataConverter
- Includes:
- Enumerable
- Defined in:
- lib/ropencv/ropencv_types.rb
Class Method Summary collapse
- .new(*args) ⇒ Object
-
.null ⇒ Object
returns a null pointer to the object.
Instance Method Summary collapse
- #<<(val) ⇒ Object
- #[](idx) ⇒ Std::Vector::Char
- #at(size) ⇒ Std::Vector::Char
- #back ⇒ Std::Vector::Char
- #capacity ⇒ Size_T
- #clear ⇒ Void
- #data ⇒ Void
- #delete_if(&block) ⇒ Object
- #each(&block) ⇒ Object
- #empty ⇒ Bool
- #front ⇒ Std::Vector::Char
- #get_element ⇒ Std::Vector::Char
- #pop_back ⇒ Void
- #push_back(other) ⇒ Void
- #reserve(size) ⇒ Void
-
#resize(size, val = Std::Vector::Char.new()) ⇒ Void
methods.
- #size ⇒ Size_T
- #swap(other) ⇒ Void
-
#to_s ⇒ Object
converts Vector::Std_Vector_Char into a string by crawling through all its attributes.
- #validate_index(idx) ⇒ Object
Class Method Details
.vector ⇒ Object .vector ⇒ Object
85257 85258 85259 85260 85261 85262 85263 85264 85265 85266 85267 85268 85269 85270 85271 85272 85273 85274 85275 85276 85277 85278 85279 85280 85281 85282 85283 85284 85285 85286 85287 85288 85289 85290 85291 |
# File 'lib/ropencv/ropencv_types.rb', line 85257 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(Vector::Std_Vector_CharStruct) raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1 return super(args.first) end # overloaded method wrapper for std::vector<std::vector<char>>::vector<std::vector<char>>() @@std_vector_std_vector_char_vector_std_vector_char_defaults0 ||= [] if(args.size >= 0 && args.size <= 0) targs = args.clone targs.size.upto(-1) do |i| targs[i] = @@std_vector_std_vector_char_vector_std_vector_char_defaults0[i] end begin return Rbind::std_vector_std_vector_char_vector_std_vector_char(*targs) rescue TypeError => e @error = e end end # overloaded method wrapper for std::vector<std::vector<char>>::vector<std::vector<char>>(std::vector<std::vector<char>> other) @@std_vector_std_vector_char_vector_std_vector_char__2_defaults1 ||= [nil] if(args.size >= 1 && args.size <= 1) targs = args.clone targs.size.upto(0) do |i| targs[i] = @@std_vector_std_vector_char_vector_std_vector_char__2_defaults1[i] end begin return Rbind::std_vector_std_vector_char_vector_std_vector_char__2(*targs) rescue TypeError => e @error = e end end raise ArgumentError, "no constructor for #{self}(#{args.inspect})" end |
Instance Method Details
#<<(val) ⇒ Object
85518 85519 85520 85521 |
# File 'lib/ropencv/ropencv_types.rb', line 85518 def <<(val) push_back(val) self end |
#[](idx) ⇒ Std::Vector::Char
method wrapper for std::vector
85414 85415 85416 85417 85418 85419 85420 85421 85422 85423 |
# File 'lib/ropencv/ropencv_types.rb', line 85414 def [](size) validate_index(size) __validate_pointer__ result = Rbind::std_vector_std_vector_char_operator_array( self, size) 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 |
#at(size) ⇒ Std::Vector::Char
method wrapper for std::vector
85428 85429 85430 85431 85432 85433 85434 85435 85436 85437 |
# File 'lib/ropencv/ropencv_types.rb', line 85428 def at(size) validate_index(size) __validate_pointer__ result = Rbind::std_vector_std_vector_char_at( self, size) 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 |
#back ⇒ Std::Vector::Char
method wrapper for std::vector
85453 85454 85455 85456 85457 85458 85459 85460 85461 |
# File 'lib/ropencv/ropencv_types.rb', line 85453 def back() __validate_pointer__ result = Rbind::std_vector_std_vector_char_back( self) 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 |
#capacity ⇒ Size_T
method wrapper for size_t std::vectorstd::vector<char>::capacity()
85391 85392 85393 85394 |
# File 'lib/ropencv/ropencv_types.rb', line 85391 def capacity() __validate_pointer__ Rbind::std_vector_std_vector_char_capacity( self) end |
#clear ⇒ Void
method wrapper for void std::vectorstd::vector<char>::clear()
85384 85385 85386 85387 |
# File 'lib/ropencv/ropencv_types.rb', line 85384 def clear() __validate_pointer__ Rbind::std_vector_std_vector_char_clear( self) end |
#data ⇒ Void
method wrapper for void* std::vectorstd::vector<char>::data()
85465 85466 85467 85468 |
# File 'lib/ropencv/ropencv_types.rb', line 85465 def data() __validate_pointer__ Rbind::std_vector_std_vector_char_data( self) end |
#delete_if(&block) ⇒ Object
85522 85523 85524 85525 85526 85527 85528 85529 |
# File 'lib/ropencv/ropencv_types.rb', line 85522 def delete_if(&block) v = self.class.new each do |i| v << i if !yield(i) end v.swap(self) self end |
#each(&block) ⇒ Object
85508 85509 85510 85511 85512 85513 85514 85515 85516 85517 |
# File 'lib/ropencv/ropencv_types.rb', line 85508 def each(&block) if block s = size 0.upto(s-1) do |i| yield self[i] end else Enumerator.new(self) end end |
#empty ⇒ Bool
method wrapper for bool std::vectorstd::vector<char>::empty()
85398 85399 85400 85401 |
# File 'lib/ropencv/ropencv_types.rb', line 85398 def empty() __validate_pointer__ Rbind::std_vector_std_vector_char_empty( self) end |
#front ⇒ Std::Vector::Char
method wrapper for std::vector
85441 85442 85443 85444 85445 85446 85447 85448 85449 |
# File 'lib/ropencv/ropencv_types.rb', line 85441 def front() __validate_pointer__ result = Rbind::std_vector_std_vector_char_front( self) 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 |
#get_element ⇒ Std::Vector::Char
method wrapper for std::vector
85497 85498 85499 85500 85501 85502 85503 85504 85505 85506 |
# File 'lib/ropencv/ropencv_types.rb', line 85497 def [](size) validate_index(size) __validate_pointer__ result = Rbind::std_vector_std_vector_char_operator_array( self, size) 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 |
#pop_back ⇒ Void
method wrapper for void std::vectorstd::vector<char>::pop_back()
85480 85481 85482 85483 |
# File 'lib/ropencv/ropencv_types.rb', line 85480 def pop_back() __validate_pointer__ Rbind::std_vector_std_vector_char_pop_back( self) end |
#push_back(other) ⇒ Void
method wrapper for void std::vectorstd::vector<char>::push_back(std::vector
85473 85474 85475 85476 |
# File 'lib/ropencv/ropencv_types.rb', line 85473 def push_back(other) __validate_pointer__ Rbind::std_vector_std_vector_char_push_back( self, other) end |
#reserve(size) ⇒ Void
method wrapper for void std::vectorstd::vector<char>::reserve(size_t size)
85406 85407 85408 85409 |
# File 'lib/ropencv/ropencv_types.rb', line 85406 def reserve(size) __validate_pointer__ Rbind::std_vector_std_vector_char_reserve( self, size) end |
#resize(size, val = Std::Vector::Char.new()) ⇒ Void
method wrapper for void std::vectorstd::vector<char>::resize(size_t size, std::vector
methods
85370 85371 85372 85373 |
# File 'lib/ropencv/ropencv_types.rb', line 85370 def resize(size, val = Std::Vector::Char.new()) __validate_pointer__ Rbind::std_vector_std_vector_char_resize( self, size, val) end |
#size ⇒ Size_T
method wrapper for size_t std::vectorstd::vector<char>::size()
85377 85378 85379 85380 |
# File 'lib/ropencv/ropencv_types.rb', line 85377 def size() __validate_pointer__ Rbind::std_vector_std_vector_char_size( self) end |
#swap(other) ⇒ Void
method wrapper for void std::vectorstd::vector<char>::swap(std::vectorstd::vector<char> other)
85488 85489 85490 85491 |
# File 'lib/ropencv/ropencv_types.rb', line 85488 def swap(other) __validate_pointer__ Rbind::std_vector_std_vector_char_swap( self, other) end |
#to_s ⇒ Object
converts Vector::Std_Vector_Char into a string by crawling through all its attributes
85357 85358 85359 |
# File 'lib/ropencv/ropencv_types.rb', line 85357 def to_s "#<std::vector<std::vector<char>> >" end |
#validate_index(idx) ⇒ Object
85503 85504 85505 85506 85507 |
# File 'lib/ropencv/ropencv_types.rb', line 85503 def validate_index(idx) if idx < 0 || idx >= size raise RangeError,"#{idx} is out of range [0..#{size-1}]" end end |