Ignore:
Timestamp:
Oct 27, 2009, 5:16:31 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
6d7651
Parents:
a9b2a0a
git-author:
Frederik Heber <heber@…> (10/27/09 16:42:42)
git-committer:
Frederik Heber <heber@…> (10/27/09 17:16:31)
Message:

class config, ConfigFileBuffer, periodentafel and Vector are refactored with respect to ticket #38, #4 and #39.

  • <type> * const ptr ... means the pointer itself is const (not its contents that he points at).
  • const <type> * ptr ... means the pointer's content is const.
  • "ofstream *out" ... can be changed to "ofstream * const out" (pointer is constant, not output).

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/bond.cpp

    ra9b2a0a r069034  
    2525 * \param number increasing index
    2626 */
    27 bond::bond(atom *left, atom *right, int degree, int number) : leftatom(left), rightatom(right), previous(NULL), next(NULL), HydrogenBond(0), BondDegree(degree), nr(number), Cyclic(false), Type(Undetermined), Used(white)
     27bond::bond(atom *left, atom *right, const int degree, const int number) : leftatom(left), rightatom(right), previous(NULL), next(NULL), HydrogenBond(0), BondDegree(degree), nr(number), Cyclic(false), Type(Undetermined), Used(white)
    2828{
    2929  if ((left != NULL) && (right != NULL)) {
     
    4747};
    4848
    49 ostream & operator << (ostream &ost, const bond &b) 
     49ostream & operator << (ostream &ost, const bond &b)
    5050{
    5151  ost << "[" << b.leftatom->Name << " <" << b.BondDegree << "(H" << b.HydrogenBond << ")>" << b.rightatom->Name << "]";
     
    5757 * \return pointer to the other atom in the bond, NULL if no match (indicates something's wrong with the bond)
    5858 */
    59 atom * bond::GetOtherAtom(const ParticleInfo *Atom) const
     59atom * bond::GetOtherAtom(const ParticleInfo * const Atom) const
    6060{
    6161  if(leftatom == Atom)
     
    8080 * \return true if it is either bond::leftatom or bond::rightatom, false otherwise
    8181 */
    82 bool bond::Contains(const ParticleInfo *ptr)
     82bool bond::Contains(const ParticleInfo * const ptr)
    8383{
    8484  return ((leftatom == ptr) || (rightatom == ptr));
     
    9797 * \return bond::Used, false if bond was already marked used
    9898 */
    99 bool bond::MarkUsed(enum Shading color) {
     99bool bond::MarkUsed(const enum Shading color) {
    100100  if (Used == black) {
    101101    cerr << "ERROR: Bond " << this << " was already marked black!." << endl;
Note: See TracChangeset for help on using the changeset viewer.