Class: OpenCV::Std::Vector::Int64_T

Inherits:
Object
  • Object
show all
Extended by:
FFI::DataConverter
Includes:
Enumerable
Defined in:
lib/ropencv/ropencv_types.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.vectorObject .vectorObject

Overloads:

Raises:

  • (ArgumentError)


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

.nullObject

returns a null pointer to the object



40053
40054
40055
# File 'lib/ropencv/ropencv_types.rb', line 40053

def self.null
    new(Vector::Int64_TStruct.new)
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

Note:

method wrapper for int64_t std::vector::operator

Parameters:

  • size (Size_T)

Returns:



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

Note:

method wrapper for int64_t std::vector::at(size_t size)

Parameters:

  • size (Size_T)

Returns:



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

#backFixnum

Note:

method wrapper for int64_t std::vector::back()

Returns:



40242
40243
40244
40245
# File 'lib/ropencv/ropencv_types.rb', line 40242

def back()
    __validate_pointer__
    Rbind::std_vector_int64t_back( self)
end

#capacitySize_T

Note:

method wrapper for size_t std::vector::capacity()

Returns:

  • (Size_T)


40195
40196
40197
40198
# File 'lib/ropencv/ropencv_types.rb', line 40195

def capacity()
    __validate_pointer__
    Rbind::std_vector_int64t_capacity( self)
end

#clearVoid

Note:

method wrapper for void std::vector::clear()

Returns:

  • (Void)


40188
40189
40190
40191
# File 'lib/ropencv/ropencv_types.rb', line 40188

def clear()
    __validate_pointer__
    Rbind::std_vector_int64t_clear( self)
end

#dataVoid

Note:

method wrapper for void* std::vector::data()

Returns:

  • (Void)


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

#emptyBool

Note:

method wrapper for bool std::vector::empty()

Returns:

  • (Bool)


40202
40203
40204
40205
# File 'lib/ropencv/ropencv_types.rb', line 40202

def empty()
    __validate_pointer__
    Rbind::std_vector_int64t_empty( self)
end

#frontFixnum

Note:

method wrapper for int64_t std::vector::front()

Returns:



40235
40236
40237
40238
# File 'lib/ropencv/ropencv_types.rb', line 40235

def front()
    __validate_pointer__
    Rbind::std_vector_int64t_front( self)
end

#get_elementFixnum

Note:

method wrapper for int64_t std::vector::operator

Parameters:

  • size (Size_T)

Returns:



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_backVoid

Note:

method wrapper for void std::vector::pop_back()

Returns:

  • (Void)


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

Note:

method wrapper for void std::vector::push_back(int64_t other)

Parameters:

Returns:

  • (Void)


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

Note:

method wrapper for void std::vector::reserve(size_t size)

Parameters:

  • size (Size_T)

Returns:

  • (Void)


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

Note:

method wrapper for void std::vector::resize(size_t size, int64_t val = int64_t())

methods

Parameters:

  • size (Size_T)
  • val (Fixnum) (defaults to: Int64_T())

Returns:

  • (Void)


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

#sizeSize_T

Note:

method wrapper for size_t std::vector::size()

Returns:

  • (Size_T)


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

Note:

method wrapper for void std::vector::swap(std::vector other)

Parameters:

Returns:

  • (Void)


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_sObject

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