16 HPChain(
const char *chain) : dChain(chain){}
19 HPChain(std::string chain) : dChain(chain){}
25 int length()
const {
return dChain.length(); }
35 char operator[](
unsigned int i)
const {
return dChain[i]; }
Encapsulates a string representing an HP chain.
Definition: hpchain.h:8
HPChain(std::string chain)
Creates an HP chain with the given string representation, which is copied internally.
Definition: hpchain.h:19
std::string dChain
The HPChain is represented by this string of characters 'H' and 'P'.
Definition: hpchain.h:9
std::string & get_chain()
Reference to the internal string.
Definition: hpchain.h:22
bool validate()
Validates the internal HP chain.
Definition: hpchain.cc:8
HPChain(const char *chain)
Creates an HP chain with the given string representation, which is copied internally.
Definition: hpchain.h:16
char operator[](unsigned int i) const
Returns the i-th bead type.
Definition: hpchain.h:35
HPChain()
Creates an empty HP chain.
Definition: hpchain.h:13
int length() const
Length of the chain.
Definition: hpchain.h:25