Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
className Class Reference

#include <MeshViz/misc/PbArray.h>

Public Member Functions

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

Friends

int operator== (const className &array_1, const className &array_2)
 Equality comparison operator.
 
int operator!= (const className &array_1, const className &array_2)
 Inequality comparison operator.
 

Detailed Description

Definition at line 39 of file PbArray.h.

Constructor & Destructor Documentation

◆ className() [1/3]

className::className ( )
inline

Definition at line 41 of file PbArray.h.

◆ className() [2/3]

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

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

◆ className() [3/3]

className::className ( const className other_array)

◆ ~className()

className::~className ( )

Member Function Documentation

◆ add() [1/2]

int className::add ( int  num_val,
const valueType *  val 
)

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

Returns the location of the last one inserted.

◆ add() [2/2]

int className::add ( valueType  val)
inline

Inserts valueType value at the end of the array.

Returns its location in the array.

Definition at line 155 of file PbArray.h.

◆ decreasingSort()

void className::decreasingSort ( )

Sorts array by decreasing order.

◆ empty()

void className::empty ( )
inline

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

Definition at line 203 of file PbArray.h.

◆ find()

int className::find ( valueType  val) const
inline

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

Definition at line 137 of file PbArray.h.

◆ get() [1/2]

const valueType * className::get ( ) const
inline

Gets the adress of the internal array.

Definition at line 129 of file PbArray.h.

◆ get() [2/2]

valueType className::get ( int  index) const
inline

Gets the valueType value at a particular index.

Definition at line 133 of file PbArray.h.

◆ getCapacity()

int className::getCapacity ( ) const
inline

Gets the allocated size of the array.

Definition at line 192 of file PbArray.h.

◆ getNum()

int className::getNum ( ) const
inline

Gets the number of values in the array.

Definition at line 197 of file PbArray.h.

◆ increasingSort()

void className::increasingSort ( )

Sorts array by increasing order.

◆ operator+=() [1/2]

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

Appends other_array to the end of the array.

◆ operator+=() [2/2]

void className::operator+= ( valueType  val)
inline

Adds val at the end of the array.

Definition at line 166 of file PbArray.h.

◆ operator=() [1/2]

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

Copy from other_array.

◆ operator=() [2/2]

className & className::operator= ( const std::vector< valueType > &  other_array)

Copy from an STL vector.

◆ operator[]() [1/2]

valueType & className::operator[] ( int  index)
inline

Definition at line 183 of file PbArray.h.

◆ operator[]() [2/2]

const valueType & className::operator[] ( int  index) const
inline

Definition at line 174 of file PbArray.h.

◆ set()

void className::set ( int  index,
valueType  val 
)
inline

Inserts valueType value at a specified position in the array.

Definition at line 145 of file PbArray.h.

◆ setCapacity()

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

set the capacity and allocate this capacity if necessary

◆ squeeze()

void className::squeeze ( )

Friends And Related Symbol Documentation

◆ operator!=

int operator!= ( const className array_1,
const className array_2 
)
friend

Inequality comparison operator.

Definition at line 91 of file PbArray.h.

◆ operator==

int operator== ( const className array_1,
const className array_2 
)
friend

Equality comparison operator.


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