<< Vector_format_info_t
 Top   Types   Functions   Classes   Options   Index   Sources 

struct Vector / Vector_t

Concrete Class


Description

The Vector Class

This class implements dynamically resizable arrays.

Throughout the documentation, the following prefixes will be used:

Global_

The library prefix: for applications, this is typically empty, for an xyz-Library, this is either XYZ_, xyz_ or Xyz, depending on the identifier in occurs in.

TemplateInstantiation
Global_VECTOR_OKXYZ_VECTOR_OK
Global_vector_newxyz_vector_new
Vector_

This is equivalent to Global_vector_oType, or the name that was set with -name=... for this data structure. The case and underbar convention is adjusted, too.

Assuming a library prefix xyz and oType == char, you get:

TemplateInstantiation
Vector_txyz_vector_char_t
Vector_ALLOW_NULLXYZ_VECTOR_CHAR_ALLOW_NULL
Vector_class

This is the name of the data structure type in C++: capitalised and with underbars removed:

Vector_tVector_class
vector_char_tVectorChar

Conventions

It was tried to keep the argument order consistent, with some rules:

Results

Status Codes

These are undef'ed first because there is only one error code for all the arrays in your program. All the functions returing error codes will both return this error and write it into Global_vector_errno.

ConditionDescriptionMacro to use
= Global_VECTOR_OKOk.Global_VECTOR_IS_OK(X)
< Global_VECTOR_OKError: operation did not succeed.Global_VECTOR_IS_ERROR(X)
> Global_VECTOR_OKWarning: operation succeeded but not perfectly. (e.g. rehash failed)Global_VECTOR_IS_WARNING(X)

In all cases, the consistency of the data structure is guaranteed.

Warnings are only visible in Global_vector_errno; the functions still return VECTOR_OK.

Members

