# gcp::Residue Class Reference

a GChemPaint specific Residue class. More...

`#include <gcp/residue.h>`

Inheritance diagram for gcp::Residue:

List of all members.

## Public Member Functions

| Residue ()
| Residue (char const *name)
| Residue (char const *name, char const *symbol, Molecule *mol, Document *doc)
virtual | ~Residue ()
void | Load (xmlNodePtr node, bool ro)
bool | operator== (gcu::Molecule const &mol) const
void | Register ()
void | Ref ()
void | Unref ()
bool | GetReadOnly (void)
xmlNodePtr | GetNode (void)
xmlNodePtr | GetMolNode (void)
unsigned | GetRefs (void)

## Static Public Member Functions

static void | SetPostAddCallback (void(*cb)(Residue *res))

## Detailed Description

a GChemPaint specific Residue class.

This class adds some GChemPaint specific features to gcu::Residue.

Definition at line 44 of file gcp/residue.h.

## Constructor & Destructor Documentation

gcp::Residue::Residue | ( |  | ) |

The default constructor.

Reimplemented from gcu::Residue.

gcp::Residue::Residue | ( | char const * | name | ) |

Parameters:

  | name | the name of the new residue.

Constructs a new residue with the given name.

gcp::Residue::Residue | ( | char const * | name,
|  | char const * | symbol,
|  | Molecule * | mol,
|  | Document * | doc |
| ) |  |  |

Parameters:

  | name | the name of the new residue.
  | symbol | the symbol of the new residue.
  | mol | the molecule represented by the residue.
  | doc | the document owning the residue when it does not have global scope.

Constructs a new residue using the given arguments.

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

The destructor.

Reimplemented from gcu::Residue.

## Member Function Documentation

void gcp::Residue::Load | ( | xmlNodePtr | node,
|  | bool | ro |
| ) |  |  |

Parameters:

  | node | an XML node.
  | ro | whether the residue is read-only or not.

Loads data GChemPaint specific data from node, and calls gcu::Residue::Load().

bool gcp::Residue::operator== | ( | gcu::Molecule const & | mol | ) | const`[virtual]`

Parameters:

  | mol | the molecule to compare to the residue.

Returns:
  true if mol is identical to the group represented by this residue, including the pseudo atom.

Reimplemented from gcu::Residue.

void gcp::Residue::Register | ( |  | ) |

Registers the residue in the database.

void gcp::Residue::Ref | ( |  | ) |

Increments the references number by one unit.

void gcp::Residue::Unref | ( |  | ) |

Decreases the references number by one unit.

static void gcp::Residue::SetPostAddCallback | ( | void(*)(Residue *res) | cb | ) | `[inline, static]`

Parameters:

  | cb | a callback to call when a new residue is registered.

When a new residue is registered in the database, it might be necessary to execute some extra code, hence this static method. Only one callback can be registered in this version.

Definition at line 106 of file gcp/residue.h.

gcp::Residue::GetReadOnly | ( | void |  | ) | `[inline]`

Returns:
  true if the residue is read-only or false if it can be modified.

Definition at line 114 of file gcp/residue.h.

gcp::Residue::GetNode | ( | void |  | ) | `[inline]`

Returns:
  the XML node representing the residue.

Definition at line 118 of file gcp/residue.h.

gcp::Residue::GetMolNode | ( | void |  | ) | `[inline]`

Returns:
  the XML node representing the molecule associated to the residue.

Definition at line 122 of file gcp/residue.h.

gcp::Residue::GetRefs | ( | void |  | ) | `[inline]`

Returns:
  the number of uses of the residue in currently opened documents. This is used to prevent deleting an used writeable residue.

Definition at line 127 of file gcp/residue.h.

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

- gcp/residue.h