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

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

# Mers::Models::CCA::CCASentence Class Reference

`#include <CCASentence.h>`

Inheritance diagram for Mers::Models::CCA::CCASentence:

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

[legend]
List of all members.

## Public Types
typedef CCAClause * | pointer
typedef const CCAClause * | const_pointer
typedef CCASentence | 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
| CCASentence (bool myOwnershipStatus, SentenceType const &type=CNF)
| CCASentence (CCASentence const &other)
| ~CCASentence ()
bool | empty () const
void | clear ()
Iterator | begin ()
ConstantIterator | begin () const
Iterator | end ()
ConstantIterator | end () const
const_iterator | insert_clause (const CCAClause &new_clause)
int | pushBack (CCAClause *data)
CCAClause * | popBack ()
bool | operator== (const CCASentence &other) const
bool | operator!= (const CCASentence &other) const
CCASentence const & | operator= (CCASentence const &other)
CCASentence const & | operator+= (CCASentence const &other)
CCASentence const & | operator+= (CCAClause const &data)
CCAClause *& | operator[] (int elementIndex)
CCAClause *& | operator[] (unsigned int elementIndex)
CCAClause const *& | operator[] (int elementIndex) const
CCAClause const *& | operator[] (unsigned int elementIndex) const
## Protected Member Functions
void * | newElement (void const *element) const

## Detailed Description

A CCASentence is a collection of Clauses which are either joined conjunctively (and - CNF) or disjunctively (or - DNF).

Author:
  Seung H. Chung

Definition at line 35 of file CCASentence.h.

## Constructor & Destructor Documentation

CCASentence::CCASentence | ( | bool | myOwnershipStatus,
|  | SentenceType const & | type = `CNF` |
| ) |  |  |

Creates a new, empty array of CCA clauses

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 27 of file CCASentence.cpp.

## Member Function Documentation

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

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

Returns:
  a iterator that starts this object

Reimplemented from Mers::Models::Base::BaseModelClauseArray.

Definition at line 74 of file CCASentence.h.

Referenced by insert_clause(), Mers::Models::CCA::CCAModel::is_valid(), and Mers::Models::CCA::Io::Mof::MOFReader::writeConstraint().

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

Definition at line 84 of file CCASentence.h.

Iterator Mers::Models::CCA::CCASentence::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::Models::Base::BaseModelClauseArray.

Definition at line 95 of file CCASentence.h.

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

Referenced by insert_clause(), Mers::Models::CCA::CCAModel::is_valid(), and Mers::Models::CCA::Io::Mof::MOFReader::writeConstraint().

Here is the call graph for this function:

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

Definition at line 105 of file CCASentence.h.

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

Here is the call graph for this function:

int CCASentence::pushBack | ( | CCAClause * | 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 75 of file CCASentence.cpp.

Referenced by insert_clause().

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

Definition at line 82 of file CCASentence.cpp.

CCASentence const & CCASentence::operator= | ( | CCASentence 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 CCASentence.cpp.

CCASentence const & CCASentence::operator+= | ( | CCASentence 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 CCASentence.cpp.

CCASentence const & CCASentence::operator+= | ( | CCAClause 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 121 of file CCASentence.cpp.

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

Definition at line 129 of file CCASentence.cpp.

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

Definition at line 136 of file CCASentence.cpp.

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

Definition at line 143 of file CCASentence.cpp.

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

Definition at line 150 of file CCASentence.cpp.

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

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

Parameters:

  | element | the element being copied.

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

Reimplemented from Mers::Models::Base::BaseModelClauseArray.

Definition at line 159 of file CCASentence.cpp.

Referenced by insert_clause().

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

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