voidclear_errno()
voiddelete_array(Vector_element_ptr_t array)
Vector_index_tformat_pos()
boolformat_quoted()
intget_errno()
Vector_cnt_tinline_store_cnt()
Vector_t const &static_zero()
Vector_tstringify(ERWIN_UNSIGNED_LONG_LONG a, int base, int options, int width, int prec = -1)
Vector_tstringify(ERWIN_LONG_LONG a, int base, int options, int width, int prec = -1)
Vector_tstringify(unsigned long a, int base, int options, int width, int prec = -1)
Vector_tstringify(long a, int base, int options, int width, int prec = -1)
Vector_tstringify(unsigned a, int base, int options, int width, int prec = -1)
Vector_tstringify(int a, int base, int options, int width, int prec = -1)
Vector_tstringify(unsigned short a, int base, int options, int width, int prec = -1)
Vector_tstringify(short a, int base, int options, int width, int prec = -1)
Vector_tstringify(double a, int base, int options, int width, int prec = -1)
Vector_tstringify(char a, int options, int width)
Vector_tstringify(char const * a, int options, int width, int prec = -1)
Vector_tstringify(wchar_t const * a, int options, int width, int prec = -1)
Vector_tstringify(Vector_t const * a, int options, int width, int prec = -1)
Vector_tstringify(Vector_t const & a, int options, int width, int prec = -1)
Vector_tstringify(bool a, int options, int width, int prec = -1)
voidoperator delete(void *, size_t)
voidoperator delete[](void *, size_t)
void *operator new(size_t)
void *operator new[](size_t)
Vector()
Vector(Vector_cnt_t initial_size)
Vector(oTypeTouched)
Vector(oTypeTouched, Vector_cnt_t)
Vector(Vector_t const *, bool do_copy = true)
Vector(Vector_t const *, Vector_index_t, Vector_cnt_t, bool do_copy = true)
Vector(oTypeVar const *, bool do_copy = true)
Vector(oTypeVar const *, Vector_cnt_t, bool do_copy = true)
Vector(oType const *)
Vector(oType const *, Vector_cnt_t)
Vector(bool must_be_true, oTypeVar * other, Vector_cnt_t count, Vector_cnt_t alloc)
Vector(bool must_be_true, oTypeVar * other, Vector_cnt_t count, Vector_cnt_t alloc, oTypeTouched zero_element)
Vector(bool must_be_true, Vector_t * other)
Vector(bool must_be_true, Vector_t & other)
Vector(Vector_t const &, bool docopy = true)
Vector(Vector_t const &, Vector_index_t, Vector_cnt_t, bool do_copy = true)
~Vector()
operator Vector_t *()
operator Vector_t const *() const
booloperator!=(Vector_t const & b) const
booloperator!=(Vector_t const * b) const
Vector_element_ref_toperator*()
oTypeResultoperator*() const
Vector_element_ref_toperator*()
oTypeResultoperator*() const
Vector_element_ptr_toperator+(Vector_index_t i)
oType const *operator+(Vector_index_t i) const
Vector_element_ptr_toperator+() const
Vector_element_ptr_toperator+(Vector_index_t i)
oType const *operator+(Vector_index_t i) const
Vector_element_ptr_toperator+() const
booloperator<(Vector_t const & b) const
booloperator<(Vector_t const * b) const
Vector_t &operator<<(oType const * a)
Vector_t &operator<<(oTypeTouched a)
Vector_t &operator<<(Vector_t const * a)
Vector_t &operator<<(Vector_t const & a)
Vector_t &operator<<(ERWIN_UNSIGNED_LONG_LONG a)
Vector_t &operator<<(ERWIN_LONG_LONG a)
Vector_t &operator<<(unsigned long a)
Vector_t &operator<<(signed long a)
Vector_t &operator<<(unsigned int a)
Vector_t &operator<<(signed int a)
Vector_t &operator<<(double a)
Vector_t &operator<<(void * a)
Vector_t &operator<<(unsigned short a)
Vector_t &operator<<(signed short a)
Vector_t &operator<<(bool a)
booloperator<=(Vector_t const & b) const
booloperator<=(Vector_t const * b) const
Vector_t &operator=(Vector_t const &)
Vector_t &operator=(Vector_t const *)
booloperator==(Vector_t const & b) const
booloperator==(Vector_t const * b) const
booloperator>(Vector_t const & b) const
booloperator>(Vector_t const * b) const
booloperator>=(Vector_t const & b) const
booloperator>=(Vector_t const * b) const
oTypeResultoperator[](Vector_index_t i) const
Vector_element_ref_toperator[](Vector_index_t i)
Vector_element_ref_toperator[](Vector_index_t i)
oTypeResultoperator[](Vector_index_t i) const
operatorVector_element_ptr_t() const
void_constructor()
void_destructor()
Vector_t &append(oTypeTouched a)
Vector_t &append(Vector_t const * a)
Vector_t &append(Vector_t const & a)
Vector_t &append(oType const * a)
Vector_t &append_basename(Vector_t const & other)
Vector_t &append_basename(Vector_t const * other)
Vector_t &append_config_file_name(oType const * progname, bool local = false)
Vector_t &append_directory(Vector_t const & other)
Vector_t &append_directory(Vector_t const * other)
Vector_t &append_no_copy(oTypeVar const * a, Vector_cnt_t n)
Vector_t &append_raw(oType const * a, Vector_cnt_t n)
Vector_t &append_string(oType const * a)
Vector_t &append_subvector(Vector_t const & a, Vector_index_t b, Vector_cnt_t c = -1, Global_ERWIN_BOOL d = Global_ERWIN_TRUE)
Vector_t &append_subvector(Vector_t const * a, Vector_index_t b, Vector_cnt_t c = -1, Global_ERWIN_BOOL d = Global_ERWIN_TRUE)
Vector_t &append_vector(Vector_t const * a)
Vector_t &append_vector(Vector_t const & a)
Vector_element_ptr_tas_array() const
Vector_element_ptr_tas_array_detach()
Vector_element_ptr_tas_open_array() const
Vector_element_ptr_tas_open_array_detach()
Vector_index_tbasename_index() const
voidbasename_range(Vector_index_t & no1, Vector_cnt_t & length) const
Vector_index_tbfind(oTypeParam a, Vector_cmp_t f = NULL) const
operatorbool() const
Vector_t &chomp()
Vector_t &chop(Vector_cnt_t n = 1)
Vector_t &chop(bool a, bool b = true)
Vector_t &chop(Vector_cnt_t n, bool a, bool b = true)
Vector_t &chop(Vector_cnt_t n, bool a)
Vector_t &clear()
Vector_t &clear(bool a, bool b = true)
voidclear_errno() const
Vector_t &clear_keep(Vector_cnt_t n)
Vector_t &clear_no_resize()
intcmp(Vector_t const * other, Vector_cmp_t fcmp = Vector_CMP_T_NULL) const
intcmp(Vector_t const & other, Vector_cmp_t cmp_func = Vector_CMP_T_NULL) const
Vector_t *copy() const
Vector_t *copy_detach()
Vector_t *copy_err(int * err) const
Vector_t &detach()
Vector_t &detach_as_is()
boolempty() const
Vector_t &ensure_heap_storage()
Vector_t &ensure_size(Vector_cnt_t a)
Vector_t &ensure_size(Vector_cnt_t a, oTypeTouched b)
intensure_table_size(Vector_cnt_t a)
Vector_t &erase(Vector_index_t i, Vector_cnt_t n = -1)
Vector_t &erase(Vector_index_t i, Vector_cnt_t n, bool a, bool b = true)
Vector_t &erase(Vector_index_t i, Vector_cnt_t n, bool a)
Vector_cnt_terase_equals(Vector_cmp_t fcmp = Vector_CMP_T_NULL, Vector_combine_t combine = Vector_COMBINE_T_NULL)
Vector_cnt_terase_if(Vector_feature_t f, bool inv = true, bool a = true, bool b = true)
Vector_cnt_terase_if(Vector_feature_t f, bool inv = true, bool a = true)
Vector_cnt_terase_if_not(Vector_feature_t f, bool inv = true, bool a = true, bool b = true)
Vector_cnt_terase_if_not(Vector_feature_t f, bool inv = true, bool a = true)
Vector_cnt_terase_zero()
Vector_t &fgets(FILE * fileptr, Vector_cnt_t max_count = -1)
Vector_index_tfind(oTypeParam needle) const
Vector_index_tfind(oType const * needle, Vector_cnt_t n) const
Vector_index_tfind(oType const * needle) const
Vector_index_tfind(Vector_t const & needle) const
Vector_index_tfind(Vector_t const * needle) const
Vector_index_tfind(Vector_index_t a, oTypeParam needle) const
Vector_index_tfind(Vector_index_t a, oType const * needle, Vector_cnt_t n) const
Vector_index_tfind(Vector_index_t a, oType const * needle) const
Vector_index_tfind(Vector_index_t a, Vector_t const & needle) const
Vector_index_tfind(Vector_index_t a, Vector_t const * needle) const
Vector_index_tfind_if(Vector_feature_t feature, bool inverted = true)
Vector_index_tfind_if(Vector_index_t start, Vector_feature_t feature, bool inverted = true)
Vector_index_tfind_if_not(Vector_feature_t feature, bool inverted = true)
Vector_index_tfind_if_not(Vector_index_t start, Vector_feature_t feature, bool inverted = true)
Vector_index_tfind_raw(oType const * needle, Vector_cnt_t n) const
Vector_index_tfind_raw(Vector_index_t a, oType const * needle, Vector_cnt_t n) const
Vector_index_tfind_string(oType const * needle) const
Vector_index_tfind_string(Vector_index_t a, oType const * needle) const
Vector_index_tfind_vector(Vector_t const & needle) const
Vector_index_tfind_vector(Vector_t const * needle) const
Vector_index_tfind_vector(Vector_index_t a, Vector_t const & needle) const
Vector_index_tfind_vector(Vector_index_t a, Vector_t const * needle) const
oTypeResultfirst() const
Vector_element_ptr_tfirst_ptr()
Vector_element_ref_tfirst_ref()
oTypeVarfirst_swap_chop1()
Vector_t &format(Tchar const *, ...)
Vector_t &format(unsigned long int, Tchar const *, ...)
Vector_t &format(Vector_format_info_t *, Tchar const *, ...)
Vector_t &format(Vector_format_info_t *, unsigned long int, Tchar const *, ...)
intfread(FILE * fileptr, Vector_cnt_t max_count = -1)
intget_errno() const
boolhas_heap_storage() const
Global_hashval_thash() const
Global_hashval_thash_raw() const
Vector_t &heap_erase(Vector_index_t i, Vector_cmp_t f = Vector_CMP_T_NULL)
oTypeVarheap_extract(Vector_cmp_t f = Vector_CMP_T_NULL)
Vector_index_theap_father(Vector_index_t i) const
Vector_t &heap_fix(Vector_index_t i, Vector_cmp_t f = Vector_CMP_T_NULL)
Vector_t &heap_insert(oTypeParam elem, Vector_cmp_t f = Vector_CMP_T_NULL)
Vector_index_theap_left(Vector_index_t i) const
Vector_t &heap_raise(Vector_index_t i, Vector_cmp_t f = Vector_CMP_T_NULL)
Vector_index_theap_right(Vector_index_t i) const
Vector_t &heap_sink(Vector_index_t i, Vector_cmp_t f = Vector_CMP_T_NULL)
Vector_t &heap_sort(Vector_cmp_t f = Vector_CMP_T_NULL)
Vector_t &insert(Vector_index_t i, oTypeTouched a)
Vector_t &insert(Vector_index_t i, Vector_t const & a, Vector_index_t b, Vector_cnt_t c = -1, Global_ERWIN_BOOL d = Global_ERWIN_TRUE)
Vector_t &insert(Vector_index_t i, Vector_t const * a, Vector_index_t b, Vector_cnt_t c = -1, Global_ERWIN_BOOL d = Global_ERWIN_TRUE)
Vector_t &insert(Vector_index_t i, oType const * a, Vector_cnt_t n)
Vector_t &insert(Vector_index_t i, oType const * a)
Vector_t &insert(Vector_index_t i, Vector_t const * a)
Vector_t &insert(Vector_index_t i, Vector_t const & a)
Vector_t &insert_no_copy(Vector_index_t i, oTypeVar const * a, Vector_cnt_t n)
Vector_t &insert_raw(Vector_index_t i, oType const * a, Vector_cnt_t n)
Vector_t &insert_string(Vector_index_t i, oType const * a)
Vector_t &insert_subvector(Vector_index_t i, Vector_t const * a, Vector_index_t b = 0, Vector_cnt_t c = -1, Global_ERWIN_BOOL d = Global_ERWIN_TRUE)
Vector_t &insert_subvector(Vector_index_t i, Vector_t const & a, Vector_index_t b = 0, Vector_cnt_t c = -1, Global_ERWIN_BOOL d = Global_ERWIN_TRUE)
Vector_t &insert_vector(Vector_index_t i, Vector_t const * a)
Vector_t &insert_vector(Vector_index_t i, Vector_t const & a)
boolis_equal_at(Vector_index_t a, oType const * b, Vector_cnt_t n) const
boolis_equal_at(Vector_index_t a, oType const * b) const
boolis_equal_at(Vector_index_t a, Vector_t const & b) const
boolis_equal_at(Vector_index_t a, Vector_t const * b) const
boolis_equal_at_raw(Vector_index_t a, oType const * b, Vector_cnt_t n) const
boolis_equal_at_string(Vector_index_t a, oType const * b) const
boolis_equal_at_vector(Vector_index_t a, Vector_t const & b) const
boolis_equal_at_vector(Vector_index_t a, Vector_t const * b) const
oTypeResultlast() const
oTypeVarlast_chop1()
Vector_element_ptr_tlast_ptr()
Vector_element_ref_tlast_ref()
boollocate(Vector_index_t & index, oTypeParam element, int how) const
boollocate(Vector_index_t & index, oTypeParam element, Vector_cmp_t fcmp = Vector_CMP_T_NULL, int how = 0) const
Vector_t &ltrim()
Vector_t &ltrim_if(Vector_feature_t feature, bool inverted = true)
Vector_t &ltrim_if_not(Vector_feature_t feature, bool inverted = true)
Vector_t &make_gap(Vector_index_t a, Vector_cnt_t b)
Vector_t &make_gap(Vector_index_t a, oTypeTouched x, Vector_cnt_t b)
Vector_t &make_gap_with(Vector_index_t a, oTypeTouched x, Vector_cnt_t b)
Vector_t &make_heap(Vector_cmp_t f = Vector_CMP_T_NULL)
Vector_t &map(Vector_map_t fmap)
oTypeVarmodify(Vector_index_t i, oTypeTouched v)
Vector_cnt_tnentries() const
Vector_cnt_tnentries() const
boolnon_empty() const
oTypeResultnth(Vector_index_t i) const
oTypeResultnth_char(Vector_index_t i) const
Vector_element_ptr_tnth_ptr(Vector_index_t i)
oType const *nth_ptr(Vector_index_t i) const
Vector_element_ptr_tnth_ptr_char(Vector_index_t i)
oType const *nth_ptr_char(Vector_index_t i) const
Vector_element_ptr_tnth_ptr_check(Vector_index_t i)
oType const *nth_ptr_check(Vector_index_t i) const
Vector_element_ref_tnth_ref(Vector_index_t i)
oType const &nth_ref(Vector_index_t i) const
Vector_element_ref_tnth_ref_char(Vector_index_t i)
oType const &nth_ref_char(Vector_index_t i) const
Vector_element_ref_tnth_ref_check(Vector_index_t i)
oType const &nth_ref_check(Vector_index_t i) const
Vector_t &overwrite(Vector_index_t i, Vector_t const * a, Vector_index_t ia, Vector_cnt_t n)
Vector_t &overwrite(Vector_index_t i, Vector_t const & a, Vector_index_t ia, Vector_cnt_t n)
Vector_t &overwrite(Vector_index_t i, oType const * a, Vector_cnt_t n)
Vector_t &overwrite(Vector_index_t i, oType const * a)
Vector_t &overwrite(Vector_index_t i, Vector_t const * a)
Vector_t &overwrite(Vector_index_t i, Vector_t const & a)
Vector_t &overwrite_flags(Vector_index_t i, oType const * a, Vector_cnt_t n, bool dealloc, bool docopy)
Vector_t &overwrite_raw(Vector_index_t i, oType const * a, Vector_cnt_t n)
Vector_t &overwrite_string(Vector_index_t i, oType const * a)
Vector_t &overwrite_vector(Vector_index_t i, Vector_t const * a)
Vector_t &overwrite_vector(Vector_index_t i, Vector_t const & a)
Vector_index_tpos()
Vector_index_t *pos_ptr()
Vector_index_t &pos_ref()
Vector_t &prepend(oTypeTouched a)
Vector_t &prepend(Vector_t const * a)
Vector_t &prepend(Vector_t const & a)
Vector_t &prepend(oType const * a)
Vector_t &prepend_no_copy(oTypeVar const * a, Vector_cnt_t n)
Vector_t &prepend_raw(oType const * a, Vector_cnt_t n)
Vector_t &prepend_string(oType const * a)
Vector_t &prepend_vector(Vector_t const * a)
Vector_t &prepend_vector(Vector_t const & a)
intpriority_cmp(Vector_t const * other, Vector_cmp_t fcmp = Vector_CMP_T_NULL) const
intpriority_cmp(Vector_t const & other, Vector_cmp_t fcmp = Vector_CMP_T_NULL) const
Vector_t &qsort(Vector_cmp_t f = Vector_CMP_T_NULL)
Vector_t &reverse()
Vector_index_trfind(oTypeParam needle) const
Vector_index_trfind(oType const * needle, Vector_cnt_t n) const
Vector_index_trfind(oType const * needle) const
Vector_index_trfind(Vector_t const & needle) const
Vector_index_trfind(Vector_t const * needle) const
Vector_index_trfind(Vector_index_t a, oTypeParam needle) const
Vector_index_trfind(Vector_index_t a, oType const * needle, Vector_cnt_t n) const
Vector_index_trfind(Vector_index_t a, oType const * needle) const
Vector_index_trfind(Vector_index_t a, Vector_t const & needle) const
Vector_index_trfind(Vector_index_t a, Vector_t const * needle) const
Vector_index_trfind_if(Vector_feature_t feature, bool inverted = true)
Vector_index_trfind_if(Vector_index_t start, Vector_feature_t feature, bool inverted = true)
Vector_index_trfind_if_not(Vector_feature_t feature, bool inverted = true)
Vector_index_trfind_if_not(Vector_index_t start, Vector_feature_t feature, bool inverted = true)
Vector_index_trfind_raw(oType const * needle, Vector_cnt_t n) const
Vector_index_trfind_raw(Vector_index_t a, oType const * needle, Vector_cnt_t n) const
Vector_index_trfind_string(oType const * needle) const
Vector_index_trfind_string(Vector_index_t a, oType const * needle) const
Vector_index_trfind_vector(Vector_t const & needle) const
Vector_index_trfind_vector(Vector_t const * needle) const
Vector_index_trfind_vector(Vector_index_t a, Vector_t const & needle) const
Vector_index_trfind_vector(Vector_index_t a, Vector_t const * needle) const
Vector_t &rtrim()
Vector_t &rtrim_if(Vector_feature_t feature, bool inv = true)
Vector_t &rtrim_if_not(Vector_feature_t feature, bool inv = true)
Vector_t &set(Vector_index_t i, oTypeTouched v)
voidset_pos(Vector_index_t y)
Vector_t &set_size(Vector_cnt_t a)
Vector_t &set_size(Vector_cnt_t a, oTypeTouched b)
Vector_t &shrink(bool tight = true)
Vector_t &sort(Vector_cmp_t f = Vector_CMP_T_NULL)
Vector_cnt_tstring_length(oType const * a) const
Vector_t *subvector(Vector_index_t b, Vector_cnt_t c) const
Vector_t *subvector(Vector_index_t b, Vector_cnt_t c, bool d) const
Vector_t &swap(Vector_index_t a, Vector_index_t b)
Vector_t &swap_chop(Vector_cnt_t n = 1)
Vector_t &swap_chop(bool a, bool b = true)
Vector_t &swap_chop(Vector_cnt_t n, bool a, bool b = true)
Vector_t &swap_chop(Vector_cnt_t n, bool a)
Vector_t &swap_erase(Vector_index_t i, Vector_cnt_t n = -1)
Vector_t &swap_erase(Vector_index_t i, Vector_cnt_t n, bool a, bool b = true)
Vector_cnt_ttable_size() const
Vector_t &to_lower()
Vector_t &to_upper()
Vector_t &trim()
Vector_t &trim_if(Vector_feature_t feature, bool inv = true)
Vector_t &trim_if_not(Vector_feature_t feature, bool inv = true)
Vector_t &vformat(Tchar const *, va_list)
Vector_t &vformat(unsigned long int, Tchar const *, va_list)
Vector_t &vformat(Vector_format_info_t *, Tchar const *, va_list)
Vector_t &vformat(Vector_format_info_t *, unsigned long int, Tchar const *, va_list)
Vector_t &xchg(Vector_t * other)
Vector_t &xchg(Vector_t & other)
oTypeResultzero() const


