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

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

# Mers::Models::Base::BaseModelClauseArray Class Reference

`#include <BaseModelClauseArray.h>`

Inheritance diagram for Mers::Models::Base::BaseModelClauseArray:

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

[legend]
List of all members.

## Public Types
typedef BaseModelClause * | pointer
typedef const BaseModelClause * | const_pointer
typedef BaseModelClauseArray | 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
| BaseModelClauseArray (bool myOwnershipStatus, BaseModelObject::ObjectType objType=BaseModelObject::BMDynamicArray)
| BaseModelClauseArray (BaseModelClauseArray const &other)
virtual | ~BaseModelClauseArray ()
Iterator | begin ()
ConstantIterator | begin () const
Iterator | end ()
ConstantIterator | end () const
int | pushBack (BaseModelClause *data)
BaseModelClause * | popBack ()
BaseModelClause *& | operator[] (int elementIndex)
BaseModelClause *& | operator[] (unsigned int elementIndex)
BaseModelClause const *& | operator[] (int elementIndex) const
BaseModelClause const *& | operator[] (unsigned int elementIndex) const
BaseModelClauseArray const & | operator= (BaseModelClauseArray const &other)
BaseModelClauseArray const & | operator+= (BaseModelClauseArray const &other)
BaseModelClauseArray const & | operator+= (BaseModelClause const &data)
## Protected Member Functions
void | printElement (std::ostream &out, void const *element) const
void | deleteElement (void *element) const
void * | newElement (void const *element) const
bool | isEqual (void const *element1, void const *element2) const

## Detailed Description

A dynamic array of BaseModelClause.

Author:
  Paul H. Elliott

Definition at line 33 of file BaseModelClauseArray.h.

## Constructor & Destructor Documentation

BaseModelClauseArray::BaseModelClauseArray | ( | bool | myOwnershipStatus,
|  | BaseModelObject::ObjectType | objType = `BaseModelObject::BMDynamicArray` |
| ) |  |  |

Creates a new, empty array

Parameters:

  | objType | the type of clause array - normal or sentence
  | myOwnershipStatus | the ownership status. If true, this object owns the array objects it contains and should delete them upon being deleted.

Definition at line 29 of file BaseModelClauseArray.cpp.

BaseModelClauseArray::BaseModelClauseArray | ( | BaseModelClauseArray 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 BaseModelClauseArray.cpp.

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

Here is the call graph for this function:

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

Destroys the array

Definition at line 53 of file BaseModelClauseArray.cpp.

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

Here is the call graph for this function:

## Member Function Documentation

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

returns a iterator that points to the first element of this array

Returns:
  a iterator that starts this object

Reimplemented in Mers::Models::CCA::CCASentence.

Definition at line 89 of file BaseModelClauseArray.h.

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

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

Returns:
  a constant iterator that starts this object

Reimplemented in Mers::Models::CCA::CCASentence.

Definition at line 97 of file BaseModelClauseArray.h.

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

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

Returns:
  a iterator that ends this object

Reimplemented in Mers::Models::CCA::CCASentence.

Definition at line 106 of file BaseModelClauseArray.h.

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

Here is the call graph for this function:

ConstantIterator Mers::Models::Base::BaseModelClauseArray::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

Reimplemented in Mers::Models::CCA::CCASentence.

Definition at line 114 of file BaseModelClauseArray.h.

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

Here is the call graph for this function:

int BaseModelClauseArray::pushBack | ( | BaseModelClause * | 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 BaseModelClauseArray.cpp.

Referenced by Mers::Solvers::SAT::ValidSAT::VSATNode::addConstraint(), TestSuiteParser::constraints(), Mers::Solvers::SAT::SATInterface::findSatisfyingSolutions(), Mers::Solvers::SAT::SATInterface::findUnsatisfyingSolutions(), Mers::Estimation::Discrete::ModeEstimation::ModeEstimator::generateTrajectories(), Mers::Estimation::Discrete::ApproximateBeliefState::BFBSE::BFBSE::generateTrajectories(), Mers::Solvers::SAT::ISAT::ISATTester::ISATTester(), and tut::BMHelper::loadClauses().

BaseModelClause * BaseModelClauseArray::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.

Reimplemented in Mers::Models::CCA::CCASentence.

Definition at line 67 of file BaseModelClauseArray.cpp.

Referenced by Mers::Solvers::SAT::ValidSAT::VSATNode::propagate().

BaseModelClause *& BaseModelClauseArray::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.

Reimplemented in Mers::Models::CCA::CCASentence.

Definition at line 74 of file BaseModelClauseArray.cpp.

BaseModelClause *& BaseModelClauseArray::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.

Reimplemented in Mers::Models::CCA::CCASentence.

Definition at line 81 of file BaseModelClauseArray.cpp.

BaseModelClause const *& BaseModelClauseArray::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.

Reimplemented in Mers::Models::CCA::CCASentence.

Definition at line 89 of file BaseModelClauseArray.cpp.

BaseModelClause const *& BaseModelClauseArray::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.

Reimplemented in Mers::Models::CCA::CCASentence.

Definition at line 97 of file BaseModelClauseArray.cpp.

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

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

Referenced by Mers::Models::Base::BaseModelSentence::operator+=().

BaseModelClauseArray const & BaseModelClauseArray::operator+= | ( | BaseModelClause 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

Reimplemented in Mers::Models::Base::BaseModelSentence.

Definition at line 121 of file BaseModelClauseArray.cpp.

void BaseModelClauseArray::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 130 of file BaseModelClauseArray.cpp.

void BaseModelClauseArray::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 (BaseModelClause).

Parameters:

  | element | the BaesModelClause to delete

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

Definition at line 139 of file BaseModelClauseArray.cpp.

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

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

Parameters:

  | element | the element being copied

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

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

Reimplemented in Mers::Models::CCA::CCASentence.

Definition at line 146 of file BaseModelClauseArray.cpp.

bool BaseModelClauseArray::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 153 of file BaseModelClauseArray.cpp.

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

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