WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
Public Member Functions | List of all members
WXP::IntArray Class Reference

This class creates an integer array. More...

#include "../include/IntArray.h"

Public Member Functions

int init ()
 
int init (int size)
 
 IntArray ()
 
 IntArray (int size)
 
 ~IntArray ()
 
 IntArray (const IntArray &data)
 
IntArray operator= (const IntArray &data)
 
int copy (const IntArray &data)
 
int clear ()
 
int expand (int size)
 
int add (int rval)
 
int add1 (int rval)
 
int set (int ind, int rval)
 
int get (int ind, int &rval)
 
int get (int ind)
 
int getNum ()
 
int offset (int ind, int rval)
 
int sum ()
 
int product ()
 
int print ()
 

Detailed Description

This class creates an integer array.

Author
Dan Vietor

Constructor & Destructor Documentation

◆ IntArray() [1/3]

IntArray::IntArray ( )

Constructor. Initializes the values.

References init().

◆ IntArray() [2/3]

IntArray::IntArray ( int  size)

Constructor. Size the arrays.

References init().

◆ ~IntArray()

IntArray::~IntArray ( )

Destructor.

◆ IntArray() [3/3]

IntArray::IntArray ( const IntArray data)

Copy constructor.

Parameters
dataStrings class to copy from

References copy().

Member Function Documentation

◆ add()

int IntArray::add ( int  rval)

Adds a new point.

Parameters
rvalValue to add

References expand().

◆ add1()

int WXP::IntArray::add1 ( int  rval)
inline

Adds a value (no bounds check)

◆ clear()

int WXP::IntArray::clear ( )
inline

Clears the contents of the array

◆ copy()

int IntArray::copy ( const IntArray data)

Copy data.

Parameters
eptsStrings class to copy from

References init().

Referenced by IntArray(), and operator=().

◆ expand()

int IntArray::expand ( int  size)

Expands the size of the array

Parameters
sizeThe new size

Referenced by add(), and set().

◆ get() [1/2]

int IntArray::get ( int  ind)

Gets a specific point value from array.

Parameters
indIndex of value to get
Returns
Output value

◆ get() [2/2]

int IntArray::get ( int  ind,
int &  rval 
)

Gets a specific point value from array.

Parameters
indIndex of value to get
Return values
rvalOutput value

◆ getNum()

int WXP::IntArray::getNum ( )
inline

Return the number of points

◆ init() [1/2]

int IntArray::init ( )

Initializes the values

Referenced by copy(), IntArray(), and IntArray().

◆ init() [2/2]

int IntArray::init ( int  size)

Initializes the values

◆ offset()

int IntArray::offset ( int  ind,
int  rval 
)

Offsets a specific point value in array.

Parameters
indIndex of value to set
rvalOffset value

◆ operator=()

IntArray IntArray::operator= ( const IntArray data)

Assignment operator. Used to overload copying

Parameters
dataString class to copy from

References copy().

◆ print()

int IntArray::print ( )

Prints the values to standard output.

◆ product()

int IntArray::product ( )

Returns the product of all values in array

◆ set()

int IntArray::set ( int  ind,
int  rval 
)

Sets a specific value in array.

Parameters
indIndex of value to set
rvalNew value

References expand().

◆ sum()

int IntArray::sum ( )

Returns the sum of all values in array


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