Detailed Descriptions


#if !Global_ERWIN_DEFAULT_NEW_DELETE

static void * operator new (size_t)

C++: void * Vector_t::operator new (size_t)
#endif
Declaration  ]


#if !Global_ERWIN_DEFAULT_NEW_DELETE

static void operator delete (void *, size_t)

C++: void Vector_t::operator delete (void *, size_t)
#endif
Declaration  ]


#if !Global_ERWIN_DEFAULT_NEW_DELETE

static void * operator new[] (size_t)

C++: void * Vector_t::operator new[] (size_t)
#endif
Declaration  ]


#if !Global_ERWIN_DEFAULT_NEW_DELETE

static void operator delete[] (void *, size_t)

C++: void Vector_t::operator delete[] (void *, size_t)
#endif
Declaration  ]


[constructor] Vector ()

C++: Vector_t::Vector ()
Declaration  ]


static Vector_t const & static_zero ()

C++: Vector_t const & Vector_t::static_zero ()
Declaration  ]


#if Vector_HAVE_INT_CONSTRUCTOR

[constructor] Vector (Vector_cnt_t initial_size)

C++: Vector_t::Vector (int initial_size)
#endif
Declaration  ]


#if Vector_DYN_ZERO

[constructor] Vector (oTypeTouched)

C++: Vector_t::Vector (oTypeTouched)
#endif
Declaration  ]


#if Vector_DYN_ZERO

[constructor] Vector (oTypeTouched, Vector_cnt_t)

C++: Vector_t::Vector (oTypeTouched, int)
#endif
Declaration  ]


[constructor] Vector (Vector_t const *, bool do_copy = true)

C++: Vector_t::Vector (Vector_t const *, bool do_copy = true)
Declaration  ]


[constructor] Vector (Vector_t const *, Vector_index_t, Vector_cnt_t, bool do_copy = true)

C++: Vector_t::Vector (Vector_t const *, int, int, bool do_copy = true)
Declaration  ]


[constructor] Vector (oTypeVar const *, bool do_copy = true)

C++: Vector_t::Vector (oTypeVar const *, bool do_copy = true)
Declaration  ]


[constructor] Vector (oTypeVar const *, Vector_cnt_t, bool do_copy = true)

C++: Vector_t::Vector (oTypeVar const *, int, bool do_copy = true)
Declaration  ]


[constructor] Vector (oType const *)

C++: Vector_t::Vector (oType const *)
Declaration  ]


[constructor] Vector (oType const *, Vector_cnt_t)

C++: Vector_t::Vector (oType const *, int)
Declaration  ]


[constructor] Vector (bool must_be_true, oTypeVar * other, Vector_cnt_t count, Vector_cnt_t alloc)

C++: Vector_t::Vector (bool must_be_true, oTypeVar * other, int count, int alloc)

alloc may be -1: see Vector_new_from_raw

Declaration  ]


#if Vector_DYN_ZERO

[constructor] Vector (bool must_be_true, oTypeVar * other, Vector_cnt_t count, Vector_cnt_t alloc, oTypeTouched zero_element)

C++: Vector_t::Vector (bool must_be_true, oTypeVar * other, int count, int alloc, oTypeTouched zero_element)

alloc may be -1: see Vector_new_from_raw

#endif
Declaration  ]


[constructor] Vector (bool must_be_true, Vector_t * other)

C++: Vector_t::Vector (bool must_be_true, Vector_t * other)
Declaration  ]


[constructor] Vector (bool must_be_true, Vector_t & other)

C++: Vector_t::Vector (bool must_be_true, Vector_t & other)
Declaration  ]


void _constructor ()

C++: void Vector_t::_constructor ()
Declaration  ]


void _destructor ()

C++: void Vector_t::_destructor ()
Declaration  ]


#if !Global_ERWIN_GLOBAL_ERRNO

int get_errno () const

C++: int Vector_t::get_errno () const
#endif
Declaration & Source  ]


#if !Global_ERWIN_GLOBAL_ERRNO

void clear_errno () const

C++: void Vector_t::clear_errno () const
C: void Vector_clear_errno (Vector_t const * self)

If you compiled Erwin with Global_ERWIN_THREAD_SAFE, this is the way to get the status code of a given vector.

If you do not have a thread-safe Erwin library, there is a macro with the same name as this function.

Error Codes (Global_vector_errno)

#endif
C Declaration  | C++ Declaration & Source  ]


#if Global_ERWIN_GLOBAL_ERRNO

static int get_errno ()

C++: int Vector_t::get_errno ()
#endif
Declaration & Source  ]


#if Global_ERWIN_GLOBAL_ERRNO

static void clear_errno ()

C++: void Vector_t::clear_errno ()
#endif
Declaration & Source  ]


[constructor] Vector (Vector_t const &, bool docopy = true)

C++: Vector_t::Vector (Vector_t const &, bool docopy = true)
Declaration  ]


[constructor] Vector (Vector_t const &, Vector_index_t, Vector_cnt_t, bool do_copy = true)

C++: Vector_t::Vector (Vector_t const &, int, int, bool do_copy = true)
Declaration  ]


Vector_t * copy () const

C++: Vector_t * Vector_t::copy () const
Declaration & Source  ]


