All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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).

Constructor & Destructor Documentation

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

Construct with a given index.

This constructor is kept private to avoid implicit cast.

PLMD::AtomNumber::AtomNumber ( )
inline

Initialize to index=0 (serial=1)

Member Function Documentation

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

Returns the index number.

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

Returns an AtomNumber with a specified index.

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

Returns the serial number.

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

Returns an AtomNumber with a specified serial.

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

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

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

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

Comparison operators.

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

Comparison operators.

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

Comparison operators.

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

Comparison operators.

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

Comparison operators.

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

Comparison operators.

Member Data Documentation

unsigned PLMD::AtomNumber::index_
private

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