Class: OpenCV::Std::Vector::Uint64_T
- Inherits:
-
Object
- Object
- OpenCV::Std::Vector::Uint64_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 = Uint64_T()) ⇒ Void
methods.
- #size ⇒ Size_T
- #swap(other) ⇒ Void
-
#to_s ⇒ Object
converts Vector::Uint64_T into a string by crawling through all its attributes.
- #validate_index(idx) ⇒ Object
Class Method Details
.vector ⇒ Object .vector ⇒ Object
88088 88089 88090 88091 88092 88093 88094 88095 88096 88097 88098 88099 88100 88101 88102 88103 88104 88105 88106 88107 88108 88109 88110 88111 88112 88113 88114 88115 88116 88117 88118 88119 88120 88121 88122 |
# File 'lib/ropencv/ropencv_types.rb', line 88088 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(Vector::Uint64_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<uint64_t>::vector<uint64_t>() @@std_vector_uint64t_vector_uint64t_defaults0 ||= [] if(args.size >= 0 && args.size <= 0) targs = args.clone targs.size.upto(-1) do |i| targs[i] = @@std_vector_uint64t_vector_uint64t_defaults0[i] end begin return Rbind::std_vector_uint64t_vector_uint64t(*targs) rescue TypeError => e @error = e end end # overloaded method wrapper for std::vector<uint64_t>::vector<uint64_t>(std::vector<uint64_t> other) @@std_vector_uint64t_vector_uint64t_2_defaults1 ||= [nil] if(args.size >= 1 && args.size <= 1) targs = args.clone targs.size.upto(0) do |i| targs[i] = @@std_vector_uint64t_vector_uint64t_2_defaults1[i] end begin return Rbind::std_vector_uint64t_vector_uint64t_2(*targs) rescue TypeError => e @error = e end end raise ArgumentError, "no constructor for #{self}(#{args.inspect})" end |
.null ⇒ Object
returns a null pointer to the object
88080 88081 88082 |
# File 'lib/ropencv/ropencv_types.rb', line 88080 def self.null new(Vector::Uint64_TStruct.new) end |
Instance Method Details
#<<(val) ⇒ Object
88329 88330 88331 88332 |
# File 'lib/ropencv/ropencv_types.rb', line 88329 def <<(val) push_back(val) self end |
#[](idx) ⇒ Fixnum
88245 88246 88247 88248 88249 |
# File 'lib/ropencv/ropencv_types.rb', line 88245 def [](size) validate_index(size) __validate_pointer__ Rbind::std_vector_uint64t_operator_array( self, size) end |
#at(size) ⇒ Fixnum
method wrapper for uint64_t std::vector
88254 88255 88256 88257 88258 |
# File 'lib/ropencv/ropencv_types.rb', line 88254 def at(size) validate_index(size) __validate_pointer__ Rbind::std_vector_uint64t_at( self, size) end |
#back ⇒ Fixnum
method wrapper for uint64_t std::vector
88269 88270 88271 88272 |
# File 'lib/ropencv/ropencv_types.rb', line 88269 def back() __validate_pointer__ Rbind::std_vector_uint64t_back( self) end |
#capacity ⇒ Size_T
method wrapper for size_t std::vector
88222 88223 88224 88225 |
# File 'lib/ropencv/ropencv_types.rb', line 88222 def capacity() __validate_pointer__ Rbind::std_vector_uint64t_capacity( self) end |
#clear ⇒ Void
method wrapper for void std::vector
88215 88216 88217 88218 |
# File 'lib/ropencv/ropencv_types.rb', line 88215 def clear() __validate_pointer__ Rbind::std_vector_uint64t_clear( self) end |
#data ⇒ Void
method wrapper for void* std::vector
88276 88277 88278 88279 |
# File 'lib/ropencv/ropencv_types.rb', line 88276 def data() __validate_pointer__ Rbind::std_vector_uint64t_data( self) end |
#delete_if(&block) ⇒ Object
88333 88334 88335 88336 88337 88338 88339 88340 |
# File 'lib/ropencv/ropencv_types.rb', line 88333 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
88319 88320 88321 88322 88323 88324 88325 88326 88327 88328 |
# File 'lib/ropencv/ropencv_types.rb', line 88319 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
88229 88230 88231 88232 |
# File 'lib/ropencv/ropencv_types.rb', line 88229 def empty() __validate_pointer__ Rbind::std_vector_uint64t_empty( self) end |
#front ⇒ Fixnum
method wrapper for uint64_t std::vector
88262 88263 88264 88265 |
# File 'lib/ropencv/ropencv_types.rb', line 88262 def front() __validate_pointer__ Rbind::std_vector_uint64t_front( self) end |
#get_element ⇒ Fixnum
88308 88309 88310 88311 88312 |
# File 'lib/ropencv/ropencv_types.rb', line 88308 def [](size) validate_index(size) __validate_pointer__ Rbind::std_vector_uint64t_operator_array( self, size) end |
#pop_back ⇒ Void
method wrapper for void std::vector
88291 88292 88293 88294 |
# File 'lib/ropencv/ropencv_types.rb', line 88291 def pop_back() __validate_pointer__ Rbind::std_vector_uint64t_pop_back( self) end |
#push_back(other) ⇒ Void
method wrapper for void std::vector
88284 88285 88286 88287 |
# File 'lib/ropencv/ropencv_types.rb', line 88284 def push_back(other) __validate_pointer__ Rbind::std_vector_uint64t_push_back( self, other) end |
#reserve(size) ⇒ Void
method wrapper for void std::vector
88237 88238 88239 88240 |
# File 'lib/ropencv/ropencv_types.rb', line 88237 def reserve(size) __validate_pointer__ Rbind::std_vector_uint64t_reserve( self, size) end |
#resize(size, val = Uint64_T()) ⇒ Void
method wrapper for void std::vector
methods
88201 88202 88203 88204 |
# File 'lib/ropencv/ropencv_types.rb', line 88201 def resize(size, val = Uint64_T()) __validate_pointer__ Rbind::std_vector_uint64t_resize( self, size, val) end |
#size ⇒ Size_T
method wrapper for size_t std::vector
88208 88209 88210 88211 |
# File 'lib/ropencv/ropencv_types.rb', line 88208 def size() __validate_pointer__ Rbind::std_vector_uint64t_size( self) end |
#swap(other) ⇒ Void
method wrapper for void std::vector
88299 88300 88301 88302 |
# File 'lib/ropencv/ropencv_types.rb', line 88299 def swap(other) __validate_pointer__ Rbind::std_vector_uint64t_swap( self, other) end |
#to_s ⇒ Object
converts Vector::Uint64_T into a string by crawling through all its attributes
88188 88189 88190 |
# File 'lib/ropencv/ropencv_types.rb', line 88188 def to_s "#<std::vector<uint64_t> >" end |
#validate_index(idx) ⇒ Object
88314 88315 88316 88317 88318 |
# File 'lib/ropencv/ropencv_types.rb', line 88314 def validate_index(idx) if idx < 0 || idx >= size raise RangeError,"#{idx} is out of range [0..#{size-1}]" end end |