Vector_t * copy_err (int * err) const

C++: Vector_t * Vector_t::copy_err (int * err) const
Declaration & Source  ]


Vector_t * copy_detach ()

C++: Vector_t * Vector_t::copy_detach ()
C: Vector_t * Vector_new_from_vector (Vector_t * other)

This might be strange: it makes a new vector from the contents of the other vector and then detaches the data from the other vector. Its purpose is mainly useful in C++ where you can clone vectors from a static vector by this means. E.g.:

 Vector_class a;
 ...
 return Vector_new_from_vector (a);

Or with the same effect, but without the need to use a long functions name: return a.copy_detach();

A related thing is Vector_xchg(), because the above is also roughly equivalent to:

Vector_t a;
...
Vector_t *b= Vector_new();
Vector_xchg(&a, b);
return b;

C Declaration  | C++ Declaration & Source  ]


Vector_t & xchg (Vector_t * other)

C++: Vector_t & Vector_t::xchg (Vector_t * other)
C: void Vector_xchg (Vector_t * self, Vector_t * other)

Exchanges the two vectors' contents. No memory allocation is performed; this is a fast O(1) operation for swapping two values.

C Declaration  | C++ Declaration & Source  ]


Vector_t & xchg (Vector_t & other)

C++: Vector_t & Vector_t::xchg (Vector_t & other)
C: void Vector_xchg (Vector_t * self, Vector_t * other)

Exchanges the two vectors' contents. No memory allocation is performed; this is a fast O(1) operation for swapping two values.

C Declaration  | C++ Declaration & Source  ]


Vector_t * subvector (Vector_index_t b, Vector_cnt_t c) const

C++: Vector_t * Vector_t::subvector (int b, int c) const
Declaration & Source  ]


Vector_t * subvector (Vector_index_t b, Vector_cnt_t c, bool d) const

C++: Vector_t * Vector_t::subvector (int b, int c, bool d) const
Declaration & Source  ]


Vector_t & operator= (Vector_t const &)

C++: Vector_t & Vector_t::operator= (Vector_t const &)
Declaration  ]


Vector_t & operator= (Vector_t const *)

C++: Vector_t & Vector_t::operator= (Vector_t const *)
Declaration  ]


[destructor] ~Vector ()

C++: Vector_t::~Vector ()
Declaration  ]


Vector_t & detach ()

C++: Vector_t & Vector_t::detach ()
C: void Vector_detach (Vector_t * self)

Clears the vector by initialising a new completely empty table not consuming any memory. The effect is mainly that you can use the value of Vector_as_array and Vector_as_open_array independently from the vector. The old function delete_flat is now a sequence of detach() and delete().

Note

This function should be used when the vector is not needed anymore after a cast to a raw array (e.g. by Vector_as_array).

Compare this function with Vector_detach_as_is(). These functions are important to distinguish if you defined Global_oType_UPDATE_POS.

Note

use Vector_delete_array() to deallocate the memory if you retrieve it with, say, Vector_as_open_array().

Note

See the documentation of Vector_delete_array and Vector INLINE_STORE!

C Declaration  | C++ Declaration & Source  ]


Vector_t & detach_as_is ()

C++: Vector_t & Vector_t::detach_as_is ()
C: void Vector_detach_as_is (Vector_t * self)

Like Vector_detach_as_is(), but does not invoke Global_oType_UPDATE_POS for all elements to set them to -1.

This function is only different from Vector_detach if you defined Global_oType_UPDATE_POS. Otherwise, it is the same.

C Declaration  | C++ Declaration & Source  ]


operator Vector_t const * () const

C++: Vector_t::operator Vector_t const * () const
Declaration & Source  ]


operator Vector_t * ()

C++: Vector_t::operator Vector_t * ()
Declaration & Source  ]


#if Vector_MANY_CASTS != 0

operator Vector_element_ptr_t () const

C++: operator Vector_t::Vector_element_ptr_t () const
#endif
Declaration & Source  ]


#if Vector_MANY_CASTS != 0

operator bool () const

C++: operator Vector_t::bool () const
#endif
Declaration & Source  ]


#if Vector_POSITION_POINTER

Vector_index_t * pos_ptr ()

C++: int * Vector_t::pos_ptr ()
#endif
Declaration & Source  ]


#if Vector_POSITION_POINTER

Vector_index_t & pos_ref ()

C++: int & Vector_t::pos_ref ()
#endif
Declaration & Source  ]


#if Vector_POSITION_POINTER

Vector_index_t pos ()

C++: int Vector_t::pos ()
#endif
Declaration & Source  ]


#if Vector_POSITION_POINTER

void set_pos (Vector_index_t y)

C++: void Vector_t::set_pos (int y)
#endif
Declaration & Source  ]


oTypeResult nth (Vector_index_t i) const

C++: oTypeResult Vector_t::nth (int i) const
C: oTypeResult Vector_nth (Vector_t const * self, int index)

Returns the found element or the zero element on failure. If index is out of range, a message is also output to stderr if you defined Global_ERWIN_VERBOSE.

C Declaration  | C++ Declaration & Source  ]


oTypeResult nth_char (Vector_index_t i) const

C++: oTypeResult Vector_t::nth_char (int i) const
C: oTypeResult Vector_nth_char (Vector_t const * self, int index)

Returns the found element or the zero element on failure.

If you access the element just after the end of the vector, then that is regarded legal in this function and the zero element is returned.

If index is out of range, a message is also output to stderr if you defined Global_ERWIN_VERBOSE.

Dev.Note: this is pure: cmp to Vector_nth_char_ptr and see Vector_as_array().

C Declaration  | C++ Declaration & Source  ]


Vector_element_ptr_t nth_ptr_check (Vector_index_t i)

C++: Vector_element_ptr_t Vector_t::nth_ptr_check (int i)
C: Vector_element_ptr_t Vector_nth_ptr_check (Vector_t * self, int index)

Returns a pointer to the element at index or an signals an error if the index is out of range. (This is the same behaviour towards errors as Vector_nth has)

Does not output anything to stderr even if you define Global_ERWIN_VERBOSE.

Dev.Note: not pure with ALLOW_OUTOFRANGE option.

C Declaration  | C++ Declaration & Source  ]


oType const * nth_ptr_check (Vector_index_t i) const

C++: oType const * Vector_t::nth_ptr_check (int i) const
C: oType const * Vector_nth_ptr_check_const (Vector_t const * self, int idx)
C Declaration & Source  | C++ Declaration & Source  ]


Vector_element_ptr_t nth_ptr_char (Vector_index_t i)

C++: Vector_element_ptr_t Vector_t::nth_ptr_char (int i)
C: Vector_element_ptr_t Vector_nth_ptr_char (Vector_t * self, int index)

Returns a pointer to the element at index if it is in range. If is is one too large, returns a pointer to the element after the end, mimicking string behaviour. That element is guaranteed to be allocated, of couse. If you write to that element, it only is guarateed to have any effect up to the next change to the vector size. Don't change that element, though.

Because this function is so similar to adding an integer to a 'char const *', i.e., to get a suffix string, this function always zero-terminates the vector like Vector_as_array() does. So Vector_nth_ptr_char(self,0) is equivalent to Vector_as_array().

Note

This behaves a bit strange together with ALLOW_OUTOFRANGE: Accesses to any element starting from a[nentries()] make the vector larger for the non-const version! This includes the nentries()th element, which, even if only read with this function, enlarges the vector due to the potential threat of the user writing to it.

In case ALLOW_OUTOFRANGE is off, this never makes the vector larger, but does allow access to nentries()th element. That element is always ensured to be ZERO, however, so you cannot write to it.

This signals an error if the index is out of range. (This is the some behaviour towards errors as Vector_nth_char has.)

Does not output anything to stderr even if you define Global_ERWIN_VERBOSE.

Dev.Note: not pure, see Vector_as_array().

C Declaration  | C++ Declaration & Source  ]


oType const * nth_ptr_char (Vector_index_t i) const

C++: oType const * Vector_t::nth_ptr_char (int i) const
C: oType const * Vector_nth_ptr_char_const (Vector_t const * self, int idx)
C Declaration & Source  | C++ Declaration & Source  ]


Vector_element_ptr_t nth_ptr (Vector_index_t i)

C++: Vector_element_ptr_t Vector_t::nth_ptr (int i)
C: Vector_element_ptr_t Vector_nth_ptr (Vector_t * self, int index)

Returns a pointer to the element at index or NULL if index is out of range.

Does not output anything to stderr even if you define Global_ERWIN_VERBOSE.

Dev.Note: not pure with ALLOW_OUTOFRANGE option.

C Declaration  | C++ Declaration & Source  ]


oType const * nth_ptr (Vector_index_t i) const

C++: oType const * Vector_t::nth_ptr (int i) const
C: oType const * Vector_nth_ptr_const (Vector_t const * self, int idx)
C Declaration & Source  | C++ Declaration & Source  ]


Vector_element_ref_t nth_ref (Vector_index_t i)

C++: Vector_element_ref_t Vector_t::nth_ref (int i)
C: Vector_element_ptr_t Vector_nth_ptr (Vector_t * self, int index)

Returns a pointer to the element at index or NULL if index is out of range.

Does not output anything to stderr even if you define Global_ERWIN_VERBOSE.

Dev.Note: not pure with ALLOW_OUTOFRANGE option.

C Declaration  | C++ Declaration & Source  ]


oType const & nth_ref (Vector_index_t i) const

