- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Mers::Models::Base::BaseModelVariableArrayArray Class Reference

`#include <BaseModelVariableArrayArray.h>`

Inheritance diagram for Mers::Models::Base::BaseModelVariableArrayArray:

[legend]
Collaboration diagram for Mers::Models::Base::BaseModelVariableArrayArray:

[legend]
List of all members.

## Public Types
typedef BaseModelVariableArray * | pointer
typedef const BaseModelVariableArray * | const_pointer
typedef BaseModelVariableArrayArray | ContainerType
typedef Mers::Utils::Containers::IteratorTemplate< const_pointer, ContainerType > | const_iterator
typedef Mers::Utils::Containers::IteratorTemplate< pointer, ContainerType > | iterator
typedef const_iterator | ConstantIterator
typedef iterator | Iterator
## Public Member Functions
| BaseModelVariableArrayArray (bool myOwnershipStatus)
| BaseModelVariableArrayArray (BaseModelVariableArrayArray const &other)
virtual | ~BaseModelVariableArrayArray ()
Iterator | begin ()
ConstantIterator | begin () const
Iterator | end ()
ConstantIterator | end () const
int | pushBack (BaseModelVariableArray *data)
BaseModelVariableArray * | popBack ()
BaseModelVariableArray * | find (char const *variableName)
BaseModelVariableArray const * | find (char const *variableName) const
void | insert (unsigned int elementIndex, BaseModelVariableArray *data)
BaseModelVariableArray *& | operator[] (int elementIndex)
BaseModelVariableArray *& | operator[] (unsigned int elementIndex)
BaseModelVariableArray const *& | operator[] (int elementIndex) const
BaseModelVariableArray const *& | operator[] (unsigned int elementIndex) const
BaseModelVariableArrayArray const & | operator= (BaseModelVariableArrayArray const &other)
BaseModelVariableArrayArray const & | operator+= (BaseModelVariableArrayArray const &other)
BaseModelVariableArrayArray const & | operator+= (BaseModelVariableArray const &other)
bool | operator== (BaseModelVariableArrayArray const &other) const
bool | operator!= (BaseModelVariableArrayArray const &other) const
## Protected Member Functions
void | printElement (std::ostream &out, void const *element) const
void | deleteElement (void *element) const
void * | newElement (void const *element) const
bool | foundMatch (char const *elementName, void const *element) const
bool | isEqual (void const *element1, void const *element2) const

## Detailed Description

A dynamic array of BaseModelVariableArray

Author:
  Paul H. Elliott

Definition at line 34 of file BaseModelVariableArrayArray.h.

## Constructor & Destructor Documentation

BaseModelVariableArrayArray::BaseModelVariableArrayArray | ( | bool | myOwnershipStatus | ) |

Creates a new, empty array.

Parameters:

  | myOwnershipStatus | the ownership status. If true, this object owns the array objects it contains and should delete them upon being deleted.

Definition at line 31 of file BaseModelVariableArrayArray.cpp.

BaseModelVariableArrayArray::BaseModelVariableArrayArray | ( | BaseModelVariableArrayArray const & | other | ) |

Creates a new array with a copy of the contents from the other array. This can be an expensive operation.

Parameters:

  | other | the array whos contents are copied

Definition at line 39 of file BaseModelVariableArrayArray.cpp.

References Mers::Utils::Containers::DynamicArray::copy(), and Mers::Utils::Containers::DynamicArray::getDynamicArrayType().

Here is the call graph for this function:

BaseModelVariableArrayArray::~BaseModelVariableArrayArray | ( |  | ) | `[virtual]`

Destroys the array.

Definition at line 54 of file BaseModelVariableArrayArray.cpp.

References Mers::Utils::Containers::DynamicArray::destroy().

Here is the call graph for this function:

## Member Function Documentation

Iterator Mers::Models::Base::BaseModelVariableArrayArray::begin | ( |  | ) | `[inline]`

Returns a iterator that points to the first element of this array.

Returns:
  a iterator that starts this object

Definition at line 92 of file BaseModelVariableArrayArray.h.

ConstantIterator Mers::Models::Base::BaseModelVariableArrayArray::begin | ( |  | ) | const`[inline]`

Returns a constant iterator that points to the first element of this array.

Returns:
  a constant iterator that starts this object

Definition at line 102 of file BaseModelVariableArrayArray.h.

Iterator Mers::Models::Base::BaseModelVariableArrayArray::end | ( |  | ) | `[inline]`

Returns a iterator that points just past the last element of this array.

Returns:
  a iterator that ends this object

