PbArrayOfInt Class Reference

DTEXT Dynamic array of int . More...

#include <MeshViz/misc/PbArrayOfInt.h>

List of all members.

Public Member Functions

 PbArrayOfInt ()
 PbArrayOfInt (int init_size, int extend=10)
 PbArrayOfInt (const PbArrayOfInt &other_array)
 ~PbArrayOfInt ()
const int * get () const
int get (int index) const
int find (int val) const
void set (int index, int val)
int add (int val)
int add (int num_val, const int *val)
PbArrayOfIntoperator= (const PbArrayOfInt &other_array)
void operator+= (const PbArrayOfInt &other_array)
void operator+= (int val)
int & operator[] (int index)
const int & operator[] (int index) const
void setCapacity (int capacity, int extend)
void squeeze ()
int getCapacity () const
int getNum () const
void increasingSort ()
void decreasingSort ()
void empty ()

Friends

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

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.


Constructor & Destructor Documentation

PbArrayOfInt::PbArrayOfInt (  )  [inline]
PbArrayOfInt::PbArrayOfInt ( int  init_size,
int  extend = 10 
)

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

PbArrayOfInt::PbArrayOfInt ( const PbArrayOfInt other_array  ) 
PbArrayOfInt::~PbArrayOfInt (  ) 

Member Function Documentation

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.

int PbArrayOfInt::add ( int  val  )  [inline]

Inserts int value at the end of the array.

Returns its location in the array.

void PbArrayOfInt::decreasingSort (  ) 

Sorts array by decreasing order.

void PbArrayOfInt::empty (  )  [inline]

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

int PbArrayOfInt::find ( int  val  )  const [inline]

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

int PbArrayOfInt::get ( int  index  )  const [inline]

Gets the int value at a particular index.

const int * PbArrayOfInt::get (  )  const [inline]

Gets the adress of the internal array.

int PbArrayOfInt::getCapacity (  )  const [inline]

Gets the allocated size of the array.

int PbArrayOfInt::getNum (  )  const [inline]

Gets the number of values in the array.

void PbArrayOfInt::increasingSort (  ) 

Sorts array by increasing order.

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

Adds val at the end of the array.

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

Appends other_array to the end of the array.

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

Copy from other_array.

const int & PbArrayOfInt::operator[] ( int  index  )  const [inline]
int & PbArrayOfInt::operator[] ( int  index  )  [inline]
void PbArrayOfInt::set ( int  index,
int  val 
) [inline]

Inserts int value at a specified position in the array.

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

set the capacity and allocate this capacity if necessary

void PbArrayOfInt::squeeze (  ) 

Friends And Related Function Documentation

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

Inequality comparison 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:

Open Inventor Toolkit reference manual, generated on 15 Mar 2023
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/