C++: oType const & Vector_t::nth_ref (int i) const
C: oType const * Vector_nth_ptr_const (Vector_t const * self, int idx)
C Declaration & Source  | C++ Declaration & Source  ]


Vector_element_ref_t nth_ref_check (Vector_index_t i)

C++: Vector_element_ref_t Vector_t::nth_ref_check (int i)
C: Vector_element_ptr_t Vector_nth_ptr_check (Vector_t * self, int index)

Returns a pointer to the element at index or an signals an error if the index is out of range. (This is the same behaviour towards errors as Vector_nth has)

Does not output anything to stderr even if you define Global_ERWIN_VERBOSE.

Dev.Note: not pure with ALLOW_OUTOFRANGE option.

C Declaration  | C++ Declaration & Source  ]


oType const & nth_ref_check (Vector_index_t i) const

C++: oType const & Vector_t::nth_ref_check (int i) const
C: oType const * Vector_nth_ptr_check_const (Vector_t const * self, int idx)
C Declaration & Source  | C++ Declaration & Source  ]


Vector_element_ref_t nth_ref_char (Vector_index_t i)

C++: Vector_element_ref_t Vector_t::nth_ref_char (int i)
C: Vector_element_ptr_t Vector_nth_ptr_char (Vector_t * self, int index)

Returns a pointer to the element at index if it is in range. If is is one too large, returns a pointer to the element after the end, mimicking string behaviour. That element is guaranteed to be allocated, of couse. If you write to that element, it only is guarateed to have any effect up to the next change to the vector size. Don't change that element, though.

Because this function is so similar to adding an integer to a 'char const *', i.e., to get a suffix string, this function always zero-terminates the vector like Vector_as_array() does. So Vector_nth_ptr_char(self,0) is equivalent to Vector_as_array().

Note

This behaves a bit strange together with ALLOW_OUTOFRANGE: Accesses to any element starting from a[nentries()] make the vector larger for the non-const version! This includes the nentries()th element, which, even if only read with this function, enlarges the vector due to the potential threat of the user writing to it.

In case ALLOW_OUTOFRANGE is off, this never makes the vector larger, but does allow access to nentries()th element. That element is always ensured to be ZERO, however, so you cannot write to it.

This signals an error if the index is out of range. (This is the some behaviour towards errors as Vector_nth_char has.)

Does not output anything to stderr even if you define Global_ERWIN_VERBOSE.

Dev.Note: not pure, see Vector_as_array().

C Declaration  | C++ Declaration & Source  ]


oType const & nth_ref_char (Vector_index_t i) const

C++: oType const & Vector_t::nth_ref_char (int i) const
C: oType const * Vector_nth_ptr_char_const (Vector_t const * self, int idx)
C Declaration & Source  | C++ Declaration & Source  ]


oTypeResult operator[] (Vector_index_t i) const

C++: oTypeResult Vector_t::operator[] (int i) const
Declaration & Source  ]


Vector_element_ref_t operator[] (Vector_index_t i)

C++: Vector_element_ref_t Vector_t::operator[] (int i)
Declaration & Source  ]


Vector_element_ref_t operator[] (Vector_index_t i)

C++: Vector_element_ref_t Vector_t::operator[] (int i)
Declaration & Source  ]


oTypeResult operator[] (Vector_index_t i) const

C++: oTypeResult Vector_t::operator[] (int i) const
Declaration & Source  ]


oTypeResult first () const

C++: oTypeResult Vector_t::first () const
Declaration & Source  ]


Vector_element_ptr_t first_ptr ()

C++: Vector_element_ptr_t Vector_t::first_ptr ()
C: Vector_element_ptr_t Vector_first_ptr (Vector_t * self)

Returns a pointer to the element at index 0 or NULL if the vector is empty.

Does not output anything to stderr even if you define Global_ERWIN_VERBOSE.

Dev.Note: not pure with ALLOW_OUTOFRANGE option.

C Declaration  | C++ Declaration & Source  ]


Vector_element_ref_t first_ref ()

C++: Vector_element_ref_t Vector_t::first_ref ()
C: Vector_element_ptr_t Vector_first_ptr (Vector_t * self)

Returns a pointer to the element at index 0 or NULL if the vector is empty.

Does not output anything to stderr even if you define Global_ERWIN_VERBOSE.

Dev.Note: not pure with ALLOW_OUTOFRANGE option.

C Declaration  | C++ Declaration & Source  ]


oTypeResult last () const

C++: oTypeResult Vector_t::last () const
Declaration & Source  ]


Vector_element_ptr_t last_ptr ()

C++: Vector_element_ptr_t Vector_t::last_ptr ()
C: Vector_element_ptr_t Vector_last_ptr (Vector_t * self)

Returns a pointer to the last element or NULL if the vector is empty.

Does not output anything to stderr even if you define Global_ERWIN_VERBOSE.

Dev.Note: not pure with ALLOW_OUTOFRANGE option.

C Declaration  | C++ Declaration & Source  ]


Vector_element_ref_t last_ref ()

C++: Vector_element_ref_t Vector_t::last_ref ()
C: Vector_element_ptr_t Vector_last_ptr (Vector_t * self)

Returns a pointer to the last element or NULL if the vector is empty.

Does not output anything to stderr even if you define Global_ERWIN_VERBOSE.

Dev.Note: not pure with ALLOW_OUTOFRANGE option.

C Declaration  | C++ Declaration & Source  ]


oTypeVar modify (Vector_index_t i, oTypeTouched v)

C++: oTypeVar Vector_t::modify (int i, oTypeTouched v)
C: oTypeVar Vector_modify (Vector_t * self, int index, oTypeTouched newvalue)

Returns the old value and inserts the new one at index.

Nothing is freed, newvalue is copied if oType_OCOPY is #defined.

C Declaration  | C++ Declaration & Source  ]


Vector_t & reverse ()

C++: Vector_t & Vector_t::reverse ()
C: void Vector_reverse (Vector_t * self)

Reverses the order of all elements in the vector.

See Vector_swap, too, which is vaguely related.

C Declaration  | C++ Declaration & Source  ]


oTypeVar last_chop1 ()

C++: oTypeVar Vector_t::last_chop1 ()
C: oTypeVar Vector_last_chop1 (Vector_t * self)

Cuts off the last element of the vector and returns it. Like a pop on a stack.

C Declaration  | C++ Declaration & Source  ]


oTypeVar first_swap_chop1 ()

C++: oTypeVar Vector_t::first_swap_chop1 ()
C: oTypeVar Vector_first_swap_chop1 (Vector_t * self)

Cuts off the first element of the vector like Vector_swap_erase() and returns it. This is like Vector_heap_extract() without heap_sink().

C Declaration  | C++ Declaration & Source  ]


Vector_t & set (Vector_index_t i, oTypeTouched v)

C++: Vector_t & Vector_t::set (int i, oTypeTouched v)
C: int Vector_set (Vector_t * self, int index, oTypeTouched newvalue)

Like Vector_modify, but the old value is freed using oType_OFREE instead of being returned.

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_t & swap_erase (Vector_index_t i, Vector_cnt_t n = -1)

C++: Vector_t & Vector_t::swap_erase (int i, int n = -1)
C: int Vector_swap_erase (Vector_t * self, int index, int number_of_elements)

This is similar to Vector_erase, but instead of shifting all elements after the ones erased, this functions copies elements from the end of the vector into the gap. This is faster if number_of_elements is small. The order of the copied elements is reversed.

Example

Vector= [0 1 2 3 4 5 6 7 8 9]

Vector.swap_erase(2,3)  // erases elements 2,3,4 by overwriting with 9,8,7

Vector= [0 1 9 8 7 5 6]

There are more interesting cases, too:

Vector= [0 1 2 3 4 5 6 7 8 9]

Vector.swap_erase(4,4)  // erases elements 4,5,6,7 by overwriting with 9,8

Vector= [0 1 2 3 9 8]

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_t & swap_erase (Vector_index_t i, Vector_cnt_t n, bool a, bool b = true)

C++: Vector_t & Vector_t::swap_erase (int i, int n, bool a, bool b = true)
C: int Vector_swap_erase_flags (Vector_t * self, int index, int number_of_elements_to_delete, Global_ERWIN_BOOL resize)

Like Vector_swap_erase but you can specify whether the vector should be re-allocated by resize.

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_t & erase (Vector_index_t i, Vector_cnt_t n = -1)

C++: Vector_t & Vector_t::erase (int i, int n = -1)
C: int Vector_erase (Vector_t * self, int index, int number_of_elements)

The values erased from the the vector are freed. If number_of_elements is negative, the end of the vector is cut off. If index or number_of_elements are out of range, they are adjusted appropriately.

E.g.:

if index == -2 and count == 5

then elements 0,1,2 are erased,

if index >= nentries

nothing is erased,

if index + count >= nentries

only the tail of the vector is erased. However, all this is only done if Vector_ALLOW_OUTOFRANGE is true. Otherwise, you'll get an assertion failure in all these cases, because index or count are out of range.

if count < 0

then count is adjusted to nelements - index, e.g. index == 2, count = -1 will cut off the last two elements of the vector. (The absolute value of count is not considered here, only the fact that it is < 0). This adjustment always happens, i.e., even if Vector_ALLOW_OUTOFRANGE is false.

Returns its success.

Reference

Vector_erase_flags, Vector_swap_erase

C Declaration  | C++ Declaration & Source  ]


Vector_cnt_t erase_zero ()

C++: int Vector_t::erase_zero ()
C: int Vector_erase_zero (Vector_t * self)