Definition at line 113 of file BaseModelVariableArrayArray.h.

References Mers::Utils::Containers::DynamicArray::getLength().

Here is the call graph for this function:

ConstantIterator Mers::Models::Base::BaseModelVariableArrayArray::end | ( |  | ) | const`[inline]`

Returns a constant iterator that points just past the last element of this array.

Returns:
  a constant iterator that ends this object

Definition at line 123 of file BaseModelVariableArrayArray.h.

References Mers::Utils::Containers::DynamicArray::getLength().

Here is the call graph for this function:

int BaseModelVariableArrayArray::pushBack | ( | BaseModelVariableArray * | data | ) |

Adds a data element to the end of the array, allocating space if necessary for it to fit. This object assumes ownership of data object and will delete it when this object is destroyed.

Parameters:

  | data | pointer to the data being added.

Returns:
  0 on success or a positive number if the data could not be added.

Definition at line 61 of file BaseModelVariableArrayArray.cpp.

Referenced by Mers::Solvers::SAT::GATSAT::CompileSAT::CompileSAT::CompileSAT().

BaseModelVariableArray * BaseModelVariableArrayArray::popBack | ( |  | ) |

Returns the last element of the array and removes it from the array, also reduces the size of the array should it fall below 1/4 full.

Returns:
  the data element at the end of the current array.

Reimplemented from Mers::Utils::Containers::DynamicArray.

Definition at line 68 of file BaseModelVariableArrayArray.cpp.

BaseModelVariableArray * BaseModelVariableArrayArray::find | ( | char const * | variableName | ) |

Finds the variable with the specified name and returns it, if found. The search is case sensitive.

Parameters:

  | variableName | the name of the variable being sought.

Returns:
  the variable, if found, or NULL if a variable with a matching name could not be found.

Reimplemented from Mers::Utils::Containers::DynamicArray.

Definition at line 75 of file BaseModelVariableArrayArray.cpp.

BaseModelVariableArray const * BaseModelVariableArrayArray::find | ( | char const * | variableName | ) | const

Finds the variable with the specified name and returns it, if found. The search is case sensitive.

Parameters:

  | variableName | the name of the variable being sought.

Returns:
  the variable, if found, or NULL if a variable with a matching name. could not be found

Reimplemented from Mers::Utils::Containers::DynamicArray.

Definition at line 82 of file BaseModelVariableArrayArray.cpp.

void Mers::Models::Base::BaseModelVariableArrayArray::insert | ( | unsigned int | elementIndex,
|  | BaseModelVariableArray * | data |
| ) |  |  | `[inline]`

Inserts a new element at the specified index.

Parameters:

  | elementIndex | the index that the item should be inserted at.
  | data | the data being inserted.

Definition at line 177 of file BaseModelVariableArrayArray.h.

BaseModelVariableArray *& BaseModelVariableArrayArray::operator[] | ( | int | elementIndex | ) |

Retrieves the element at the specified index and returns it.

Parameters:

  | elementIndex | location of the element to be accessed.

Returns:
  the element requested if index is in range, otherwise it returns NULL

Reimplemented from Mers::Utils::Containers::DynamicArray.

Definition at line 89 of file BaseModelVariableArrayArray.cpp.

BaseModelVariableArray *& BaseModelVariableArrayArray::operator[] | ( | unsigned int | elementIndex | ) |

Retrieves the element at the specified index and returns it.

Parameters:

  | elementIndex | location of the element to be accessed.

Returns:
  the element requested if index is in range, otherwise it returns NULL.

Reimplemented from Mers::Utils::Containers::DynamicArray.

Definition at line 96 of file BaseModelVariableArrayArray.cpp.

BaseModelVariableArray const *& BaseModelVariableArrayArray::operator[] | ( | int | elementIndex | ) | const

Retrieves the element at the specified index and returns it.

Parameters:

  | elementIndex | location of the element to be accessed.

Returns:
  the element requested if index is in range, otherwise it returns NULL.

Reimplemented from Mers::Utils::Containers::DynamicArray.

Definition at line 104 of file BaseModelVariableArrayArray.cpp.

BaseModelVariableArray const *& BaseModelVariableArrayArray::operator[] | ( | unsigned int | elementIndex | ) | const

Retrieves the element at the specified index and returns it.

Parameters:

  | elementIndex | location of the element to be accessed.

Returns:
  the element requested if index is in range, otherwise it returns NULL.

Reimplemented from Mers::Utils::Containers::DynamicArray.

Definition at line 112 of file BaseModelVariableArrayArray.cpp.

