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

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

# Mers::Models::CCA::CCAAutomata Class Reference

`#include <CCAAutomata.h>`

Inheritance diagram for Mers::Models::CCA::CCAAutomata:

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

[legend]
List of all members.

## Public Types
typedef unsigned int | sizeType
typedef CCAAutomaton * | pointer
typedef const CCAAutomaton * | const_pointer
typedef CCAAutomata | 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
| CCAAutomata (bool myOwnershipStatus)
| CCAAutomata (const CCAAutomata &other)
| ~CCAAutomata ()
bool | empty () const
void | clear ()
Iterator | begin ()
ConstantIterator | begin () const
Iterator | end ()
ConstantIterator | end () const
bool | set_model_p (const CCAModel &myModel)
const CCAModel * | model_p () const
const_iterator | insert_automaton (const CCAAutomaton &new_automaton)
const CCAAutomaton * | automaton_p (const CCAVariable &_variable) const
const CCAAutomaton * | automaton_p (unsigned int variableUID) const
bool | set_state_type (const CCAAssignment &_assignment, const CCAState::StateType state_type)
bool | set_state_constraint (const CCAAssignment &_assignment, const CCASentence &_constraint)
CCATransitions::const_iterator | insert_transition (const CCAAutomaton &_automaton, const CCATransition &_transition)
int | pushBack (CCAAutomaton *data)
CCAAutomaton * | popBack ()
void | print (std::ostream &out) const
bool | operator== (const CCAAutomata &other) const
bool | operator!= (const CCAAutomata &other) const
CCAAutomaton *& | operator[] (int elementIndex)
CCAAutomaton *& | operator[] (unsigned int elementIndex)
CCAAutomaton const *& | operator[] (int elementIndex) const
CCAAutomaton const *& | operator[] (unsigned int elementIndex) const
CCAAutomata const & | operator= (CCAAutomata const &other)
CCAAutomata const & | operator+= (CCAAutomata const &other)
CCAAutomata const & | operator+= (CCAAutomaton 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 CCAAutomaton objects.

Author:
  Seung H. Chung

Todo:
  Currently implements vector. This should be changed to a hash table.

Definition at line 38 of file CCAAutomata.h.

## Constructor & Destructor Documentation

CCAAutomata::CCAAutomata | ( | bool | myOwnershipStatus | ) |

Creates a new, empty array of CCA automata

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 CCAAutomata.cpp.

## Member Function Documentation

Iterator Mers::Models::CCA::CCAAutomata::begin | ( |  | ) | `[inline]`

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

Returns:
  a iterator that starts this object

Reimplemented from Mers::Utils::Containers::ObjectArray.

Definition at line 82 of file CCAAutomata.h.

Referenced by automaton_p(), Mers::Models::CCA::CCAModel::get_all_constraints(), insert_transition(), Mers::Models::CCA::Io::Mof::MOFReader::loadMOFFromString(), rpCCAutomata::rpCCAutomata(), Mers::Models::CCA::Io::Mof::MOFReader::saveCCAModel(), set_state_constraint(), and set_state_type().

ConstantIterator Mers::Models::CCA::CCAAutomata::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 from Mers::Utils::Containers::ObjectArray.

Definition at line 92 of file CCAAutomata.h.

Iterator Mers::Models::CCA::CCAAutomata::end | ( |  | ) | `[inline]`

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

Returns:
  a iterator that ends this object

Reimplemented from Mers::Utils::Containers::ObjectArray.

Definition at line 103 of file CCAAutomata.h.

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

Referenced by Mers::Models::CCA::CCAModel::addAutomaton(), automaton_p(), Mers::Models::CCA::CCAModel::get_all_constraints(), insert_automaton(), insert_transition(), Mers::Models::CCA::Io::Mof::MOFReader::loadMOFFromString(), Mers::Models::CCA::Io::Mof::MOFReader::saveCCAModel(), set_state_constraint(), and set_state_type().

Here is the call graph for this function:

ConstantIterator Mers::Models::CCA::CCAAutomata::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 from Mers::Utils::Containers::ObjectArray.

Definition at line 113 of file CCAAutomata.h.

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

Here is the call graph for this function:

int CCAAutomata::pushBack | ( | CCAAutomaton * | 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 172 of file CCAAutomata.cpp.

References Mers::Utils::Containers::DynamicArray::getLength(), Mers::Models::CCA::CCAAutomaton::set_ccAutomata_p(), and Mers::Models::CCA::CCAAutomaton::setUID().

Referenced by insert_automaton().

Here is the call graph for this function:

CCAAutomaton * CCAAutomata::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::ObjectArray.

Definition at line 181 of file CCAAutomata.cpp.

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

Prints out the CCA Automata

Parameters:

  | out | the ostream being written to

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

Definition at line 190 of file CCAAutomata.cpp.

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

Here is the call graph for this function:

CCAAutomaton *& CCAAutomata::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::ObjectArray.

Definition at line 215 of file CCAAutomata.cpp.

Referenced by insert_automaton().

CCAAutomaton *& CCAAutomata::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::ObjectArray.

Definition at line 222 of file CCAAutomata.cpp.

CCAAutomaton const *& CCAAutomata::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::ObjectArray.

Definition at line 229 of file CCAAutomata.cpp.

CCAAutomaton const *& CCAAutomata::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::ObjectArray.

Definition at line 236 of file CCAAutomata.cpp.

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

References _model_p.

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

CCAAutomata const & CCAAutomata::operator+= | ( | CCAAutomaton 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 260 of file CCAAutomata.cpp.

void * CCAAutomata::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::Utils::Containers::ObjectArray.

Definition at line 270 of file CCAAutomata.cpp.

Referenced by insert_automaton().

bool CCAAutomata::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::ObjectArray.

Definition at line 277 of file CCAAutomata.cpp.

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

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