Bond Class Reference

#include <bond.h>

List of all members.

Public Member Functions

Bond construction functions
 Bond ()
 Bond (Atom *aSource, Atom *aTarget, int aLabel, int aPerretLabel=NAVALUE, int aBondStereo=0, int aBondNotUsed=0, int aBondTopology=0, int aBondReactionCenter=0)
 ~Bond ()
Accessor functions
AtomgetTarget () throw ( CError )
bool hasTarget ()
AtomgetSource () throw ( CError )
bool hasSource ()
int getLabel ()
int getPerretLabel ()
void setPerretLabel ()
void setKashimaPT (double aPt)
double getKashimaPT ()
bool hasFlag ()
void setFlag ()
void unsetFlag ()
bool hasFlagOriginal ()
void setFlagOriginal ()
void unsetFlagOriginal ()
void addRing (Ring *aRing)
bool hasRing (Ring *aRing)
bool hasRing ()
int numRings ()
void setStereo (int a)
int getStereo ()
void setTopology (int a)
int getTopology ()
void setReactionCenter (int a)
int getReactionCenter ()
void setNotUsed (int a)
int getNotUsed ()
Bond manipulation functions
void reverse ()
BondgetReverse () throw ( CError )
void hideToFrom ()
void restoreToFrom ()
Output functions
string toString ()
string toStringShort ()
void describe ()
void describeShort ()
Iterators
vector< Ring * >::iterator beginRing ()
vector< Ring * >::iterator endRing ()

Private Attributes

Atomsource
Atomtarget
int label
int perretLabel
int stereo
int notUsed
int topology
int reactionCenter
double pt
bool flag
bool flagOriginal
vector< Ring * > rings


Detailed Description

Bond class
Author:
Dr Jean-Luc Perret (luc@kuicr.kyoto-u.ac.jp), Kyoto University, Japan
Version:
0.3
Date:
17 Jan 2004
CLASS NAME: Bond

FOR: SNSF SPONSORED PROJECT

PURPOSE:

this class implements the notion of bond between two atoms A bond is directed: it has a source atom and a target atom, so a chemical bond should be represented by two instances of class Bond, one for each direction.

A bond as implemented here contains a source and a target atom, a label describing the bond type (see constants.h). Since bond is a daughter of DataContainer other Descriptors may be added at runtime.

A bond is derived from DataContainer, so it has all the associated descriptors, but in addition bonds inplement an atomDescriptors map allowing to store atoms as descriptors to the bond. (in addition to source ant target atom).

For faster access, some descriptors are directly implemented in the class bond using native data type (double and int). This is the case for pt and label.

Examples:

bond_example.cpp.


Constructor & Destructor Documentation

Bond::Bond  ) 
 

class constructor.

Bond::Bond Atom aSource,
Atom aTarget,
int  aLabel,
int  aPerretLabel = NAVALUE,
int  aBondStereo = 0,
int  aBondNotUsed = 0,
int  aBondTopology = 0,
int  aBondReactionCenter = 0
 

class constructor.

Bond::~Bond  ) 
 

class destructor.


Member Function Documentation

void Bond::addRing Ring aRing  )  [inline]
 

adds a ring to the set of rings the bond is member of.

vector<Ring*>::iterator Bond::beginRing  )  [inline]
 

iterator on the first element of the set of rings the bond is member of.

void Bond::describe  ) 
 

writes a string description of the bond to cout.

Examples:
bond_example.cpp.

void Bond::describeShort  ) 
 

writes a short string description of the bond to cout.

vector<Ring*>::iterator Bond::endRing  )  [inline]
 

iterator on the last element of the set of rings the bond is member of.

double Bond::getKashimaPT  )  [inline]
 

returns the transition probability used in the Kashima kernel.

int Bond::getLabel  )  [inline]
 

returns the bond label.

int Bond::getNotUsed  )  [inline]
 

returns the 'not used' value.

int Bond::getPerretLabel  )  [inline]
 

returns the value of the Perret label (set by setPerretLabel, called everytime a molecule is modified).

