Class: OpenCV::Std::Vector::Int64_T
- Inherits:
-
Object
- Object
- OpenCV::Std::Vector::Int64_T
- 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) ⇒ Fixnum
- #at(size) ⇒ Fixnum
- #back ⇒ Fixnum
- #capacity ⇒ Size_T
- #clear ⇒ Void
- #data ⇒ Void
- #delete_if(&block) ⇒ Object
- #each(&block) ⇒ Object
- #empty ⇒ Bool
- #front ⇒ Fixnum
- #get_element ⇒ Fixnum
- #pop_back ⇒ Void
- #push_back(other) ⇒ Void
- #reserve(size) ⇒ Void
-
#resize(size, val = Int64_T()) ⇒ Void
methods.
- #size ⇒ Size_T
- #swap(other) ⇒ Void
-
#to_s ⇒ Object
converts Vector::Int64_T into a string by crawling through all its attributes.
- #validate_index(idx) ⇒ Object
Class Method Details
.vector ⇒ Object .vector ⇒ Object
40061 40062 40063 40064 40065 40066 40067 40068 40069 40070 40071 40072 40073 40074 40075 40076 40077 40078 40079 40080 40081 40082 40083 40084 40085 40086 40087 40088 40089 40090 40091 40092 40093 40094 40095 |
# File 'lib/ropencv/ropencv_types.rb', line 40061 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(Vector::Int64_TStruct) 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<int64_t>::vector<int64_t>() @@std_vector_int64t_vector_int64t_defaults0 ||= [] if(args.size >= 0 && args.size <= 0) targs = args.clone targs.size.upto(-1) do |i| targs[i] = @@std_vector_int64t_vector_int64t_defaults0[i] end begin return Rbind::std_vector_int64t_vector_int64t(*targs) rescue TypeError => e @error = e end end # overloaded method wrapper for std::vector<int64_t>::vector<int64_t>(std::vector<int64_t> other) @@std_vector_int64t_vector_int64t2_defaults1 ||= [nil] if(args.size >= 1 && args.size <= 1) targs = args.clone targs.size.upto(0) do |i| targs[i] = @@std_vector_int64t_vector_int64t2_defaults1[i] end begin return Rbind::std_vector_int64t_vector_int64t2(*targs) rescue TypeError => e @error = e end end raise ArgumentError, "no constructor for #{self}(#{args.inspect})" end |
Instance Method Details
#<<(val) ⇒ Object
40302 40303 40304 40305 |
# File 'lib/ropencv/ropencv_types.rb', line 40302 def <<(val) push_back(val) self end |
#[](idx) ⇒ Fixnum
40218 40219 40220 40221 40222 |
# File 'lib/ropencv/ropencv_types.rb', line 40218 def [](size) validate_index(size) __validate_pointer__ Rbind::std_vector_int64t_operator_array( self, size) end |
#at(size) ⇒ Fixnum
method wrapper for int64_t std::vector
40227 40228 40229 40230 40231 |
# File 'lib/ropencv/ropencv_types.rb', line 40227 def at(size) validate_index(size) __validate_pointer__ Rbind::std_vector_int64t_at( self, size) end |
#back ⇒ Fixnum
method wrapper for int64_t std::vector
40242 40243 40244 40245 |
# File 'lib/ropencv/ropencv_types.rb', line 40242 def back() __validate_pointer__ Rbind::std_vector_int64t_back( self) end |
#capacity ⇒ Size_T
method wrapper for size_t std::vector
40195 40196 40197 40198 |
# File 'lib/ropencv/ropencv_types.rb', line 40195 def capacity() __validate_pointer__ Rbind::std_vector_int64t_capacity( self) end |
#clear ⇒ Void
method wrapper for void std::vector
40188 40189 40190 40191 |
# File 'lib/ropencv/ropencv_types.rb', line 40188 def clear() __validate_pointer__ Rbind::std_vector_int64t_clear( self) end |
#data ⇒ Void
method wrapper for void* std::vector
40249 40250 40251 40252 |
# File 'lib/ropencv/ropencv_types.rb', line 40249 def data() __validate_pointer__ Rbind::std_vector_int64t_data( self) end |
#delete_if(&block) ⇒ Object
40306 40307 40308 40309 40310 40311 40312 40313 |
# File 'lib/ropencv/ropencv_types.rb', line 40306 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
40292 40293 40294 40295 40296 40297 40298 40299 40300 40301 |
# File 'lib/ropencv/ropencv_types.rb', line 40292 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::vector
40202 40203 40204 40205 |
# File 'lib/ropencv/ropencv_types.rb', line 40202 def empty() __validate_pointer__ Rbind::std_vector_int64t_empty( self) end |
#front ⇒ Fixnum
method wrapper for int64_t std::vector
40235 40236 40237 40238 |
# File 'lib/ropencv/ropencv_types.rb', line 40235 def front() __validate_pointer__ Rbind::std_vector_int64t_front( self) end |
#get_element ⇒ Fixnum
40281 40282 40283 40284 40285 |
# File 'lib/ropencv/ropencv_types.rb', line 40281 def [](size) validate_index(size) __validate_pointer__ Rbind::std_vector_int64t_operator_array( self, size) end |
#pop_back ⇒ Void
method wrapper for void std::vector
40264 40265 40266 40267 |
# File 'lib/ropencv/ropencv_types.rb', line 40264 def pop_back() __validate_pointer__ Rbind::std_vector_int64t_pop_back( self) end |
#push_back(other) ⇒ Void
method wrapper for void std::vector
40257 40258 40259 40260 |
# File 'lib/ropencv/ropencv_types.rb', line 40257 def push_back(other) __validate_pointer__ Rbind::std_vector_int64t_push_back( self, other) end |
#reserve(size) ⇒ Void
method wrapper for void std::vector
40210 40211 40212 40213 |
# File 'lib/ropencv/ropencv_types.rb', line 40210 def reserve(size) __validate_pointer__ Rbind::std_vector_int64t_reserve( self, size) end |
#resize(size, val = Int64_T()) ⇒ Void
method wrapper for void std::vector
methods
40174 40175 40176 40177 |
# File 'lib/ropencv/ropencv_types.rb', line 40174 def resize(size, val = Int64_T()) __validate_pointer__ Rbind::std_vector_int64t_resize( self, size, val) end |
#size ⇒ Size_T
method wrapper for size_t std::vector
40181 40182 40183 40184 |
# File 'lib/ropencv/ropencv_types.rb', line 40181 def size() __validate_pointer__ Rbind::std_vector_int64t_size( self) end |
#swap(other) ⇒ Void
method wrapper for void std::vector
40272 40273 40274 40275 |
# File 'lib/ropencv/ropencv_types.rb', line 40272 def swap(other) __validate_pointer__ Rbind::std_vector_int64t_swap( self, other) end |
#to_s ⇒ Object
converts Vector::Int64_T into a string by crawling through all its attributes
40161 40162 40163 |
# File 'lib/ropencv/ropencv_types.rb', line 40161 def to_s "#<std::vector<int64_t> >" end |
#validate_index(idx) ⇒ Object
40287 40288 40289 40290 40291 |
# File 'lib/ropencv/ropencv_types.rb', line 40287 def validate_index(idx) if idx < 0 || idx >= size raise RangeError,"#{idx} is out of range [0..#{size-1}]" end end |