BaseModelVariableArrayArray const & BaseModelVariableArrayArray::operator= | ( | BaseModelVariableArrayArray const & | other | ) |

Copies the data from the other array to this array. This can be expensive for long arrays. The origional data in this array is destroyed.

Parameters:

  | other | the array supplying the data for this array.

Returns:
  the other array.

Definition at line 120 of file BaseModelVariableArrayArray.cpp.

BaseModelVariableArrayArray const & BaseModelVariableArrayArray::operator+= | ( | BaseModelVariableArrayArray const & | other | ) |

Appends a copy of the data from the other array to this array. This can be expensive for long arrays.

Parameters:

  | other | the array supplying the data for this array.

Returns:
  this array

Definition at line 128 of file BaseModelVariableArrayArray.cpp.

BaseModelVariableArrayArray const & BaseModelVariableArrayArray::operator+= | ( | BaseModelVariableArray const & | other | ) |

Appends a copy of the data to this array. This is the same as pushBack except the data here is copied first, so this object doesn't assume ownership of data.

Parameters:

  | other | the element being copied and added to this array.

Returns:
  this array.

Definition at line 136 of file BaseModelVariableArrayArray.cpp.

bool BaseModelVariableArrayArray::operator== | ( | BaseModelVariableArrayArray const & | other | ) | const

Returns true if the two arrays have all the same elements in the same order.

Parameters:

  | other | the array being compared to this array.

Returns:
  true if the two arrays have the same elements in the same order.

Definition at line 143 of file BaseModelVariableArrayArray.cpp.

bool BaseModelVariableArrayArray::operator!= | ( | BaseModelVariableArrayArray const & | other | ) | const

Returns false if the two arrays have all the same elements in the same order.

Parameters:

  | other | the array being compared to this array.

Returns:
  false if the two arrays have the same elements in the same order

Definition at line 150 of file BaseModelVariableArrayArray.cpp.

void BaseModelVariableArrayArray::printElement | ( | std::ostream & | out,
|  | void const * | element |
| ) |  |  | const`[protected, virtual]`

Prints the element of this array to the ostream out. This is called by the DynamicArray::operator<< for each element being printed.

Parameters:

  | out | the stream being printed to.
  | element | the element being printed

Implements Mers::Utils::Containers::DynamicArray.

Definition at line 159 of file BaseModelVariableArrayArray.cpp.

void BaseModelVariableArrayArray::deleteElement | ( | void * | element | ) | const`[protected, virtual]`

Called when an element should be deleted because it's storage space is being deleted. This function deletes the element (BaseModelVariableArray).

Parameters:

  | element | the BaesModelVariable to delete.

Implements Mers::Utils::Containers::DynamicArray.

Definition at line 168 of file BaseModelVariableArrayArray.cpp.

void * BaseModelVariableArrayArray::newElement | ( | void const * | element | ) | const`[protected, virtual]`

Creates and returns a new BaseModelVariableArray that is a copy of the BaseModelVariableArray element.

Parameters:

  | element | the element being copied.

Returns:
  the new BaseModelVariableArray object that is a copy of element

Implements Mers::Utils::Containers::DynamicArray.

Definition at line 175 of file BaseModelVariableArrayArray.cpp.

bool BaseModelVariableArrayArray::foundMatch | ( | char const * | elementName,
|  | void const * | element |
| ) |  |  | const`[protected, virtual]`

Returns true if the specified element has the same name as elementName. This comparison is case sensitive.

Parameters:

  | elementName | the name of the object being sought.
  | element | the element that is being queried.

Returns:
  true if the element has the name elementName.

Reimplemented from Mers::Utils::Containers::DynamicArray.

Definition at line 182 of file BaseModelVariableArrayArray.cpp.

bool BaseModelVariableArrayArray::isEqual | ( | void const * | element1,
|  | void const * | element2 |
| ) |  |  | const`[protected, virtual]`

Returns true if the two elements are equal. This default function returns true if the pointers are the same.

Parameters:

  | element1 | the first element in the comparison.
  | element2 | the second element in the comparison.

Returns:
  true if they are the equal and false if they are not equal.

Reimplemented from Mers::Utils::Containers::DynamicArray.

Definition at line 191 of file BaseModelVariableArrayArray.cpp.

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

- /Users/fpy/titan-1-5-MBARI/Mers/Models/Base/BaseModelVariableArrayArray.h
- /Users/fpy/titan-1-5-MBARI/Mers/Models/Base/BaseModelVariableArrayArray.cpp