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

Static Public Member Functions

static AtomNumber index (unsigned)
 Returns an AtomNumber with a specified index. More...
 
static AtomNumber serial (unsigned)
 Returns an AtomNumber with a specified serial. 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).

Constructor & Destructor Documentation

◆ AtomNumber() [1/2]

PLMD::AtomNumber::AtomNumber ( unsigned  i)
inlineexplicitprivate

Construct with a given index.

This constructor is kept private to avoid implicit cast.

◆ AtomNumber() [2/2]

PLMD::AtomNumber::AtomNumber ( )
inline

Initialize to index=0 (serial=1)

Member Function Documentation

◆ index() [1/2]

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

Returns the index number.

◆ index() [2/2]

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

Returns an AtomNumber with a specified index.

◆ serial() [1/2]

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

Returns the serial number.

◆ serial() [2/2]

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

Returns an AtomNumber with a specified serial.

◆ setIndex()

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

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

◆ setSerial()

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

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

Friends And Related Function Documentation

◆ operator!=

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

Comparison operators.

◆ operator<

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

Comparison operators.

◆ operator<=

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

Comparison operators.

◆ operator==

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

Comparison operators.

◆ operator>

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

Comparison operators.

◆ operator>=

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

Comparison operators.

Member Data Documentation

◆ index_

unsigned PLMD::AtomNumber::index_
private

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