The Gnome Chemistry Utils  0.14.0
Public Member Functions | Static Public Member Functions | List of all members
gcp::Residue Class Reference

a GChemPaint specific Residue class. More...

#include <gcp/residue.h>

Inheritance diagram for gcp::Residue:
gcu::Residue

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, gcu::Application *app)
bool operator== (gcu::Molecule const &mol) const
void Register ()
void Ref ()
void Unref ()
bool GetReadOnly (void) const
xmlNodePtr GetNode (void) const
xmlNodePtr GetMolNode (void) const
unsigned GetRefs (void) const
- Public Member Functions inherited from gcu::Residue
 Residue (char const *name, Document *doc=NULL)
std::map< int, int > const & GetRawFormula () const
std::map< std::string, bool >
const & 
GetSymbols () const
std::map< std::string,
std::string > const & 
GetNames () const
void SetName (char const *name)
void AddSymbol (char const *symbol)
void RemoveSymbol (char const *symbol)
virtual void Load (xmlNodePtr node, Application *app)
virtual bool operator== (G_GNUC_UNUSED Molecule const &mol) const
char const * GetName (void) const
void SetGeneric (bool val)
bool GetGeneric (void) const
bool & GetRefGeneric (void)
DocumentGetDocument (void)
MoleculeGetMolecule (void)
DocumentGetOwner (void) const

Static Public Member Functions

static void SetPostAddCallback (void(*cb)(Residue *res))
- Static Public Member Functions inherited from gcu::Residue
static Residue const * GetResidue (char const *symbol, bool *ambiguous=NULL)
static Residue const * GetResiduebyName (char const *name)
static std::string const * GetFirstResidueSymbol (ResidueIterator &i)
static std::string const * GetNextResidueSymbol (ResidueIterator &i)

Additional Inherited Members

- Static Public Attributes inherited from gcu::Residue
static unsigned MaxSymbolLength

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
namethe 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
namethe name of the new residue.
symbolthe symbol of the new residue.
molthe molecule represented by the residue.
docthe 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

gcp::Residue::GetMolNode ( void  ) const
inline
Returns
the XML node representing the molecule associated to the residue.

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

gcp::Residue::GetNode ( void  ) const
inline
Returns
the XML node representing the residue.

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

gcp::Residue::GetReadOnly ( void  ) const
inline
Returns
true if the residue is read-only or false if it can be modified.

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

gcp::Residue::GetRefs ( void  ) const
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 128 of file gcp/residue.h.

void gcp::Residue::Load ( xmlNodePtr  node,
bool  ro,
gcu::Application app 
)
Parameters
nodean XML node.
rowhether the residue is read-only or not.
appthe used application.

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

bool gcp::Residue::operator== ( gcu::Molecule const &  mol) const
Parameters
molthe molecule to compare to the residue.
Returns
true if mol is identical to the group represented by this residue, including the pseudo atom.
void gcp::Residue::Ref ( )

Increments the references number by one unit.

void gcp::Residue::Register ( )

Registers the residue in the database.

static void gcp::Residue::SetPostAddCallback ( void(*)(Residue *res)  cb)
inlinestatic
Parameters
cba 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 107 of file gcp/residue.h.

void gcp::Residue::Unref ( )

Decreases the references number by one unit.


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