Specialised version of Vector_erase_if: deletes zero elements.

C Declaration  | C++ Declaration & Source  ]


Vector_t & erase (Vector_index_t i, Vector_cnt_t n, bool a, bool b = true)

C++: Vector_t & Vector_t::erase (int i, int n, bool a, bool b = true)
C: int Vector_erase_flags (Vector_t * self, int index, int number_of_elements_to_delete, Global_ERWIN_BOOL resize)

Like Vector_erase but you can specify whether the vector should be re-allocated by resize.

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_cnt_t erase_if (Vector_feature_t f, bool inv = true, bool a = true, bool b = true)

C++: int Vector_t::erase_if (Vector_feature_t f, bool inv = true, bool a = true, bool b = true)
C: int Vector_erase_if_flags (Vector_t * self, Vector_feature_t feature, Global_ERWIN_BOOL value, Global_ERWIN_BOOL resize)

Additional to Vector_erase_if, you can specify whether to resize the vector.

Returns the number of elements cut out of the vector.

C Declaration  | C++ Declaration & Source  ]


Vector_cnt_t erase_if_not (Vector_feature_t f, bool inv = true, bool a = true, bool b = true)

C++: int Vector_t::erase_if_not (Vector_feature_t f, bool inv = true, bool a = true, bool b = true)
C: int Vector_erase_if_flags (Vector_t * self, Vector_feature_t feature, Global_ERWIN_BOOL value, Global_ERWIN_BOOL resize)

Additional to Vector_erase_if, you can specify whether to resize the vector.

Returns the number of elements cut out of the vector.

C Declaration  | C++ Declaration & Source  ]


Vector_cnt_t erase_equals (Vector_cmp_t fcmp = Vector_CMP_T_NULL, Vector_combine_t combine = Vector_COMBINE_T_NULL)

C++: int Vector_t::erase_equals (Vector_cmp_t fcmp = Vector_CMP_T_NULL, Vector_combine_t combine = Vector_COMBINE_T_NULL)
C: int Vector_erase_equals (Vector_t * self, Vector_cmp_t cmp, Vector_combine_t combine)

Erases the second of two adjacent elements that is equal (wrt. the given function) to the first. This is repeated recursively so that groups of adjacent equal elements are reduced to one element.

Before erasing, the function calls back combine to let the user adjust things (e.g. copy something from the moribund entry to the surviving one).

The default cmp function, used if cmp is NULL, is Global_oType_CMP.

In a sorted vector, this procedure erases all equal elements.

The values erased from the vector are freed using oType_OFREE.

The number of erased elements is returned.

C Declaration  | C++ Declaration & Source  ]


Vector_t & erase (Vector_index_t i, Vector_cnt_t n, bool a)

C++: Vector_t & Vector_t::erase (int i, int n, bool a)
C: int Vector_erase_flags (Vector_t * self, int index, int number_of_elements_to_delete, Global_ERWIN_BOOL resize)

Like Vector_erase but you can specify whether the vector should be re-allocated by resize.

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_cnt_t erase_if (Vector_feature_t f, bool inv = true, bool a = true)

C++: int Vector_t::erase_if (Vector_feature_t f, bool inv = true, bool a = true)
C: int Vector_erase_if_flags (Vector_t * self, Vector_feature_t feature, Global_ERWIN_BOOL value, Global_ERWIN_BOOL resize)

Additional to Vector_erase_if, you can specify whether to resize the vector.

Returns the number of elements cut out of the vector.

C Declaration  | C++ Declaration & Source  ]


Vector_cnt_t erase_if_not (Vector_feature_t f, bool inv = true, bool a = true)

C++: int Vector_t::erase_if_not (Vector_feature_t f, bool inv = true, bool a = true)
C: int Vector_erase_if_flags (Vector_t * self, Vector_feature_t feature, Global_ERWIN_BOOL value, Global_ERWIN_BOOL resize)

Additional to Vector_erase_if, you can specify whether to resize the vector.

Returns the number of elements cut out of the vector.

C Declaration  | C++ Declaration & Source  ]


Vector_t & swap_chop (Vector_cnt_t n = 1)

C++: Vector_t & Vector_t::swap_chop (int n = 1)
C: int Vector_swap_erase (Vector_t * self, int index, int number_of_elements)

This is similar to Vector_erase, but instead of shifting all elements after the ones erased, this functions copies elements from the end of the vector into the gap. This is faster if number_of_elements is small. The order of the copied elements is reversed.

Example

Vector= [0 1 2 3 4 5 6 7 8 9]

Vector.swap_erase(2,3)  // erases elements 2,3,4 by overwriting with 9,8,7

Vector= [0 1 9 8 7 5 6]

There are more interesting cases, too:

Vector= [0 1 2 3 4 5 6 7 8 9]

Vector.swap_erase(4,4)  // erases elements 4,5,6,7 by overwriting with 9,8

Vector= [0 1 2 3 9 8]

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_t & swap_chop (bool a, bool b = true)

C++: Vector_t & Vector_t::swap_chop (bool a, bool b = true)
C: int Vector_swap_erase_flags (Vector_t * self, int index, int number_of_elements_to_delete, Global_ERWIN_BOOL resize)

Like Vector_swap_erase but you can specify whether the vector should be re-allocated by resize.

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_t & swap_chop (Vector_cnt_t n, bool a, bool b = true)

C++: Vector_t & Vector_t::swap_chop (int n, bool a, bool b = true)
C: int Vector_swap_erase_flags (Vector_t * self, int index, int number_of_elements_to_delete, Global_ERWIN_BOOL resize)

Like Vector_swap_erase but you can specify whether the vector should be re-allocated by resize.

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_t & swap_chop (Vector_cnt_t n, bool a)

C++: Vector_t & Vector_t::swap_chop (int n, bool a)
C: int Vector_swap_erase_flags (Vector_t * self, int index, int number_of_elements_to_delete, Global_ERWIN_BOOL resize)

Like Vector_swap_erase but you can specify whether the vector should be re-allocated by resize.

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_t & chop (Vector_cnt_t n = 1)

C++: Vector_t & Vector_t::chop (int n = 1)
C: int Vector_chop (Vector_t * self, int count)

Cuts off the last count elements of a vector.

This is actually nothing more than an abbreviation for:

(Assert that count is >= 0)
Vector_erase(self, Vector_nentries(self)-count, count);

This functions generates an assertion failure if the number of elements to chop is greater than the number of elements in the vector. However, if Vector_ALLOW_OUTOFRANGE is true, then this operation simply clears the vector without assertion failure in this case.

Due to the fact that the equivalent using Vector_swap_erase is very trivial: Vector_swap_erase (self, 0, 1), there is no Vector_swap_chop() in C (but in C++, we still have it).

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_t & chop (bool a, bool b = true)

C++: Vector_t & Vector_t::chop (bool a, bool b = true)
C: int Vector_chop_flags (Vector_t * self, int number_of_elements_to_erase_off, Global_ERWIN_BOOL resize)

Like Vector_chop you can specify the deallocation behaviour.

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_t & chop (Vector_cnt_t n, bool a, bool b = true)

C++: Vector_t & Vector_t::chop (int n, bool a, bool b = true)
C: int Vector_chop_flags (Vector_t * self, int number_of_elements_to_erase_off, Global_ERWIN_BOOL resize)

Like Vector_chop you can specify the deallocation behaviour.

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_t & chop (Vector_cnt_t n, bool a)

C++: Vector_t & Vector_t::chop (int n, bool a)
C: int Vector_chop_flags (Vector_t * self, int number_of_elements_to_erase_off, Global_ERWIN_BOOL resize)

Like Vector_chop you can specify the deallocation behaviour.

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_t & prepend (oTypeTouched a)

C++: Vector_t & Vector_t::prepend (oTypeTouched a)
C: int Vector_insert (Vector_t * self, int index, oTypeTouched element)

Inserts one element at position index.

Possible values for index are 0...Vector_nentries(self) both inclusive.

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_t & prepend_raw (oType const * a, Vector_cnt_t n)

C++: Vector_t & Vector_t::prepend_raw (oType const * a, int n)
C: int Vector_insert_raw (Vector_t * self, int index, oType const * values, int count)

Inserts elements from an open array whose size is given by count. In all other aspects it works just like Vector_insert_vector.

C Declaration  | C++ Declaration & Source  ]


Vector_t & prepend_no_copy (oTypeVar const * a, Vector_cnt_t n)

C++: Vector_t & Vector_t::prepend_no_copy (oTypeVar const * a, int n)
C: int Vector_insert_no_copy (Vector_t * self, int index, oTypeVar const * values, int count)

Like Vector_insert_raw but does not copy the given data.

C Declaration  | C++ Declaration & Source  ]


Vector_t & prepend_vector (Vector_t const * a)

C++: Vector_t & Vector_t::prepend_vector (Vector_t const * a)
C: int Vector_insert_vector (Vector_t * self, int start_index, Vector_t const * initial)

Each element is copied using Global_oType_OCOPY.

This is a simple frontend to Vector_make_gap and Vector_overwrite. To insert only portions of the initial vector, use these functions directly.

Possible values for index are 0...Vector_nentries(self) both inclusive.

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_t & prepend_vector (Vector_t const & a)

C++: Vector_t & Vector_t::prepend_vector (Vector_t const & a)
C: int Vector_insert_vector (Vector_t * self, int start_index, Vector_t const * initial)

Each element is copied using Global_oType_OCOPY.

