Simple class to store the index of an atom. More...
#include <AtomNumber.h>
Public Member Functions | |
AtomNumber () | |
Initialize to index=0 (serial=1) More... | |
unsigned | serial () const |
Returns the serial number. More... | |
unsigned | index () const |
Returns the index number. More... | |
AtomNumber & | setSerial (unsigned) |
Sets the atom number by serial, returning a reference to the AtomNumber itself. More... | |
AtomNumber & | setIndex (unsigned) |
Sets the atom number by index, returning a reference to the AtomNumber itself. More... | |
Static Public Member Functions | |
static AtomNumber | serial (unsigned) |
Returns an AtomNumber with a specified serial. More... | |
static AtomNumber | index (unsigned) |
Returns an AtomNumber with a specified index. More... | |
Private Member Functions | |
AtomNumber (unsigned) | |
Construct with a given index. More... | |
Private Attributes | |
unsigned | index_ |
Friends | |
bool | operator< (const AtomNumber &, const AtomNumber &) |
Comparison operators. More... | |
bool | operator> (const AtomNumber &, const AtomNumber &) |
Comparison operators. More... | |
bool | operator<= (const AtomNumber &, const AtomNumber &) |
Comparison operators. More... | |
bool | operator>= (const AtomNumber &, const AtomNumber &) |
Comparison operators. More... | |
bool | operator== (const AtomNumber &, const AtomNumber &) |
Comparison operators. More... | |
bool | operator!= (const AtomNumber &, const AtomNumber &) |
Comparison operators. More... | |
Simple class to store the index of an atom.
It is just an unsigned, with all the methods inlined for better efficiency. Its special thing is that it is only accessed through serial(), index(), setSerial() and setIndex() methods, so that there no ambiguity about using the "from 0" (index) or "from 1" (serial) numbering (names as in VMD convention).
Definition at line 39 of file AtomNumber.h.
|
inlineprivate |
Construct with a given index.
This constructor is kept private to avoid implicit cast.
Definition at line 79 of file AtomNumber.h.
|
inline |
Initialize to index=0 (serial=1)
Definition at line 74 of file AtomNumber.h.
|
inline |
Returns the index number.
Definition at line 89 of file AtomNumber.h.
|
inlinestatic |
Returns an AtomNumber with a specified index.
Definition at line 115 of file AtomNumber.h.
|
inline |
Returns the serial number.
Definition at line 84 of file AtomNumber.h.
|
inlinestatic |
Returns an AtomNumber with a specified serial.
Definition at line 108 of file AtomNumber.h.
|
inline |
Sets the atom number by index, returning a reference to the AtomNumber itself.
Definition at line 102 of file AtomNumber.h.
|
inline |
Sets the atom number by serial, returning a reference to the AtomNumber itself.
Definition at line 94 of file AtomNumber.h.
|
friend |
Comparison operators.
Definition at line 145 of file AtomNumber.h.
|
friend |
Comparison operators.
Definition at line 120 of file AtomNumber.h.
|
friend |
Comparison operators.
Definition at line 130 of file AtomNumber.h.
|
friend |
Comparison operators.
Definition at line 140 of file AtomNumber.h.
|
friend |
Comparison operators.
Definition at line 125 of file AtomNumber.h.
|
friend |
Comparison operators.
Definition at line 135 of file AtomNumber.h.
|
private |
Definition at line 40 of file AtomNumber.h.
Hosted by GitHub
![]() |
![]() |