Copyright © 1996 by the Regents of the University of California.
MolResId Class Reference
The MolResId class supports residue identifiers.
Residue identifiers are composed of chain identifier
(a Symbol),
a sequence number, and a single character insertion code.
MolResId Member Functions
-
MolResID()
-
Default constructor. The chain identifier is set to a single space,
the position is set to zero, and the insertion code is set to the space
character.
-
MolResId(int pos, char insert = ' ')
-
Constructor that defaults the chain identifier.
-
MolResId(Symbol chain, int pos, char insert = ' ')
-
Constructor where all parameters are specified.
-
MolResId(char chain, int pos, char insert = ' ')
-
Like the previous constructor with the chain identifier automatically
promoted to a Symbol.
-
Symbol chainId() const
-
Return the chain identifier.
If it is not part of a chain, then the space character is returned.
-
int position() const
-
Return the integral position.
-
char insertionCode() const
-
Return the insertion code.
If there is no insertion code, then the space character is returned.
-
int sameChain(const MolResId &rid) const
-
Return true if both sequence numbers are in the same chain.
-
const char *chars()
-
Return a string representation of the sequence number
(the chain identifier followed by the position followed by the insertion code).
-
int operator==(const MolResId &rid) const
int operator<(const MolResId &rid) const
-
Return the result of the relational operator.
So that all of the relational operators are well behaved,
there is an implicit ordering of sequence numbers in different chains.
Chain identifiers are most significant, position is next,
and the insertion code is least significant.
Example
#include <mol/MolResId.h>
MolResId resnum(20);
Greg Couch, UCSF Computer Graphics Laboratory