This is a simple frontend to Vector_make_gap and Vector_overwrite. To insert only portions of the initial vector, use these functions directly.

Possible values for index are 0...Vector_nentries(self) both inclusive.

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_t & prepend_string (oType const * a)

C++: Vector_t & Vector_t::prepend_string (oType const * a)
C: int Vector_insert_string (Vector_t * self, int start_index, oType const * values)

Inserts a zero-terminated string into the vector.

In all other aspects it works just like Vector_insert_vector.

C Declaration  | C++ Declaration & Source  ]


Vector_t & append (oTypeTouched a)

C++: Vector_t & Vector_t::append (oTypeTouched a)
C: int Vector_append (Vector_t * self, oTypeTouched value)

Appends one elements, namely value, to the end of the vector.

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_t & append_raw (oType const * a, Vector_cnt_t n)

C++: Vector_t & Vector_t::append_raw (oType const * a, int n)
C: int Vector_append_raw (Vector_t * self, oType const * elements, int count)

Append count elements to the end of the vector.

This is a frontend to Vector_insert_raw which lets you specify an insertion position.

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_t & append_no_copy (oTypeVar const * a, Vector_cnt_t n)

C++: Vector_t & Vector_t::append_no_copy (oTypeVar const * a, int n)
C: int Vector_append_no_copy (Vector_t * self, oTypeVar const * theelements, int number_of_elements_to_insert)

Like Vector_append_raw, but the data is not copyied.

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_t & append_vector (Vector_t const * a)

C++: Vector_t & Vector_t::append_vector (Vector_t const * a)
C: int Vector_append_vector (Vector_t * self, Vector_t const * other)

Append a whole other vector at the end of the vector self.

This is a frontend to Vector_insert.

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_t & append_vector (Vector_t const & a)

C++: Vector_t & Vector_t::append_vector (Vector_t const & a)
C: int Vector_append_vector (Vector_t * self, Vector_t const * other)

Append a whole other vector at the end of the vector self.

This is a frontend to Vector_insert.

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_t & append_string (oType const * a)

C++: Vector_t & Vector_t::append_string (oType const * a)
C: int Vector_append_string (Vector_t * self, oType const * theelements)

Like Vector_append_raw, but with a zero-terminated string instead of a number of elements. The null-termination will not be copied.

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_t & append_subvector (Vector_t const & a, Vector_index_t b, Vector_cnt_t c = -1, Global_ERWIN_BOOL d = Global_ERWIN_TRUE)

C++: Vector_t & Vector_t::append_subvector (Vector_t const & a, int b, int c = -1, Global_ERWIN_BOOL d = Global_ERWIN_TRUE)
Declaration & Source  ]


Vector_t & append_subvector (Vector_t const * a, Vector_index_t b, Vector_cnt_t c = -1, Global_ERWIN_BOOL d = Global_ERWIN_TRUE)

C++: Vector_t & Vector_t::append_subvector (Vector_t const * a, int b, int c = -1, Global_ERWIN_BOOL d = Global_ERWIN_TRUE)
Declaration & Source  ]


#if Vector_DIRECT_RECURSION == 0

Vector_t & prepend (Vector_t const * a)

C++: Vector_t & Vector_t::prepend (Vector_t const * a)
C: int Vector_insert_vector (Vector_t * self, int start_index, Vector_t const * initial)

Each element is copied using Global_oType_OCOPY.

This is a simple frontend to Vector_make_gap and Vector_overwrite. To insert only portions of the initial vector, use these functions directly.

Possible values for index are 0...Vector_nentries(self) both inclusive.

Returns its success.

#endif
C Declaration  | C++ Declaration & Source  ]


#if Vector_DIRECT_RECURSION == 0

Vector_t & prepend (Vector_t const & a)

C++: Vector_t & Vector_t::prepend (Vector_t const & a)
C: int Vector_insert_vector (Vector_t * self, int start_index, Vector_t const * initial)

Each element is copied using Global_oType_OCOPY.

This is a simple frontend to Vector_make_gap and Vector_overwrite. To insert only portions of the initial vector, use these functions directly.

Possible values for index are 0...Vector_nentries(self) both inclusive.

Returns its success.

#endif
C Declaration  | C++ Declaration & Source  ]


#if Vector_DIRECT_RECURSION == 0

Vector_t & prepend (oType const * a)

C++: Vector_t & Vector_t::prepend (oType const * a)
C: int Vector_insert_string (Vector_t * self, int start_index, oType const * values)

Inserts a zero-terminated string into the vector.

In all other aspects it works just like Vector_insert_vector.

#endif
C Declaration  | C++ Declaration & Source  ]


#if Vector_DIRECT_RECURSION == 0

Vector_t & append (Vector_t const * a)

C++: Vector_t & Vector_t::append (Vector_t const * a)
C: int Vector_append_vector (Vector_t * self, Vector_t const * other)

Append a whole other vector at the end of the vector self.

This is a frontend to Vector_insert.

Returns its success.

#endif
C Declaration  | C++ Declaration & Source  ]


#if Vector_DIRECT_RECURSION == 0

Vector_t & append (Vector_t const & a)

C++: Vector_t & Vector_t::append (Vector_t const & a)
C: int Vector_append_vector (Vector_t * self, Vector_t const * other)

Append a whole other vector at the end of the vector self.

This is a frontend to Vector_insert.

Returns its success.

#endif
C Declaration  | C++ Declaration & Source  ]


#if Vector_DIRECT_RECURSION == 0

Vector_t & append (oType const * a)

C++: Vector_t & Vector_t::append (oType const * a)
C: int Vector_append_string (Vector_t * self, oType const * theelements)

Like Vector_append_raw, but with a zero-terminated string instead of a number of elements. The null-termination will not be copied.

Returns its success.

#endif
C Declaration  | C++ Declaration & Source  ]


#if Vector_DIRECT_RECURSION == 0

Vector_t & operator<< (oType const * a)

C++: Vector_t & Vector_t::operator<< (oType const * a)
C: int Vector_append_string (Vector_t * self, oType const * theelements)

Like Vector_append_raw, but with a zero-terminated string instead of a number of elements. The null-termination will not be copied.

Returns its success.

#endif
C Declaration  | C++ Declaration & Source  ]


Vector_t & operator<< (oTypeTouched a)

C++: Vector_t & Vector_t::operator<< (oTypeTouched a)
C: int Vector_append (Vector_t * self, oTypeTouched value)

Appends one elements, namely value, to the end of the vector.

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_t & operator<< (Vector_t const * a)

C++: Vector_t & Vector_t::operator<< (Vector_t const * a)
C: int Vector_append_vector (Vector_t * self, Vector_t const * other)

Append a whole other vector at the end of the vector self.

This is a frontend to Vector_insert.

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_t & operator<< (Vector_t const & a)

C++: Vector_t & Vector_t::operator<< (Vector_t const & a)
C: int Vector_append_vector (Vector_t * self, Vector_t const * other)

Append a whole other vector at the end of the vector self.

This is a frontend to Vector_insert.

Returns its success.

C Declaration  | C++ Declaration & Source  ]


Vector_index_t find (oTypeParam needle) const

C++: int Vector_t::find (oTypeParam needle) const
C: int Vector_find (Vector_t const * self, int start, oTypeParam needle)

Tries to finds an entry equal to needle. Returns the index of the first element >= start or -1 of nothing was found. The search is performed from the beginning to the end.

If start is negativ, search is started at the last but start-th position. So to search the whole vector, start should be 0.

Note

This function is not called `Vector_search', because it does not only perform the search, but also returns the result of that search.

References

Vector_rfind, Vector_bfind.

C Declaration  | C++ Declaration & Source  ]


Vector_index_t find_raw (oType const * needle, Vector_cnt_t n) const

C++: int Vector_t::find_raw (oType const * needle, int n) const
C: int Vector_find_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_find but tries to find equal parts. See Vector_rfind_raw.

C Declaration  | C++ Declaration & Source  ]


Vector_index_t find_string (oType const * needle) const

C++: int Vector_t::find_string (oType const * needle) const
C: int Vector_find_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_find but tries to find equal parts. See Vector_rfind_raw.

C Declaration  | C++ Declaration & Source  ]


Vector_index_t find_vector (Vector_t const & needle) const

C++: int Vector_t::find_vector (Vector_t const & needle) const
C: int Vector_find_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_find but tries to find equal parts. See Vector_rfind_raw.

C Declaration  | C++ Declaration & Source  ]


Vector_index_t find_vector (Vector_t const * needle) const

C++: int Vector_t::find_vector (Vector_t const * needle) const
C: int Vector_find_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_find but tries to find equal parts. See Vector_rfind_raw.

C Declaration  | C++ Declaration & Source  ]


#if Vector_DIRECT_RECURSION == 0

Vector_index_t find (oType const * needle, Vector_cnt_t n) const

C++: int Vector_t::find (oType const * needle, int n) const
C: int Vector_find_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_find but tries to find equal parts. See Vector_rfind_raw.

#endif
C Declaration  | C++ Declaration & Source  ]


#if Vector_DIRECT_RECURSION == 0

Vector_index_t find (oType const * needle) const

C++: int Vector_t::find (oType const * needle) const
C: int Vector_find_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_find but tries to find equal parts. See Vector_rfind_raw.

#endif
C Declaration  | C++ Declaration & Source  ]


#if Vector_DIRECT_RECURSION == 0

Vector_index_t find (Vector_t const & needle) const

C++: int Vector_t::find (Vector_t const & needle) const
C: int Vector_find_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_find but tries to find equal parts. See Vector_rfind_raw.

#endif
C Declaration  | C++ Declaration & Source  ]


#if Vector_DIRECT_RECURSION == 0

Vector_index_t find (Vector_t const * needle) const

C++: int Vector_t::find (Vector_t const * needle) const
C: int Vector_find_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_find but tries to find equal parts. See Vector_rfind_raw.

#endif
C Declaration  | C++ Declaration & Source  ]


Vector_index_t find (Vector_index_t a, oTypeParam needle) const

C++: int Vector_t::find (int a, oTypeParam needle) const
C: int Vector_find (Vector_t const * self, int start, oTypeParam needle)

Tries to finds an entry equal to needle. Returns the index of the first element >= start or -1 of nothing was found. The search is performed from the beginning to the end.

If start is negativ, search is started at the last but start-th position. So to search the whole vector, start should be 0.

Note

This function is not called `Vector_search', because it does not only perform the search, but also returns the result of that search.

