Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
PbArrayOfInt Class Reference

DTEXT Dynamic array of int . More...

#include <MeshViz/misc/PbArrayOfInt.h>

Public Member Functions

 PbArrayOfInt ()
 
 PbArrayOfInt (int init_size, int extend=10)
 When the array resizes itself, the extension is a multiple of extend.
 
 PbArrayOfInt (const PbArrayOfInt &other_array)
 
 ~PbArrayOfInt ()
 
const int * get () const
 Gets the adress of the internal array.
 
int get (int index) const
 Gets the int value at a particular index.
 
int find (int val) const
 Finds the first index in the array of a given int value (-1 if not found).
 
void set (int index, int val)
 Inserts int value at a specified position in the array.
 
int add (int val)
 Inserts int value at the end of the array.
 
int add (int num_val, const int *val)
 Inserts a list of int values at the end of the array.
 
PbArrayOfIntoperator= (const PbArrayOfInt &other_array)
 Copy from other_array.
 
void operator+= (const PbArrayOfInt &other_array)
 Appends other_array to the end of the array.
 
void operator+= (int val)
 Adds val at the end of the array.
 
int & operator[] (int index)
 
const int & operator[] (int index) const
 
void setCapacity (int capacity, int extend)
 set the capacity and allocate this capacity if necessary
 
void squeeze ()
 
int getCapacity () const
 Gets the allocated size of the array.
 
int getNum () const
 Gets the number of values in the array.
 
void increasingSort ()
 Sorts array by increasing order.
 
void decreasingSort ()
 Sorts array by decreasing order.
 
void empty ()
 After empty, the array appears like no int value has been previously inserted.
 

Friends

MESHVIZ_API friend int operator== (const PbArrayOfInt &array_1, const PbArrayOfInt &array_2)
 Equality comparison operator.
 
MESHVIZ_API friend int operator!= (const PbArrayOfInt &array_1, const PbArrayOfInt &array_2)
 Inequality comparison operator.
 

Detailed Description

DTEXT Dynamic array of int .

ingroup MeshMisc
DESCRIPTION
It provides methods and operators for insertion and retrieval of int
values. It automatically resizes itself when necessary.

Definition at line 31 of file PbArrayOfInt.h.

Constructor & Destructor Documentation

◆ PbArrayOfInt() [1/3]

PbArrayOfInt::PbArrayOfInt ( )
inline

Definition at line 31 of file PbArrayOfInt.h.

◆ PbArrayOfInt() [2/3]

PbArrayOfInt::PbArrayOfInt ( int  init_size,
int  extend = 10 
)

When the array resizes itself, the extension is a multiple of extend.

◆ PbArrayOfInt() [3/3]

PbArrayOfInt::PbArrayOfInt ( const PbArrayOfInt other_array)

◆ ~PbArrayOfInt()

PbArrayOfInt::~PbArrayOfInt ( )

Member Function Documentation

◆ add() [1/2]

int PbArrayOfInt::add ( int  num_val,
const int *  val 
)

Inserts a list of int values at the end of the array.

Returns the location of the last one inserted.

◆ add() [2/2]

int PbArrayOfInt::add ( int  val)
inline

Inserts int value at the end of the array.

Returns its location in the array.

Definition at line 31 of file PbArrayOfInt.h.

◆ decreasingSort()

void PbArrayOfInt::decreasingSort ( )

Sorts array by decreasing order.

◆ empty()

void PbArrayOfInt::empty ( )
inline

After empty, the array appears like no int value has been previously inserted.

Definition at line 31 of file PbArrayOfInt.h.

◆ find()

int PbArrayOfInt::find ( int  val) const
inline

Finds the first index in the array of a given int value (-1 if not found).

Definition at line 31 of file PbArrayOfInt.h.

◆ get() [1/2]

const int * PbArrayOfInt::get ( ) const
inline

Gets the adress of the internal array.

Definition at line 31 of file PbArrayOfInt.h.

◆ get() [2/2]

int PbArrayOfInt::get ( int  index) const
inline

Gets the int value at a particular index.

Definition at line 31 of file PbArrayOfInt.h.

◆ getCapacity()

int PbArrayOfInt::getCapacity ( ) const
inline

Gets the allocated size of the array.

Definition at line 31 of file PbArrayOfInt.h.

◆ getNum()

int PbArrayOfInt::getNum ( ) const
inline

Gets the number of values in the array.

Definition at line 31 of file PbArrayOfInt.h.

◆ increasingSort()

void PbArrayOfInt::increasingSort ( )

Sorts array by increasing order.

◆ operator+=() [1/2]

void PbArrayOfInt::operator+= ( const PbArrayOfInt other_array)

Appends other_array to the end of the array.

◆ operator+=() [2/2]

void PbArrayOfInt::operator+= ( int  val)
inline

Adds val at the end of the array.

Definition at line 31 of file PbArrayOfInt.h.

◆ operator=()

PbArrayOfInt & PbArrayOfInt::operator= ( const PbArrayOfInt other_array)

Copy from other_array.

◆ operator[]() [1/2]

int & PbArrayOfInt::operator[] ( int  index)
inline

Definition at line 31 of file PbArrayOfInt.h.

◆ operator[]() [2/2]

const int & PbArrayOfInt::operator[] ( int  index) const
inline

Definition at line 31 of file PbArrayOfInt.h.

◆ set()

void PbArrayOfInt::set ( int  index,
int  val 
)
inline

Inserts int value at a specified position in the array.

Definition at line 31 of file PbArrayOfInt.h.

◆ setCapacity()

void PbArrayOfInt::setCapacity ( int  capacity,
int  extend 
)

set the capacity and allocate this capacity if necessary

◆ squeeze()

void PbArrayOfInt::squeeze ( )

Friends And Related Symbol Documentation

◆ operator!=

MESHVIZ_API friend int operator!= ( const PbArrayOfInt array_1,
const PbArrayOfInt array_2 
)
friend

Inequality comparison operator.

Definition at line 31 of file PbArrayOfInt.h.

◆ operator==

MESHVIZ_API friend int operator== ( const PbArrayOfInt array_1,
const PbArrayOfInt array_2 
)
friend

Equality comparison operator.


The documentation for this class was generated from the following file: