PbArrayOfLong Class Reference

DTEXT Dynamic array of int32_t . More...

#include <MeshViz/misc/PbArrayOfLong.h>

List of all members.

Public Member Functions

 PbArrayOfLong ()
 PbArrayOfLong (int init_size, int extend=10)
 PbArrayOfLong (const PbArrayOfLong &other_array)
 ~PbArrayOfLong ()
const int32_t * get () const
int32_t get (int index) const
int find (int32_t val) const
void set (int index, int32_t val)
int add (int32_t val)
int add (int num_val, const int32_t *val)
PbArrayOfLongoperator= (const PbArrayOfLong &other_array)
void operator+= (const PbArrayOfLong &other_array)
void operator+= (int32_t val)
int32_t & operator[] (int index)
const int32_t & 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 PbArrayOfLong &array_1, const PbArrayOfLong &array_2)
MESHVIZ_API friend int operator!= (const PbArrayOfLong &array_1, const PbArrayOfLong &array_2)

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.


Constructor & Destructor Documentation

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

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

PbArrayOfLong::PbArrayOfLong ( const PbArrayOfLong other_array  ) 
PbArrayOfLong::~PbArrayOfLong (  ) 

Member Function Documentation

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.

int PbArrayOfLong::add ( int32_t  val  )  [inline]

Inserts int32_t value at the end of the array.

Returns its location in the array.

void PbArrayOfLong::decreasingSort (  ) 

Sorts array by decreasing order.

void PbArrayOfLong::empty (  )  [inline]

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

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).

int32_t PbArrayOfLong::get ( int  index  )  const [inline]

Gets the int32_t value at a particular index.

const int32_t * PbArrayOfLong::get (  )  const [inline]

Gets the adress of the internal array.

int PbArrayOfLong::getCapacity (  )  const [inline]

Gets the allocated size of the array.

int PbArrayOfLong::getNum (  )  const [inline]

Gets the number of values in the array.

void PbArrayOfLong::increasingSort (  ) 

Sorts array by increasing order.

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

Adds val at the end of the array.

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

Appends other_array to the end of the array.

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

Copy from other_array.

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

Inserts int32_t value at a specified position in the array.

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

set the capacity and allocate this capacity if necessary

void PbArrayOfLong::squeeze (  ) 

Friends And Related Function Documentation

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

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

Open Inventor Toolkit reference manual, generated on 12 Feb 2024
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/