References

Vector_rfind, Vector_bfind.

C Declaration  | C++ Declaration & Source  ]


Vector_index_t find_raw (Vector_index_t a, oType const * needle, Vector_cnt_t n) const

C++: int Vector_t::find_raw (int a, oType const * needle, int n) const
C: int Vector_find_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_find but tries to find equal parts. See Vector_rfind_raw.

C Declaration  | C++ Declaration & Source  ]


Vector_index_t find_string (Vector_index_t a, oType const * needle) const

C++: int Vector_t::find_string (int a, oType const * needle) const
C: int Vector_find_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_find but tries to find equal parts. See Vector_rfind_raw.

C Declaration  | C++ Declaration & Source  ]


Vector_index_t find_vector (Vector_index_t a, Vector_t const & needle) const

C++: int Vector_t::find_vector (int a, Vector_t const & needle) const
C: int Vector_find_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_find but tries to find equal parts. See Vector_rfind_raw.

C Declaration  | C++ Declaration & Source  ]


Vector_index_t find_vector (Vector_index_t a, Vector_t const * needle) const

C++: int Vector_t::find_vector (int a, Vector_t const * needle) const
C: int Vector_find_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_find but tries to find equal parts. See Vector_rfind_raw.

C Declaration  | C++ Declaration & Source  ]


#if Vector_DIRECT_RECURSION == 0

Vector_index_t find (Vector_index_t a, oType const * needle, Vector_cnt_t n) const

C++: int Vector_t::find (int a, oType const * needle, int n) const
C: int Vector_find_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_find but tries to find equal parts. See Vector_rfind_raw.

#endif
C Declaration  | C++ Declaration & Source  ]


#if Vector_DIRECT_RECURSION == 0

Vector_index_t find (Vector_index_t a, oType const * needle) const

C++: int Vector_t::find (int a, oType const * needle) const
C: int Vector_find_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_find but tries to find equal parts. See Vector_rfind_raw.

#endif
C Declaration  | C++ Declaration & Source  ]


#if Vector_DIRECT_RECURSION == 0

Vector_index_t find (Vector_index_t a, Vector_t const & needle) const

C++: int Vector_t::find (int a, Vector_t const & needle) const
C: int Vector_find_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_find but tries to find equal parts. See Vector_rfind_raw.

#endif
C Declaration  | C++ Declaration & Source  ]


#if Vector_DIRECT_RECURSION == 0

Vector_index_t find (Vector_index_t a, Vector_t const * needle) const

C++: int Vector_t::find (int a, Vector_t const * needle) const
C: int Vector_find_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_find but tries to find equal parts. See Vector_rfind_raw.

#endif
C Declaration  | C++ Declaration & Source  ]


Vector_index_t rfind (oTypeParam needle) const

C++: int Vector_t::rfind (oTypeParam needle) const
C: int Vector_rfind (Vector_t const * self, int start, oTypeParam needle)

Tries to finds an entry equal to needle. Returns the index of the first element <= start or -1 of nothing was found. The search is performed from the end to the beginning.

If start is negativ, search is started at the last but start-th position. So to search the whole vector, start should be -1.

References

Vector_find

C Declaration  | C++ Declaration & Source  ]


Vector_index_t rfind_raw (oType const * needle, Vector_cnt_t n) const

C++: int Vector_t::rfind_raw (oType const * needle, int n) const
C: int Vector_rfind_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_rfind but tries to find equal parts.

Return the position of `needle' or -1 if it is not found. Note that it is no problem to search for the zero element Global_oType_ZERO. These all use the Vector_EQUAL macro.

Negative values for start will count from the end of the vector.

C Declaration  | C++ Declaration & Source  ]


Vector_index_t rfind_string (oType const * needle) const

C++: int Vector_t::rfind_string (oType const * needle) const
C: int Vector_rfind_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_rfind but tries to find equal parts.

Return the position of `needle' or -1 if it is not found. Note that it is no problem to search for the zero element Global_oType_ZERO. These all use the Vector_EQUAL macro.

Negative values for start will count from the end of the vector.

C Declaration  | C++ Declaration & Source  ]


Vector_index_t rfind_vector (Vector_t const & needle) const

C++: int Vector_t::rfind_vector (Vector_t const & needle) const
C: int Vector_rfind_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_rfind but tries to find equal parts.

Return the position of `needle' or -1 if it is not found. Note that it is no problem to search for the zero element Global_oType_ZERO. These all use the Vector_EQUAL macro.

Negative values for start will count from the end of the vector.

C Declaration  | C++ Declaration & Source  ]


Vector_index_t rfind_vector (Vector_t const * needle) const

C++: int Vector_t::rfind_vector (Vector_t const * needle) const
C: int Vector_rfind_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_rfind but tries to find equal parts.

Return the position of `needle' or -1 if it is not found. Note that it is no problem to search for the zero element Global_oType_ZERO. These all use the Vector_EQUAL macro.

Negative values for start will count from the end of the vector.

C Declaration  | C++ Declaration & Source  ]


#if Vector_DIRECT_RECURSION == 0

Vector_index_t rfind (oType const * needle, Vector_cnt_t n) const

C++: int Vector_t::rfind (oType const * needle, int n) const
C: int Vector_rfind_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_rfind but tries to find equal parts.

Return the position of `needle' or -1 if it is not found. Note that it is no problem to search for the zero element Global_oType_ZERO. These all use the Vector_EQUAL macro.

Negative values for start will count from the end of the vector.

#endif
C Declaration  | C++ Declaration & Source  ]


#if Vector_DIRECT_RECURSION == 0

Vector_index_t rfind (oType const * needle) const

C++: int Vector_t::rfind (oType const * needle) const
C: int Vector_rfind_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_rfind but tries to find equal parts.

Return the position of `needle' or -1 if it is not found. Note that it is no problem to search for the zero element Global_oType_ZERO. These all use the Vector_EQUAL macro.

Negative values for start will count from the end of the vector.

#endif
C Declaration  | C++ Declaration & Source  ]


#if Vector_DIRECT_RECURSION == 0

Vector_index_t rfind (Vector_t const & needle) const

C++: int Vector_t::rfind (Vector_t const & needle) const
C: int Vector_rfind_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_rfind but tries to find equal parts.

Return the position of `needle' or -1 if it is not found. Note that it is no problem to search for the zero element Global_oType_ZERO. These all use the Vector_EQUAL macro.

Negative values for start will count from the end of the vector.

#endif
C Declaration  | C++ Declaration & Source  ]


#if Vector_DIRECT_RECURSION == 0

Vector_index_t rfind (Vector_t const * needle) const

C++: int Vector_t::rfind (Vector_t const * needle) const
C: int Vector_rfind_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_rfind but tries to find equal parts.

Return the position of `needle' or -1 if it is not found. Note that it is no problem to search for the zero element Global_oType_ZERO. These all use the Vector_EQUAL macro.

Negative values for start will count from the end of the vector.

#endif
C Declaration  | C++ Declaration & Source  ]


Vector_index_t rfind (Vector_index_t a, oTypeParam needle) const

C++: int Vector_t::rfind (int a, oTypeParam needle) const
C: int Vector_rfind (Vector_t const * self, int start, oTypeParam needle)

Tries to finds an entry equal to needle. Returns the index of the first element <= start or -1 of nothing was found. The search is performed from the end to the beginning.

If start is negativ, search is started at the last but start-th position. So to search the whole vector, start should be -1.

References

Vector_find

C Declaration  | C++ Declaration & Source  ]


Vector_index_t rfind_raw (Vector_index_t a, oType const * needle, Vector_cnt_t n) const

C++: int Vector_t::rfind_raw (int a, oType const * needle, int n) const
C: int Vector_rfind_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_rfind but tries to find equal parts.

Return the position of `needle' or -1 if it is not found. Note that it is no problem to search for the zero element Global_oType_ZERO. These all use the Vector_EQUAL macro.

Negative values for start will count from the end of the vector.

C Declaration  | C++ Declaration & Source  ]


Vector_index_t rfind_string (Vector_index_t a, oType const * needle) const

C++: int Vector_t::rfind_string (int a, oType const * needle) const
C: int Vector_rfind_raw (Vector_t const * self, int start, oType const * needle, int len)

Like Vector_rfind but tries to find equal parts.

Return the position of `needle' or -1 if it is not found. Note that it is no problem to search for the zero element Global_oType_ZERO. These all use the Vector_EQUAL macro.

Negative values for start will count from the end of the vector.

C Declaration  | C++ Declaration & Source  ]