# gcp::Mesomer Class Reference

`#include <gcp/mesomer.h>`

Inheritance diagram for gcp::Mesomer:

List of all members.

## Public Member Functions

| Mesomer ()
virtual | ~Mesomer ()
| Mesomer (Mesomery *mesomery, Molecule *molecule) throw (std::invalid_argument)
bool | Load (xmlNodePtr node)
bool | OnSignal (gcu::SignalId Signal, gcu::Object *Child)
double | GetYAlign ()
void | AddArrow (MesomeryArrow *arrow, Mesomer *mesomer) throw (std::invalid_argument)
void | RemoveArrow (MesomeryArrow *arrow, Mesomer *mesomer)
bool | Validate ()
std::map< Mesomer *, MesomeryArrow * > * | GetArrows ()
Molecule * | GetMolecule ()

## Detailed Description

Represents one esomeric form in a mesomery relationship.

Definition at line 43 of file mesomer.h.

## Constructor & Destructor Documentation

gcp::Mesomer::Mesomer | ( |  | ) |

The default constructor.

virtual gcp::Mesomer::~Mesomer | ( |  | ) | `[virtual]`

The destructor.

gcp::Mesomer::Mesomer | ( | Mesomery * | mesomery,
|  | Molecule * | molecule |
| ) |  |  | throw (std::invalid_argument)

Parameters:

  | mesomery | the parent Mesomery.
  | molecule | the molecule of the mesomeric form.

Constructs a Mesomer from its parent Mesomery and a molecule. If one of them is invalid, it throws an std::invalid_argument exception and should be destroyed since it is invalid.

## Member Function Documentation

bool gcp::Mesomer::Load | ( | xmlNodePtr | node | ) | `[virtual]`

Parameters:

  | node | a pointer to the xmlNode containing the serialized object.

Used to load a mesomer in memory. The mesomer must already exist.

Returns:
  true on succes, false otherwise.

Reimplemented from gcu::Object.

bool gcp::Mesomer::OnSignal | ( | gcu::SignalId | Signal,
|  | gcu::Object * | Child |
| ) |  |  | `[virtual]`

Parameters:

  | Signal | the appropriate SignalId
  | Child | the child which emitted the signal or NULL

This function is called by the framework when a signal has been emitted for the mesomer. It should not be called by a program; call Object::EmitSignal instead.

Returns:
  true if the signal should be propagated to the parent, false otherwise.

Reimplemented from gcu::Object.

double gcp::Mesomer::GetYAlign | ( |  | ) | `[virtual]`

Used to retrieve the y coordinate for alignment. Calls gcp::Molecule::GetYAlign for the embedded molecule and returns the result.

Returns:
  y coordinate used for alignment.

Reimplemented from gcu::Object.

void gcp::Mesomer::AddArrow | ( | MesomeryArrow * | arrow,
|  | Mesomer * | mesomer |
| ) |  |  | throw (std::invalid_argument)

Parameters:

  | arrow | a mesomery arrow
  | mesomer | the mesomer at the other end of the arrow.

Adds the arrow to the arrows map. See Mesomer::GetArrows().

void gcp::Mesomer::RemoveArrow | ( | MesomeryArrow * | arrow,
|  | Mesomer * | mesomer |
| ) |  |  |

Parameters:

  | arrow | a mesomery arrow
  | mesomer | the mesomer at the other end of the arrow.

Removes the arrow from the arrows map. See Mesomer::GetArrows().

bool gcp::Mesomer::Validate | ( |  | ) | `[inline]`

Returns:
  true if the mesomer is associated with at least one mesomery arrow, false otherwise. See gp::Mesomery::Validtae() for more information.

Definition at line 105 of file mesomer.h.

std::map<Mesomer *, MesomeryArrow *>* gcp::Mesomer::GetArrows | ( |  | ) | `[inline]`

Returns:
  the map of all arrows pointing to this mesomer indexed by the mesomer at the other end of the arrow.

Definition at line 110 of file mesomer.h.

Molecule* gcp::Mesomer::GetMolecule | ( | void |  | ) | `[inline]`

Returns:
  th molecule associated with this mesomer.

Definition at line 114 of file mesomer.h.

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

- mesomer.h