Open Inventor Release 2024.1.1
 
Loading...
Searching...
No Matches
PbArrayOfLong Class Reference

DTEXT Dynamic array of int32_t . More...

#include <MeshViz/misc/PbArrayOfLong.h>

Public Member Functions

 PbArrayOfLong ()
 
 PbArrayOfLong (int init_size, int extend=10)
 When the array resizes itself, the extension is a multiple of extend.
 
 PbArrayOfLong (const PbArrayOfLong &other_array)
 
 ~PbArrayOfLong ()
 
const int32_t * get () const
 Gets the adress of the internal array.
 
int32_t get (int index) const
 Gets the int32_t value at a particular index.
 
int find (int32_t val) const
 Finds the first index in the array of a given int32_t value (-1 if not found).
 
void set (int index, int32_t val)
 Inserts int32_t value at a specified position in the array.
 
int add (int32_t val)
 Inserts int32_t value at the end of the array.
 
int add (int num_val, const int32_t *val)
 Inserts a list of int32_t values at the end of the array.
 
PbArrayOfLongoperator= (const PbArrayOfLong &other_array)
 Copy from other_array.
 
void operator+= (const PbArrayOfLong &other_array)
 Appends other_array to the end of the array.
 
void operator+= (int32_t val)
 Adds val at the end of the array.
 
int32_t & operator[] (int index)
 
const int32_t & 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 int32_t value has been previously inserted.
 

Friends

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

Detailed Description

DTEXT Dynamic array of int32_t .

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

Definition at line 32 of file PbArrayOfLong.h.

Constructor & Destructor Documentation

◆ PbArrayOfLong() [1/3]

PbArrayOfLong::PbArrayOfLong ( )
inline

Definition at line 32 of file PbArrayOfLong.h.

◆ PbArrayOfLong() [2/3]

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

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

◆ PbArrayOfLong() [3/3]

PbArrayOfLong::PbArrayOfLong ( const PbArrayOfLong other_array)

◆ ~PbArrayOfLong()

PbArrayOfLong::~PbArrayOfLong ( )

Member Function Documentation

◆ add() [1/2]

int PbArrayOfLong::add ( int  num_val,
const int32_t *  val 
)

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

Returns the location of the last one inserted.

◆ add() [2/2]

int PbArrayOfLong::add ( int32_t  val)
inline

Inserts int32_t value at the end of the array.

Returns its location in the array.

Definition at line 32 of file PbArrayOfLong.h.

◆ decreasingSort()

void PbArrayOfLong::decreasingSort ( )

Sorts array by decreasing order.

◆ empty()

void PbArrayOfLong::empty ( )
inline

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

Definition at line 32 of file PbArrayOfLong.h.

◆ find()

int PbArrayOfLong::find ( int32_t  val) const
inline

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

Definition at line 32 of file PbArrayOfLong.h.

◆ get() [1/2]

const int32_t * PbArrayOfLong::get ( ) const
inline

Gets the adress of the internal array.

Definition at line 32 of file PbArrayOfLong.h.

◆ get() [2/2]

int32_t PbArrayOfLong::get ( int  index) const
inline

Gets the int32_t value at a particular index.

Definition at line 32 of file PbArrayOfLong.h.

◆ getCapacity()

int PbArrayOfLong::getCapacity ( ) const
inline

Gets the allocated size of the array.

Definition at line 32 of file PbArrayOfLong.h.

◆ getNum()

int PbArrayOfLong::getNum ( ) const
inline

Gets the number of values in the array.

Definition at line 32 of file PbArrayOfLong.h.

◆ increasingSort()

void PbArrayOfLong::increasingSort ( )

Sorts array by increasing order.

◆ operator+=() [1/2]

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

Appends other_array to the end of the array.

◆ operator+=() [2/2]

void PbArrayOfLong::operator+= ( int32_t  val)
inline

Adds val at the end of the array.

Definition at line 32 of file PbArrayOfLong.h.

◆ operator=()

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

Copy from other_array.

◆ operator[]() [1/2]

int32_t & PbArrayOfLong::operator[] ( int  index)
inline

Definition at line 32 of file PbArrayOfLong.h.

◆ operator[]() [2/2]

const int32_t & PbArrayOfLong::operator[] ( int  index) const
inline

Definition at line 32 of file PbArrayOfLong.h.

◆ set()

void PbArrayOfLong::set ( int  index,
int32_t  val 
)
inline

Inserts int32_t value at a specified position in the array.

Definition at line 32 of file PbArrayOfLong.h.

◆ setCapacity()

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

set the capacity and allocate this capacity if necessary

◆ squeeze()

void PbArrayOfLong::squeeze ( )

Friends And Related Symbol Documentation

◆ operator!=

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

Inequality comparison operator.

Definition at line 32 of file PbArrayOfLong.h.

◆ operator==

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

Equality comparison operator.


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