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

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

# Mers::Models::Base::BaseModelClause Class Reference

`#include <BaseModelClause.h>`

Inheritance diagram for Mers::Models::Base::BaseModelClause:

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

[legend]
List of all members.

## Public Types
enum | ClauseType { CONJUNCTIVE, DISJUNCTIVE }
| Clauses are either conjunctive or disjunctive.
## Public Member Functions
| BaseModelClause (ClauseType myType, bool myOwnershipStatus)
| BaseModelClause (BaseModelClause const &other)
virtual | ~BaseModelClause ()
void | setClauseType (ClauseType newType)
ClauseType | getClauseType () const
virtual BaseModelObject * | duplicate () const
BaseModelClause const & | operator= (BaseModelClause const &other)
BaseModelClause const & | operator+= (BaseModelClause const &other)
BaseModelClause const & | operator+= (BaseModelAssignmentArray const &other)
bool | operator== (BaseModelClause const &other) const
bool | operator!= (BaseModelClause const &other) const
void | print (std::ostream &out) const
## Static Public Member Functions
static char const * | clauseTypeToString (ClauseType clauseType)
## Protected Member Functions
virtual int | copy (BaseModelClause const &clause)
## Protected Attributes
ClauseType | clauseType
| The type of clause (Disjunctive or Conjunctive).

## Detailed Description

A BaseModelAssignmentArray of BaseModelAssignment. Describes a logical clause.

Author:
  Paul H. Elliott

Definition at line 33 of file BaseModelClause.h.

## Constructor & Destructor Documentation

BaseModelClause::BaseModelClause | ( | ClauseType | myType,
|  | bool | myOwnershipStatus |
| ) |  |  |

Creates a new, empty clause

Parameters:

  | myType | the clause type of this clause (Disjunctive or Conjunctive)
  | myOwnershipStatus | the ownership status. If true, this object owns the array objects it contains and should delete them upon being deleted.

Definition at line 28 of file BaseModelClause.cpp.

References clauseType.

Referenced by duplicate().

BaseModelClause::BaseModelClause | ( | BaseModelClause const & | other | ) |

Creates a new Clause with a copy of the contents from the other Clause This can be an expensive operation.

Parameters:

  | other | the Clause being copied

Definition at line 37 of file BaseModelClause.cpp.

References clauseType.

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

Destroys the Clause

Definition at line 45 of file BaseModelClause.cpp.

## Member Function Documentation

char const * BaseModelClause::clauseTypeToString | ( | ClauseType | clauseType | ) | `[static]`

Returns the string representation of the clauseType

Parameters:

  | clauseType | the clause type being sought Returns the string equivalent of clauseType

Definition at line 52 of file BaseModelClause.cpp.

Referenced by operator+=().

void BaseModelClause::setClauseType | ( | ClauseType | newType | ) |

Sets the clause type to either Disjunctive or Conjunctive

Parameters:

  | newType | the new type of this clause

Definition at line 66 of file BaseModelClause.cpp.

References clauseType.

Referenced by Mers::Models::CCA::CCATransition::CCATransition().

BaseModelClause::ClauseType BaseModelClause::getClauseType | ( |  | ) | const

Returns the clause's type

Returns:
  the ClauseType of this object

Definition at line 73 of file BaseModelClause.cpp.

References clauseType.

Referenced by Mers::Solvers::SAT::ValidSAT::VSATNode::addConstraint(), Mers::Models::CCA::Io::Mof::MOFReader::readConstraint(), Mers::Models::CCA::Io::Mof::MOFReader::writeConstraint(), and Mers::Models::CCA::Io::Mof::MOFReader::writeTextConstraint().

BaseModelObject * BaseModelClause::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::Models::Base::BaseModelAssignmentArray.

Definition at line 80 of file BaseModelClause.cpp.

References BaseModelClause().

Here is the call graph for this function:

BaseModelClause const & BaseModelClause::operator= | ( | BaseModelClause const & | other | ) |

copies the data from the other clause to this clause. This can be expensive for long clauses. The origional data in this clause is destroyed.

Parameters:

  | other | the clause supplying the data for this clause

Returns:
  the other clause

Definition at line 87 of file BaseModelClause.cpp.

References copy().

Here is the call graph for this function:

BaseModelClause const & BaseModelClause::operator+= | ( | BaseModelClause const & | other | ) |

appends a copy of the data from the other clause to this clause. This can be expensive for long clauses.

Parameters:

  | other | the clause supplying the data for this clause

Returns:
  this clause

Definition at line 95 of file BaseModelClause.cpp.

References clauseType, clauseTypeToString(), and Mers::Models::Base::BaseModelAssignmentArray::operator+=().

Here is the call graph for this function:

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

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 from Mers::Models::Base::BaseModelAssignmentArray.

Definition at line 123 of file BaseModelClause.h.

References Mers::Models::Base::BaseModelAssignmentArray::operator+=().

Here is the call graph for this function:

bool BaseModelClause::operator== | ( | BaseModelClause const & | other | ) | const

Returns true if the two clauses have all the same assignments in the same order and the same type

Parameters:

  | other | the clause being compared to this clause

Returns:
  true if the two clauses have the same assignments in the same order

Definition at line 107 of file BaseModelClause.cpp.

References clauseType.

Referenced by operator!=().

bool BaseModelClause::operator!= | ( | BaseModelClause const & | other | ) | const

Returns false if the two clauses have all the same assignments in the same order

Parameters:

  | other | the clause being compared to this clause

Returns:
  false if the two clauses have the same assignments in the same order

Definition at line 116 of file BaseModelClause.cpp.

References operator==().

Here is the call graph for this function:

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

prints the contents of this clause to the ostream out Derived classes should overide this function to change printing behavior

Parameters:

  | out | all the data from this object is printed to this ostream object

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

Definition at line 125 of file BaseModelClause.cpp.

References clauseType, Mers::Utils::Containers::DynamicArray::getLength(), and Mers::Utils::Containers::DynamicArray::printArray().

Referenced by Mers::Solvers::Entailment::GI::GoalInterpreter::print().

Here is the call graph for this function:

int BaseModelClause::copy | ( | BaseModelClause const & | clause | ) | `[protected, virtual]`

copies the contents of the other clause to this clause. This destroys the contents of this clause and copies each element in the other clause.

Parameters:

  | clause | the clause being copied to this clause

Returns:
  0 on success or a positive number if the copy failed

Definition at line 154 of file BaseModelClause.cpp.

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

Referenced by operator=().

Here is the call graph for this function:

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

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