My Project
IntVector Class Reference

an integer Vector data structure More...

#include <OSGeneral.h>

Inheritance diagram for IntVector:
OtherOptionOrResultEnumeration

Public Member Functions

 IntVector ()
 
 ~IntVector ()
 
 IntVector (int n)
 alternate constructor
 
bool IsEqual (IntVector *that)
 A method to compare two invectors.
 
bool setRandom (double density, bool conformant, int iMin, int iMax)
 A function to make a random instance of this class.
 
bool deepCopyFrom (IntVector *that)
 A function to make a deep copy of an instance of this class.
 
bool setIntVector (int *i, int ni)
 set values into an IntVector
 
bool extendIntVector (int i)
 append a value to an IntVector
 
int getNumberOfEl ()
 get the dimension of an IntVector
 
int getEl (int j)
 get an entry in the data array of an IntVector
 
bool getEl (int *i)
 Get the integer data array of an IntVector.
 

Public Attributes

bool bDeleteArrays
 bDeleteArrays is true if we delete the arrays in garbage collection set to true by default
 
int numberOfEl
 
int * el
 

Detailed Description

an integer Vector data structure

Definition at line 469 of file OSGeneral.h.

Constructor & Destructor Documentation

◆ IntVector() [1/2]

IntVector::IntVector ( )

Definition at line 403 of file OSGeneral.cpp.

◆ ~IntVector()

IntVector::~IntVector ( )

Definition at line 425 of file OSGeneral.cpp.

◆ IntVector() [2/2]

IntVector::IntVector ( int n)

alternate constructor

Definition at line 414 of file OSGeneral.cpp.

Member Function Documentation

◆ IsEqual()

bool IntVector::IsEqual ( IntVector * that)

A method to compare two invectors.

Definition at line 495 of file OSGeneral.cpp.

◆ setRandom()

bool IntVector::setRandom ( double density,
bool conformant,
int iMin,
int iMax )

A function to make a random instance of this class.

Parameters
densitycorresponds to the probability that a particular child element is created
conformantif true enforces side constraints not enforceable in the schema (e.g., agreement of "numberOfXXX" attributes and <XXX> children)
iMinlowest value (inclusive) that an entry in this vector can take
iMaxgreatest value (inclusive) that an entry in this vector can take

Definition at line 554 of file OSGeneral.cpp.

◆ deepCopyFrom()

bool IntVector::deepCopyFrom ( IntVector * that)

A function to make a deep copy of an instance of this class.

Parameters
thatthe instance from which information is to be copied
Returns
whether the copy was created successfully

Definition at line 573 of file OSGeneral.cpp.

◆ setIntVector()

bool IntVector::setIntVector ( int * i,
int ni )

set values into an IntVector

Parameters
nicontains the dimension of the IntVector
icontains the array of values

Definition at line 437 of file OSGeneral.cpp.

◆ extendIntVector()

bool IntVector::extendIntVector ( int i)

append a value to an IntVector

Parameters
icontains the value to be appended

Definition at line 451 of file OSGeneral.cpp.

◆ getNumberOfEl()

int IntVector::getNumberOfEl ( )

get the dimension of an IntVector

Definition at line 476 of file OSGeneral.cpp.

◆ getEl() [1/2]

int IntVector::getEl ( int j)

get an entry in the data array of an IntVector

Parameters
jis the index of the entry that is to be retrieved

Definition at line 481 of file OSGeneral.cpp.

◆ getEl() [2/2]

bool IntVector::getEl ( int * i)

Get the integer data array of an IntVector.

Parameters
iis the location where the user wants to store the array
Returns
the value
Note
it is the user's responsibility to reserve sufficient memory to hold the vector being returned.

Definition at line 488 of file OSGeneral.cpp.

Member Data Documentation

◆ bDeleteArrays

bool IntVector::bDeleteArrays

bDeleteArrays is true if we delete the arrays in garbage collection set to true by default

Definition at line 482 of file OSGeneral.h.

◆ numberOfEl

int IntVector::numberOfEl

Definition at line 483 of file OSGeneral.h.

◆ el

int* IntVector::el

Definition at line 484 of file OSGeneral.h.


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