int Bond::getReactionCenter  )  [inline]
 

returns the reaction center value.

Bond* Bond::getReverse  )  throw ( CError )
 

since bonds are represented directional, returns the reciprocal bond.

Atom* Bond::getSource  )  throw ( CError )
 

returns a pointer to the source atom.

int Bond::getStereo  )  [inline]
 

returns the stereo value.

Atom* Bond::getTarget  )  throw ( CError )
 

returns a pointer to the target atom.

int Bond::getTopology  )  [inline]
 

returns the topology value.

bool Bond::hasFlag  )  [inline]
 

returns true if the bond has been marked with setFlag(). flag can be removed with unsetFlag().

bool Bond::hasFlagOriginal  )  [inline]
 

returns true if the bond has been marked with setFlagOriginal(). flag can be removed with unsetFlagOriginal().

bool Bond::hasRing  )  [inline]
 

returns true if the bond is member of any ring.

bool Bond::hasRing Ring aRing  ) 
 

returns true if the bond is member of the given ring.

bool Bond::hasSource  )  [inline]
 

returns true if source atom is set.

bool Bond::hasTarget  )  [inline]
 

returns true if target atom is set.

void Bond::hideToFrom  ) 
 

NO DOCUMENTATION

int Bond::numRings  )  [inline]
 

returns the number of rings the bond is member of.

void Bond::restoreToFrom  ) 
 

NO DOCUMENTATION

void Bond::reverse  ) 
 

reverses the bond direction.

void Bond::setFlag  )  [inline]
 

sets 'flag' to true

void Bond::setFlagOriginal  )  [inline]
 

sets 'flagOriginal' to true

void Bond::setKashimaPT double  aPt  )  [inline]
 

sets the transition probability used in the Kashima kernel. note that for performance reasons this function does not use the descriptors of DataContainer to store its values but rather uses a native double variable in the bond class.

void Bond::setNotUsed int  a  )  [inline]
 

sets the 'not used' value.

void Bond::setPerretLabel  ) 
 

sets the Perret label of the bond.

void Bond::setReactionCenter int  a  )  [inline]
 

sets the reaction center value.

void Bond::setStereo int  a  )  [inline]
 

sets the stereo value.

void Bond::setTopology int  a  )  [inline]
 

sets the topology value.

string Bond::toString  ) 
 

returns a string description of the bond ( = string description of source and target atoms and bond label).

string Bond::toStringShort  ) 
 

returns a short string description of the bond ( = short string description of source and target atoms and bond label).

void Bond::unsetFlag  )  [inline]
 

sets 'flag' to false

void Bond::unsetFlagOriginal  )  [inline]
 

sets 'flagOriginal' to false


Member Data Documentation

bool Bond::flag [private]
 

flag which can be set using setFlag() and unset using unsetFlag().

bool Bond::flagOriginal [private]
 

flag which can be set using setFlagOriginal() and unset using unsetFlagOriginal(). this flag is set if the bond is present in the original molecule file (backward bonds don't).

int Bond::label [private]
 

Label of the bond. Possible values are defined in constants.h

int Bond::notUsed [private]
 

not used field (xxx in bond mol files).

int Bond::perretLabel [private]
 

Perret labeling.

double Bond::pt [private]
 

transition probability (used in Kashima Kernel).

int Bond::reactionCenter [private]
 

reaction center (ccc in mol files).

vector<Ring*> Bond::rings [private]
 

vector of rings the bond is member of.

Atom* Bond::source [private]
 

Source atom of this bond.

int Bond::stereo [private]
 

stereo information. one of: if single bond: STEREONOT, STEREOUP, STEREOEITHER, STERODOWN if double bond: STEROCISTRANSNOT, STEROCISTRANS

Atom* Bond::target [private]
 

Target atom of this bond.

int Bond::topology [private]
 

topology (rrr in bond mol files). DO NOT USE, just for storing informations contained in mol files.


The documentation for this class was generated from the following file:
Generated on Wed Nov 28 12:12:51 2007 for ChemCpp by  doxygen 1.4.6