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

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

# Mers::Models::CCA::CCAStates Class Reference

`#include <CCAStates.h>`

Inheritance diagram for Mers::Models::CCA::CCAStates:

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

[legend]
List of all members.

## Public Types
typedef unsigned int | sizeType
typedef CCAState * | pointer
typedef const CCAState * | const_pointer
typedef CCAStates | 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
| CCAStates (bool myOwnershipStatus)
| CCAStates (const CCAStates &other)
| ~CCAStates ()
bool | empty () const
void | clear ()
Iterator | begin ()
ConstantIterator | begin () const
Iterator | end ()
ConstantIterator | end () const
bool | set_automaton_p (const CCAAutomaton &_automaton)
const_iterator | insert_state (const CCAState &new_state)
const CCAState * | state_p (const CCAValue &_value) const
bool | insert_in_transition (const CCAState &_state, CCATransition *_transition)
bool | insert_out_transition (const CCAState &_state, CCATransition *_transition)
bool | set_type (const CCAState &_state, const CCAState::StateType _type)
bool | set_constraint (const CCAState &_state, const CCASentence &_constraint)
int | pushBack (CCAState *data)
CCAState * | popBack ()
void | print (std::ostream &out) const
bool | operator== (const CCAStates &other) const
bool | operator!= (const CCAStates &other) const
CCAState *& | operator[] (int elementIndex)
CCAState *& | operator[] (unsigned int elementIndex)
CCAState const *& | operator[] (int elementIndex) const
CCAState const *& | operator[] (unsigned int elementIndex) const
CCAStates const & | operator= (CCAStates const &other)
CCAStates const & | operator+= (CCAStates const &other)
CCAStates const & | operator+= (CCAState 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 CCAState objects.

Author:
  Seung H. Chung

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

Definition at line 42 of file CCAStates.h.

## Constructor & Destructor Documentation

CCAStates::CCAStates | ( | bool | myOwnershipStatus | ) |

Creates a new, empty array of CCA states.

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 32 of file CCAStates.cpp.

## Member Function Documentation

Iterator Mers::Models::CCA::CCAStates::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 87 of file CCAStates.h.

Referenced by insert_in_transition(), insert_out_transition(), insert_state(), Mers::Models::CCA::Io::Mof::MOFReader::loadMOFFromString(), rpAutomaton::rpAutomaton(), set_automaton_p(), set_constraint(), set_type(), and state_p().

ConstantIterator Mers::Models::CCA::CCAStates::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 97 of file CCAStates.h.

Iterator Mers::Models::CCA::CCAStates::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 108 of file CCAStates.h.

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

Referenced by insert_in_transition(), insert_out_transition(), insert_state(), Mers::Models::CCA::Io::Mof::MOFReader::loadMOFFromString(), set_automaton_p(), set_constraint(), set_type(), and state_p().

Here is the call graph for this function:

ConstantIterator Mers::Models::CCA::CCAStates::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 118 of file CCAStates.h.

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

Here is the call graph for this function:

int CCAStates::pushBack | ( | CCAState * | 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 144 of file CCAStates.cpp.

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

Referenced by insert_state().

Here is the call graph for this function:

CCAState * CCAStates::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 152 of file CCAStates.cpp.

void CCAStates::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 161 of file CCAStates.cpp.

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

Here is the call graph for this function:

CCAState *& CCAStates::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 184 of file CCAStates.cpp.

CCAState *& CCAStates::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 191 of file CCAStates.cpp.

CCAState const *& CCAStates::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 198 of file CCAStates.cpp.

CCAState const *& CCAStates::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 205 of file CCAStates.cpp.

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

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

CCAStates const & CCAStates::operator+= | ( | CCAState 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 228 of file CCAStates.cpp.

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

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

Parameters:

  | element | the element being copied.

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

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

Definition at line 238 of file CCAStates.cpp.

Referenced by insert_state().

bool CCAStates::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 245 of file CCAStates.cpp.

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

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