All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
PLMD::AtomNumber Class Reference

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...
 
AtomNumbersetSerial (unsigned)
 Sets the atom number by serial, returning a reference to the AtomNumber itself. More...
 
AtomNumbersetIndex (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...
 

Detailed Description

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.

Constructor & Destructor Documentation

PLMD::AtomNumber::AtomNumber ( unsigned  i)
inlineprivate

Construct with a given index.

This constructor is kept private to avoid implicit cast.

Definition at line 79 of file AtomNumber.h.

PLMD::AtomNumber::AtomNumber ( )
inline

Initialize to index=0 (serial=1)

Definition at line 74 of file AtomNumber.h.

Member Function Documentation

unsigned PLMD::AtomNumber::index ( ) const
inline

Returns the index number.

Definition at line 89 of file AtomNumber.h.

AtomNumber PLMD::AtomNumber::index ( unsigned  i)
inlinestatic

Returns an AtomNumber with a specified index.

Definition at line 115 of file AtomNumber.h.

unsigned PLMD::AtomNumber::serial ( ) const
inline

Returns the serial number.

Definition at line 84 of file AtomNumber.h.

AtomNumber PLMD::AtomNumber::serial ( unsigned  i)
inlinestatic

Returns an AtomNumber with a specified serial.

Definition at line 108 of file AtomNumber.h.

AtomNumber & PLMD::AtomNumber::setIndex ( unsigned  i)
inline

Sets the atom number by index, returning a reference to the AtomNumber itself.

Definition at line 102 of file AtomNumber.h.

AtomNumber & PLMD::AtomNumber::setSerial ( unsigned  i)
inline

Sets the atom number by serial, returning a reference to the AtomNumber itself.

Definition at line 94 of file AtomNumber.h.

Friends And Related Function Documentation

bool operator!= ( const AtomNumber a,
const AtomNumber b 
)
friend

Comparison operators.

Definition at line 145 of file AtomNumber.h.

bool operator< ( const AtomNumber a,
const AtomNumber b 
)
friend

Comparison operators.

Definition at line 120 of file AtomNumber.h.

bool operator<= ( const AtomNumber a,
const AtomNumber b 
)
friend

Comparison operators.

Definition at line 130 of file AtomNumber.h.

bool operator== ( const AtomNumber a,
const AtomNumber b 
)
friend

Comparison operators.

Definition at line 140 of file AtomNumber.h.

bool operator> ( const AtomNumber a,
const AtomNumber b 
)
friend

Comparison operators.

Definition at line 125 of file AtomNumber.h.

bool operator>= ( const AtomNumber a,
const AtomNumber b 
)
friend

Comparison operators.

Definition at line 135 of file AtomNumber.h.

Member Data Documentation

unsigned PLMD::AtomNumber::index_
private

Definition at line 40 of file AtomNumber.h.


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