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

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

# Mers::Models::Base::BaseModelDomainArray Class Reference

`#include <BaseModelDomainArray.h>`

Inheritance diagram for Mers::Models::Base::BaseModelDomainArray:

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

[legend]
List of all members.

## Public Types
typedef BaseModelDomain * | pointer
typedef const BaseModelDomain * | const_pointer
typedef BaseModelDomainArray | 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
| BaseModelDomainArray (bool myOwnershipStatus)
| BaseModelDomainArray (BaseModelDomainArray const &other)
virtual | ~BaseModelDomainArray ()
Iterator | begin ()
ConstantIterator | begin () const
Iterator | end ()
ConstantIterator | end () const
int | pushBack (BaseModelDomain *data)
BaseModelDomain * | popBack ()
BaseModelDomain * | find (char const *domainName)
BaseModelDomain const * | find (char const *domainName) const
BaseModelDomain *& | operator[] (int elementIndex)
BaseModelDomain *& | operator[] (unsigned int elementIndex)
BaseModelDomain const *& | operator[] (int elementIndex) const
BaseModelDomain const *& | operator[] (unsigned int elementIndex) const
BaseModelDomainArray const & | operator= (BaseModelDomainArray const &other)
BaseModelDomainArray const & | operator+= (BaseModelDomainArray const &other)
BaseModelDomainArray const & | operator+= (BaseModelDomain const &data)
bool | operator== (BaseModelDomainArray const &data) const
bool | operator!= (BaseModelDomainArray const &data) 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 BaseModelDomains.

Author:
  Paul H. Elliott

Definition at line 33 of file BaseModelDomainArray.h.

## Constructor & Destructor Documentation

BaseModelDomainArray::BaseModelDomainArray | ( | 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 30 of file BaseModelDomainArray.cpp.

BaseModelDomainArray::BaseModelDomainArray | ( | BaseModelDomainArray 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 38 of file BaseModelDomainArray.cpp.

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

Here is the call graph for this function:

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

Destroys the array

Definition at line 53 of file BaseModelDomainArray.cpp.

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

Here is the call graph for this function:

## Member Function Documentation

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

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

Returns:
  a iterator that starts this object.

Definition at line 91 of file BaseModelDomainArray.h.

Referenced by Mers::Models::CCA::CCADomains::domain_p(), Mers::Models::CCA::CCADomains::insert_domain(), and Mers::Models::CCA::Io::Mof::MOFReader::saveCCAModel().

ConstantIterator Mers::Models::Base::BaseModelDomainArray::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 101 of file BaseModelDomainArray.h.

Iterator Mers::Models::Base::BaseModelDomainArray::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 112 of file BaseModelDomainArray.h.

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

Referenced by Mers::Models::CCA::CCADomains::domain_p(), Mers::Models::CCA::CCADomains::insert_domain(), and Mers::Models::CCA::Io::Mof::MOFReader::saveCCAModel().

Here is the call graph for this function:

ConstantIterator Mers::Models::Base::BaseModelDomainArray::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 122 of file BaseModelDomainArray.h.

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

Here is the call graph for this function:

int BaseModelDomainArray::pushBack | ( | BaseModelDomain * | 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 60 of file BaseModelDomainArray.cpp.

Referenced by Mers::Models::Base::BaseModel::addDomain(), Mers::Models::CCA::CCADomains::insert_domain(), and tut::BMHelper::loadDomainData().

BaseModelDomain * BaseModelDomainArray::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 67 of file BaseModelDomainArray.cpp.

BaseModelDomain * BaseModelDomainArray::find | ( | char const * | domainName | ) |

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

Parameters:

  | domainName | the name of the domain being sought.

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

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

Definition at line 74 of file BaseModelDomainArray.cpp.

Referenced by Mers::Models::Base::BaseModel::getDomain().

BaseModelDomain const * BaseModelDomainArray::find | ( | char const * | domainName | ) | const

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

Parameters:

  | domainName | the name of the domain being sought.

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

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

Definition at line 81 of file BaseModelDomainArray.cpp.

BaseModelDomain *& BaseModelDomainArray::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 88 of file BaseModelDomainArray.cpp.

BaseModelDomain *& BaseModelDomainArray::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 95 of file BaseModelDomainArray.cpp.

BaseModelDomain const *& BaseModelDomainArray::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 103 of file BaseModelDomainArray.cpp.

BaseModelDomain const *& BaseModelDomainArray::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 111 of file BaseModelDomainArray.cpp.

BaseModelDomainArray const & BaseModelDomainArray::operator= | ( | BaseModelDomainArray 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 119 of file BaseModelDomainArray.cpp.

BaseModelDomainArray const & BaseModelDomainArray::operator+= | ( | BaseModelDomainArray 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 127 of file BaseModelDomainArray.cpp.

BaseModelDomainArray const & BaseModelDomainArray::operator+= | ( | BaseModelDomain const & | data | ) |

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:

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

Returns:
  this array.

Definition at line 135 of file BaseModelDomainArray.cpp.

bool Mers::Models::Base::BaseModelDomainArray::operator== | ( | BaseModelDomainArray const & | data | ) | const`[inline]`

Returns true if the two lists of domains contain the same domains (deep comparison).

Parameters:

  | other | the other domain array being compared to this domain array.

Returns:
  true if the two arrays are the same.

Definition at line 249 of file BaseModelDomainArray.h.

bool Mers::Models::Base::BaseModelDomainArray::operator!= | ( | BaseModelDomainArray const & | data | ) | const`[inline]`

Returns false if the two lists of domains contain the same domains (deep comparison).

Parameters:

  | other | the other domain array being compared to this domain array.

Returns:
  false if the two arrays are the same.

Definition at line 261 of file BaseModelDomainArray.h.

void BaseModelDomainArray::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 144 of file BaseModelDomainArray.cpp.

void BaseModelDomainArray::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 (BaseModelDomain).

Parameters:

  | element | the BaesModelDomain to delete.

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

Definition at line 153 of file BaseModelDomainArray.cpp.

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

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

Parameters:

  | element | the element being copied.

Returns:
  the new BaseModelDomain object that is a copy of element.

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

Definition at line 160 of file BaseModelDomainArray.cpp.

Referenced by Mers::Models::CCA::CCADomains::insert_domain().

bool BaseModelDomainArray::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 167 of file BaseModelDomainArray.cpp.

bool BaseModelDomainArray::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 178 of file BaseModelDomainArray.cpp.

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

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