Class: OpenCV::Std::Vector::Std_Vector_Char

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)


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

.nullObject

returns a null pointer to the object



85249
85250
85251
# File 'lib/ropencv/ropencv_types.rb', line 85249

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

Note:

method wrapper for std::vector std::vectorstd::vector<char>::operator

Parameters:

  • size (Size_T)

Returns:



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

Note:

method wrapper for std::vector std::vectorstd::vector<char>::at(size_t size)

Parameters:

  • size (Size_T)

Returns:



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

#backStd::Vector::Char

Note:

method wrapper for std::vector std::vectorstd::vector<char>::back()

Returns:



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

#capacitySize_T

Note:

method wrapper for size_t std::vectorstd::vector<char>::capacity()

Returns:

  • (Size_T)


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

#clearVoid

Note:

method wrapper for void std::vectorstd::vector<char>::clear()

Returns:

  • (Void)


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

#dataVoid

Note:

method wrapper for void* std::vectorstd::vector<char>::data()

Returns:

  • (Void)


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

#emptyBool

Note:

method wrapper for bool std::vectorstd::vector<char>::empty()

Returns:

  • (Bool)


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

#frontStd::Vector::Char

Note:

method wrapper for std::vector std::vectorstd::vector<char>::front()

Returns:



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_elementStd::Vector::Char

Note:

method wrapper for std::vector std::vectorstd::vector<char>::operator

Parameters:

  • size (Size_T)

Returns:



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_backVoid

Note:

method wrapper for void std::vectorstd::vector<char>::pop_back()

Returns:

  • (Void)


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

Note:

method wrapper for void std::vectorstd::vector<char>::push_back(std::vector other)

Parameters:

Returns:

  • (Void)


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

Note:

method wrapper for void std::vectorstd::vector<char>::reserve(size_t size)

Parameters:

  • size (Size_T)

Returns:

  • (Void)


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

Note:

method wrapper for void std::vectorstd::vector<char>::resize(size_t size, std::vector val = std::vector())

methods

Parameters:

Returns:

  • (Void)


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

#sizeSize_T

Note:

method wrapper for size_t std::vectorstd::vector<char>::size()

Returns:

  • (Size_T)


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

Note:

method wrapper for void std::vectorstd::vector<char>::swap(std::vectorstd::vector<char> other)

Parameters:

Returns:

  • (Void)


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_sObject

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