Class: OpenCV::Std::Vector::Cv_String
- Inherits:
-
Object
- Object
- OpenCV::Std::Vector::Cv_String
- 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) ⇒ Cv::String
- #at(size) ⇒ Cv::String
- #back ⇒ Cv::String
- #capacity ⇒ Size_T
- #clear ⇒ Void
- #data ⇒ Void
- #delete_if(&block) ⇒ Object
- #each(&block) ⇒ Object
- #empty ⇒ Bool
- #front ⇒ Cv::String
- #get_element ⇒ Cv::String
- #pop_back ⇒ Void
- #push_back(other) ⇒ Void
- #reserve(size) ⇒ Void
-
#resize(size, val = Cv::String.new()) ⇒ Void
methods.
- #size ⇒ Size_T
- #swap(other) ⇒ Void
-
#to_s ⇒ Object
converts Vector::Cv_String into a string by crawling through all its attributes.
- #validate_index(idx) ⇒ Object
Class Method Details
.vector ⇒ Object .vector ⇒ Object
33502 33503 33504 33505 33506 33507 33508 33509 33510 33511 33512 33513 33514 33515 33516 33517 33518 33519 33520 33521 33522 33523 33524 33525 33526 33527 33528 33529 33530 33531 33532 33533 33534 33535 33536 |
# File 'lib/ropencv/ropencv_types.rb', line 33502 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(Vector::Cv_StringStruct) 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<cv::String>::vector<cv::String>() @@std_vector_cv_string_vector_cv_string_defaults0 ||= [] if(args.size >= 0 && args.size <= 0) targs = args.clone targs.size.upto(-1) do |i| targs[i] = @@std_vector_cv_string_vector_cv_string_defaults0[i] end begin return Rbind::std_vector_cv_string_vector_cv_string(*targs) rescue TypeError => e @error = e end end # overloaded method wrapper for std::vector<cv::String>::vector<cv::String>(std::vector<cv::String> other) @@std_vector_cv_string_vector_cv_string2_defaults1 ||= [nil] if(args.size >= 1 && args.size <= 1) targs = args.clone targs.size.upto(0) do |i| targs[i] = @@std_vector_cv_string_vector_cv_string2_defaults1[i] end begin return Rbind::std_vector_cv_string_vector_cv_string2(*targs) rescue TypeError => e @error = e end end raise ArgumentError, "no constructor for #{self}(#{args.inspect})" end |
Instance Method Details
#<<(val) ⇒ Object
33763 33764 33765 33766 |
# File 'lib/ropencv/ropencv_types.rb', line 33763 def <<(val) push_back(val) self end |
#[](idx) ⇒ Cv::String
method wrapper for cv::String std::vectorcv::String::operator
33659 33660 33661 33662 33663 33664 33665 33666 33667 33668 |
# File 'lib/ropencv/ropencv_types.rb', line 33659 def [](size) validate_index(size) __validate_pointer__ result = Rbind::std_vector_cv_string_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) ⇒ Cv::String
method wrapper for cv::String std::vectorcv::String::at(size_t size)
33673 33674 33675 33676 33677 33678 33679 33680 33681 33682 |
# File 'lib/ropencv/ropencv_types.rb', line 33673 def at(size) validate_index(size) __validate_pointer__ result = Rbind::std_vector_cv_string_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 ⇒ Cv::String
method wrapper for cv::String std::vectorcv::String::back()
33698 33699 33700 33701 33702 33703 33704 33705 33706 |
# File 'lib/ropencv/ropencv_types.rb', line 33698 def back() __validate_pointer__ result = Rbind::std_vector_cv_string_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::vectorcv::String::capacity()
33636 33637 33638 33639 |
# File 'lib/ropencv/ropencv_types.rb', line 33636 def capacity() __validate_pointer__ Rbind::std_vector_cv_string_capacity( self) end |
#clear ⇒ Void
method wrapper for void std::vectorcv::String::clear()
33629 33630 33631 33632 |
# File 'lib/ropencv/ropencv_types.rb', line 33629 def clear() __validate_pointer__ Rbind::std_vector_cv_string_clear( self) end |
#data ⇒ Void
method wrapper for void* std::vectorcv::String::data()
33710 33711 33712 33713 |
# File 'lib/ropencv/ropencv_types.rb', line 33710 def data() __validate_pointer__ Rbind::std_vector_cv_string_data( self) end |
#delete_if(&block) ⇒ Object
33767 33768 33769 33770 33771 33772 33773 33774 |
# File 'lib/ropencv/ropencv_types.rb', line 33767 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
33753 33754 33755 33756 33757 33758 33759 33760 33761 33762 |
# File 'lib/ropencv/ropencv_types.rb', line 33753 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::vectorcv::String::empty()
33643 33644 33645 33646 |
# File 'lib/ropencv/ropencv_types.rb', line 33643 def empty() __validate_pointer__ Rbind::std_vector_cv_string_empty( self) end |
#front ⇒ Cv::String
method wrapper for cv::String std::vectorcv::String::front()
33686 33687 33688 33689 33690 33691 33692 33693 33694 |
# File 'lib/ropencv/ropencv_types.rb', line 33686 def front() __validate_pointer__ result = Rbind::std_vector_cv_string_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 ⇒ Cv::String
method wrapper for cv::String std::vectorcv::String::operator
33742 33743 33744 33745 33746 33747 33748 33749 33750 33751 |
# File 'lib/ropencv/ropencv_types.rb', line 33742 def [](size) validate_index(size) __validate_pointer__ result = Rbind::std_vector_cv_string_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::vectorcv::String::pop_back()
33725 33726 33727 33728 |
# File 'lib/ropencv/ropencv_types.rb', line 33725 def pop_back() __validate_pointer__ Rbind::std_vector_cv_string_pop_back( self) end |
#push_back(other) ⇒ Void
method wrapper for void std::vectorcv::String::push_back(cv::String other)
33718 33719 33720 33721 |
# File 'lib/ropencv/ropencv_types.rb', line 33718 def push_back(other) __validate_pointer__ Rbind::std_vector_cv_string_push_back( self, other) end |
#reserve(size) ⇒ Void
method wrapper for void std::vectorcv::String::reserve(size_t size)
33651 33652 33653 33654 |
# File 'lib/ropencv/ropencv_types.rb', line 33651 def reserve(size) __validate_pointer__ Rbind::std_vector_cv_string_reserve( self, size) end |
#resize(size, val = Cv::String.new()) ⇒ Void
method wrapper for void std::vectorcv::String::resize(size_t size, cv::String val = cv::String())
methods
33615 33616 33617 33618 |
# File 'lib/ropencv/ropencv_types.rb', line 33615 def resize(size, val = Cv::String.new()) __validate_pointer__ Rbind::std_vector_cv_string_resize( self, size, val) end |
#size ⇒ Size_T
method wrapper for size_t std::vectorcv::String::size()
33622 33623 33624 33625 |
# File 'lib/ropencv/ropencv_types.rb', line 33622 def size() __validate_pointer__ Rbind::std_vector_cv_string_size( self) end |
#swap(other) ⇒ Void
method wrapper for void std::vectorcv::String::swap(std::vectorcv::String other)
33733 33734 33735 33736 |
# File 'lib/ropencv/ropencv_types.rb', line 33733 def swap(other) __validate_pointer__ Rbind::std_vector_cv_string_swap( self, other) end |
#to_s ⇒ Object
converts Vector::Cv_String into a string by crawling through all its attributes
33602 33603 33604 |
# File 'lib/ropencv/ropencv_types.rb', line 33602 def to_s "#<std::vector<cv::String> >" end |
#validate_index(idx) ⇒ Object
33748 33749 33750 33751 33752 |
# File 'lib/ropencv/ropencv_types.rb', line 33748 def validate_index(idx) if idx < 0 || idx >= size raise RangeError,"#{idx} is out of range [0..#{size-1}]" end end |