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

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

# Mers::Models::CCA::CCAVariables Class Reference

`#include <CCAVariables.h>`

Inheritance diagram for Mers::Models::CCA::CCAVariables:

[legend]
Collaboration diagram for Mers::Models::CCA::CCAVariables:

[legend]
List of all members.

## Public Types
typedef unsigned int | sizeType
## Public Member Functions
| CCAVariables (bool myOwnershipStatus)
| CCAVariables (const CCAVariables &other)
| ~CCAVariables ()
bool | empty () const
void | clear ()
CCAVariable & | front ()
CCAVariable const & | front () const
CCAVariable & | back ()
CCAVariable const & | back () const
const_iterator | insert_variable (const CCAVariable &new_variable)
const CCAVariable * | variable_p (unsigned int variableUID) const
const CCAVariable * | variable_p (const Mers::Utils::Lang::String &variable_name) const
int | pushBack (CCAVariable *data)
CCAVariable * | popBack ()
void | print (std::ostream &out) const
bool | operator== (const CCAVariables &other) const
bool | operator!= (const CCAVariables &other) const
CCAVariable *& | operator[] (int elementIndex)
CCAVariable *& | operator[] (unsigned int elementIndex)
CCAVariable const *& | operator[] (int elementIndex) const
CCAVariable const *& | operator[] (unsigned int elementIndex) const
CCAVariables const & | operator= (CCAVariables const &other)
CCAVariables const & | operator+= (CCAVariables const &other)
CCAVariables const & | operator+= (CCAVariable const &data)
## Protected Member Functions
void * | newElement (void const *element) const
bool | isEqual (void const *element1, void const *element2) const

## Detailed Description

A collection of CCAVariable objects.

Author:
  Seung H. Chung

Definition at line 36 of file CCAVariables.h.

## Constructor & Destructor Documentation

CCAVariables::CCAVariables | ( | bool | myOwnershipStatus | ) |

Creates a new, empty array of CCA variables.

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 29 of file CCAVariables.cpp.

## Member Function Documentation

int CCAVariables::pushBack | ( | CCAVariable * | 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.

Reimplemented from Mers::Models::Base::BaseModelVariableArray.

Definition at line 115 of file CCAVariables.cpp.

Referenced by Mers::Solvers::Entailment::GI::GoalInterpreter::GoalInterpreter(), and insert_variable().

CCAVariable * CCAVariables::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::Models::Base::BaseModelVariableArray.

Definition at line 122 of file CCAVariables.cpp.

void CCAVariables::print | ( | std::ostream & | out | ) | const`[virtual]`

Prints out the CCA Variables.

Parameters:

  | out | the ostream being written to

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

Definition at line 131 of file CCAVariables.cpp.

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

Here is the call graph for this function:

CCAVariable *& CCAVariables::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::Models::Base::BaseModelVariableArray.

Definition at line 156 of file CCAVariables.cpp.

CCAVariable *& CCAVariables::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::Models::Base::BaseModelVariableArray.

Definition at line 163 of file CCAVariables.cpp.

CCAVariable const *& CCAVariables::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::Models::Base::BaseModelVariableArray.

Definition at line 170 of file CCAVariables.cpp.

CCAVariable const *& CCAVariables::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::Models::Base::BaseModelVariableArray.

Definition at line 177 of file CCAVariables.cpp.

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

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

const CCAVariables & CCAVariables::operator+= | ( | CCAVariable 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 from Mers::Models::Base::BaseModelVariableArray.

Definition at line 200 of file CCAVariables.cpp.

void * CCAVariables::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.

Reimplemented from Mers::Models::Base::BaseModelVariableArray.

Definition at line 210 of file CCAVariables.cpp.

Referenced by insert_variable().

bool CCAVariables::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::Models::Base::BaseModelVariableArray.

Definition at line 217 of file CCAVariables.cpp.

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

- /Users/fpy/titan-1-5-MBARI/Mers/Models/CCA/CCAVariables.h
- /Users/fpy/titan-1-5-MBARI/Mers/Models/CCA/CCAVariables.cpp