apoCHARMM 1.0.0
High-performance molecular dynamics simulations on GPUs
 
Loading...
Searching...
No Matches
BondKey Struct Reference

Stores an ordered pair of CHARMM atom-type names for bond lookup. More...

#include <CharmmParameters.h>

Public Member Functions

 BondKey (const std::string &iatom, const std::string &jatom)
 Constructs a bond key from two atom-type names.
 
bool operator== (const BondKey &other) const
 Returns whether two ordered bond keys are equal.
 

Public Attributes

std::string atom1
 
std::string atom2
 

Friends

bool operator< (const BondKey &first, const BondKey &second)
 Orders bond keys in descending lexicographic atom-type order.
 
std::ostream & operator<< (std::ostream &output, const BondKey &key)
 Writes the two atom-type names followed by a trailing space.
 

Detailed Description

Stores an ordered pair of CHARMM atom-type names for bond lookup.

The parser canonicalizes a bond by sorting its two atom types before it constructs this value. Direct construction performs no sorting or case conversion.

Constructor & Destructor Documentation

◆ BondKey()

BondKey::BondKey ( const std::string &  iatom,
const std::string &  jatom 
)
inline

Constructs a bond key from two atom-type names.

Parameters
[in]iatomFirst atom-type name to copy.
[in]jatomSecond atom-type name to copy.
Postcondition
atom1 == iatom and atom2 == jatom.
Exceptions
std::bad_allocIf copying either atom-type name requires an allocation that fails.

Member Function Documentation

◆ operator==()

bool BondKey::operator== ( const BondKey other) const
inline

Returns whether two ordered bond keys are equal.

Parameters
[in]otherKey to compare with this key.
Returns
true when both atom-type names match in the same order; otherwise, false.

Friends And Related Symbol Documentation

◆ operator<

bool operator< ( const BondKey first,
const BondKey second 
)
friend

Orders bond keys in descending lexicographic atom-type order.

Parameters
[in]firstLeft key to compare.
[in]secondRight key to compare.
Returns
true when first sorts before second by descending atom1 and then descending atom2.

◆ operator<<

std::ostream & operator<< ( std::ostream &  output,
const BondKey key 
)
friend

Writes the two atom-type names followed by a trailing space.

Parameters
[in,out]outputStream that receives the text.
[in]keyBond key to write.
Returns
output after the write.

Member Data Documentation

◆ atom1

std::string BondKey::atom1

Stores the first atom-type name exactly as supplied.

◆ atom2

std::string BondKey::atom2

Stores the second atom-type name exactly as supplied.