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

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

# Mers::Models::Base::BaseModelAssignmentArray Class Reference

`#include <BaseModelAssignmentArray.h>`

Inheritance diagram for Mers::Models::Base::BaseModelAssignmentArray:

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

[legend]
List of all members.

## Public Types
typedef BaseModelAssignment * | pointer
typedef const BaseModelAssignment * | const_pointer
typedef BaseModelAssignmentArray | 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
| BaseModelAssignmentArray (bool myOwnershipStatus, BaseModelObject::ObjectType objType=BaseModelObject::BMDynamicArray)
| BaseModelAssignmentArray (BaseModelAssignmentArray const &other)
virtual | ~BaseModelAssignmentArray ()
Iterator | begin ()
ConstantIterator | begin () const
Iterator | end ()
ConstantIterator | end () const
int | pushBack (BaseModelAssignment *data)
BaseModelAssignment * | popBack ()
BaseModelAssignment *& | peekBack ()
BaseModelAssignment const *& | peekBack () const
virtual BaseModelObject * | duplicate () const
BaseModelAssignment *& | operator[] (int elementIndex)
BaseModelAssignment *& | operator[] (unsigned int elementIndex)
BaseModelAssignment const *& | operator[] (int elementIndex) const
BaseModelAssignment const *& | operator[] (unsigned int elementIndex) const
bool | operator== (BaseModelAssignmentArray const &other) const
bool | operator!= (BaseModelAssignmentArray const &other) const
BaseModelAssignmentArray const & | operator= (BaseModelAssignmentArray const &other)
BaseModelAssignmentArray const & | operator+= (BaseModelAssignmentArray const &other)
virtual BaseModelAssignmentArray const & | operator+= (BaseModelAssignment 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 BaseModelAssignment

Author:
  Paul H. Elliott

Definition at line 33 of file BaseModelAssignmentArray.h.

## Constructor & Destructor Documentation

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

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.
  | objType | the BaseModelObject type of this object - BMDynamicArray or BMClause

Definition at line 30 of file BaseModelAssignmentArray.cpp.

Referenced by duplicate().

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

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

Here is the call graph for this function:

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

Destroys the array

Definition at line 54 of file BaseModelAssignmentArray.cpp.

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

Here is the call graph for this function:

## Member Function Documentation

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

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

Returns:
  a iterator that starts this object

Definition at line 96 of file BaseModelAssignmentArray.h.

Referenced by Mers::Estimation::Discrete::CompiledTransition::CompiledTransition(), Mers::Estimation::Discrete::Dissent::Dissent(), Mers::Estimation::Discrete::Estimate::Estimate(), rpInterface::generate_next_command_intList_p(), Mers::Models::CCA::CCAClause::insert_assignment(), Mers::Models::CCA::CCAAssignments::insert_assignment(), Mers::Models::CCA::CCAModel::is_valid(), Mers::Estimation::Discrete::operator<<(), rpTransition::reset_conditions(), and Mers::Models::CCA::Io::Mof::MOFReader::writeConstraint().

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

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

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

Referenced by Mers::Estimation::Discrete::CompiledTransition::CompiledTransition(), Mers::Estimation::Discrete::Dissent::Dissent(), Mers::Estimation::Discrete::Estimate::Estimate(), rpInterface::generate_next_command_intList_p(), Mers::Models::CCA::CCAClause::insert_assignment(), Mers::Models::CCA::CCAAssignments::insert_assignment(), Mers::Models::CCA::CCAModel::is_valid(), Mers::Estimation::Discrete::operator<<(), rpTransition::reset_conditions(), and Mers::Models::CCA::Io::Mof::MOFReader::writeConstraint().

Here is the call graph for this function:

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

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

Here is the call graph for this function:

int BaseModelAssignmentArray::pushBack | ( | BaseModelAssignment * | 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 BaseModelAssignmentArray.cpp.

Referenced by Mers::Solvers::SAT::ValidSAT::VSATNode::addConstraint(), Mers::Solvers::SAT::ISAT::ISATTester::addDomainConstraints(), Mers::Solvers::SAT::ValidSAT::VSATNode::adjustValidAssignment(), TestSuiteParser::constraint(), Mers::Estimation::Discrete::ModeEstimation::ModeEstimator::extractTransitionsFromCCA(), Mers::Generators::BFIG::BFIGGenerator::generateBestImplicant(), Mers::Estimation::Discrete::ModeEstimation::ModeEstimator::generateTrajectories(), Mers::Estimation::Discrete::ApproximateBeliefState::BFBSE::BFBSE::generateTrajectories(), Mers::Models::CCA::CCAClause::insert_assignment(), Mers::Models::CCA::CCAAssignments::insert_assignment(), Mers::Solvers::SAT::ISAT::ISATTester::ISATTester(), tut::BMHelper::loadClause(), Mers::Solvers::SAT::ValidSAT::VSATNode::propagate(), Mers::Estimation::Discrete::read_trajectory(), Mers::Solvers::Entailment::GI::GoalInterpreter::updateGoal(), Mers::Solvers::SAT::ValidSAT::VSATNode::VSATNode(), and Mers::Solvers::SAT::ValidSAT::VSATVariable::VSATVariable().

BaseModelAssignment * BaseModelAssignmentArray::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 BaseModelAssignmentArray.cpp.

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

BaseModelAssignment *& BaseModelAssignmentArray::peekBack | ( |  | ) |

Returns a handle to the last element of the array.

Returns:
  the last element, as requested, or NULL.

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

Definition at line 75 of file BaseModelAssignmentArray.cpp.

BaseModelAssignment const *& BaseModelAssignmentArray::peekBack | ( |  | ) | const

Returns a handle to the last element of the array.

Returns:
  the last element, as requested, or NULL.

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

Definition at line 82 of file BaseModelAssignmentArray.cpp.

BaseModelObject * BaseModelAssignmentArray::duplicate | ( |  | ) | const`[virtual]`

Returns a copy of this object if the object can be copied or NULL if the object cannot be copied.

Returns:
  a pointer to a copy of this object or NULL if it can't be copied

Reimplemented from Mers::Utils::Lang::BaseModelObject.

Reimplemented in Mers::Models::Base::BaseModelClause.

Definition at line 89 of file BaseModelAssignmentArray.cpp.

References BaseModelAssignmentArray().

Here is the call graph for this function:

BaseModelAssignment *& BaseModelAssignmentArray::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 96 of file BaseModelAssignmentArray.cpp.

BaseModelAssignment *& BaseModelAssignmentArray::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 103 of file BaseModelAssignmentArray.cpp.

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

BaseModelAssignment const *& BaseModelAssignmentArray::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 119 of file BaseModelAssignmentArray.cpp.

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

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 225 of file BaseModelAssignmentArray.h.

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

Referenced by operator!=().

Here is the call graph for this function:

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

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 238 of file BaseModelAssignmentArray.h.

References operator==().

Here is the call graph for this function:

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

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

Reimplemented in Mers::Models::Base::BaseModelClause.

Definition at line 135 of file BaseModelAssignmentArray.cpp.

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

BaseModelAssignmentArray const & BaseModelAssignmentArray::operator+= | ( | BaseModelAssignment const & | data | ) | `[virtual]`

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 143 of file BaseModelAssignmentArray.cpp.

void BaseModelAssignmentArray::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 152 of file BaseModelAssignmentArray.cpp.

void BaseModelAssignmentArray::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 (BaseModelAssignment).

Parameters:

  | element | the BaesModelAssignment to delete

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

Definition at line 161 of file BaseModelAssignmentArray.cpp.

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

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

Parameters:

  | element | the element being copied

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

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

Definition at line 168 of file BaseModelAssignmentArray.cpp.

Referenced by Mers::Models::CCA::CCAClause::insert_assignment(), and Mers::Models::CCA::CCAAssignments::insert_assignment().

bool BaseModelAssignmentArray::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 175 of file BaseModelAssignmentArray.cpp.

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

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