Polymer Class Template Reference

A Polymer is a chain of monomers that is also an atomic structure. More...

#include <polymer.hpp>

Inheritance diagram for Polymer:

PolymerStructure boost::less_than_comparable ChemicallyTypedObject BTKSequence< MonomerType, StorageStrategy > boost::less_than_comparable BTKContainer List of all members.

Public Types

typedef base_type::chemical_type_system chemical_type_system
typedef base_type::dictionary dictionary
typedef base_type::id_type id_type
typedef base_type::value_type value_type
typedef base_type::iterator iterator
typedef base_type::const_iterator const_iterator
typedef base_type::reverse_iterator reverse_iterator
typedef base_type::const_reverse_iterator const_reverse_iterator
typedef base_type::reference reference
typedef base_type::const_reference const_reference
typedef base_type::pointer pointer
typedef base_type::const_pointer const_pointer
typedef base_type::difference_type difference_type
typedef base_type::size_type size_type
typedef base_type::monomer_type monomer_type
typedef base_type::monomer_iterator monomer_iterator
typedef base_type::const_monomer_iterator const_monomer_iterator
typedef base_type::reverse_monomer_iterator reverse_monomer_iterator
typedef base_type::const_reverse_monomer_iterator const_reverse_monomer_iterator
typedef base_type::structure_id_type structure_id_type
typedef base_type::monomer_id_type monomer_id_type
Type definitions required by the AtomicStructureConcept.
typedef monomer_type::atom_type atom_type
 The atom type (the type of the atom held by the monomer objects).
typedef atom_type::id_type atom_id_type
 THe atom ID type.
Required atom iterator types.
typedef UTILITY::GroupedElementIterator<
monomer_iterator, typename
monomer_type::atom_iterator,
monomer_type, atom_type
atom_iterator
typedef boost::reverse_iterator<
atom_iterator
reverse_atom_iterator
typedef UTILITY::GroupedElementIterator<
const_monomer_iterator, typename
monomer_type::const_atom_iterator,
monomer_type const, atom_type
const > 
const_atom_iterator
typedef boost::reverse_iterator<
const_atom_iterator
const_reverse_atom_iterator

Public Member Functions

 Polymer (size_type s=0, monomer_type const &m=monomer_type(), char chain_id= ' ', structure_id_type t=structure_id_type())
 Construct a Polymer of a given size.
template<typename MonomerIterator>
 Polymer (MonomerIterator first, MonomerIterator last, char chain_id= ' ', structure_id_type t=structure_id_type())
 Construct a Polymer from a range of monomer objects.
 Polymer (self_type const &source)
virtual ~Polymer ()
virtual std::ostream & print (std::ostream &os, size_type first_atom_num=1, size_type first_monomer_num=1) const
 Print the atoms in a Polymer to an output stream.
template<typename InputIterator>
void insert (iterator p, InputIterator i, InputIterator j)
virtual dictionary const & get_dictionary () const
virtual dictionaryget_dictionary ()
void swap (self_type &b)
self_type const & operator= (self_type const &rhs)
bool operator== (self_type const &rhs) const
bool operator!= (self_type const &rhs) const
bool operator< (self_type const &rhs) const
Methods required by the AtomicStructureConcept.
atom_iterator structure_begin ()
 Get an atom_iterator (start of range).
const_atom_iterator structure_begin () const
 Get an atom_iterator (start of range).
reverse_atom_iterator structure_rbegin ()
 Get a reverse_atom_iterator.
const_reverse_atom_iterator structure_rbegin () const
 Get a reverse_atom_iterator.
atom_iterator structure_end ()
 Get a reverse_atom_iterator (end of range).
const_atom_iterator structure_end () const
 Get an atom_iterator (end of range).
reverse_atom_iterator structure_rend ()
 Get a reverse_atom_iterator (end of range).
const_reverse_atom_iterator structure_rend () const
 Get a reverse_atom_iterator (end of range).
size_type num_atoms () const
 Get the size of the Polymer, in atoms.
Methods required for the ChainConcept.
char chain_id () const
 Get the current chain ID value.
void set_chain_id (char chain_id)
 Set the current chain ID value.

Detailed Description

template<typename MonomerType, typename ChemicalTypeSystemType = typename MonomerType::chemical_type_system, typename DictionaryType = typename ChemicalTypeSystemType::structure_dictionary, typename StorageStrategy = std::list<MonomerType>>
class BTK::MOLECULES::Polymer< MonomerType, ChemicalTypeSystemType, DictionaryType, StorageStrategy >

A Polymer is a chain of monomers that is also an atomic structure.

This class is a Sequence of objects that adhere to the MonomerConcept, (just like PolymerStructure), with the addition of methods thast allow iteration over atoms (as if the container were an AtomicStructure). This combination of features makes sense biochemically -- every polymer is a a chain of atoms, conceptually grouped into monomers.

More specifically, Polymer implements the ChainConcept and the AtomicStructureConcept. Thus, you can iterate over atoms and get/set the chain ID of a Polymer, but you cannot insert or delete individual atoms from a Polymer. As with the PolymerStructure, though, you may insert and delete monomer objects from a Polymer.

Examples:

gyration_radius.cpp.


Member Typedef Documentation

typedef base_type ::chemical_type_system chemical_type_system

Reimplemented from PolymerStructure.

typedef base_type ::dictionary dictionary

Reimplemented from PolymerStructure.

typedef base_type ::id_type id_type

Reimplemented from PolymerStructure.

typedef base_type ::value_type value_type

Reimplemented from PolymerStructure.

typedef base_type ::iterator iterator

Reimplemented from PolymerStructure.

typedef base_type ::const_iterator const_iterator

Reimplemented from PolymerStructure.

typedef base_type ::reverse_iterator reverse_iterator

Reimplemented from PolymerStructure.

typedef base_type ::const_reverse_iterator const_reverse_iterator

Reimplemented from PolymerStructure.

typedef base_type ::reference reference

Reimplemented from PolymerStructure.

typedef base_type ::const_reference const_reference

Reimplemented from PolymerStructure.

typedef base_type ::pointer pointer

Reimplemented from PolymerStructure.

typedef base_type ::const_pointer const_pointer

Reimplemented from PolymerStructure.

typedef base_type ::difference_type difference_type

Reimplemented from PolymerStructure.

typedef base_type ::size_type size_type

Reimplemented from PolymerStructure.

typedef base_type ::monomer_type monomer_type

Reimplemented from PolymerStructure.

typedef base_type ::monomer_iterator monomer_iterator

Reimplemented from PolymerStructure.

typedef base_type ::const_monomer_iterator const_monomer_iterator

Reimplemented from PolymerStructure.

typedef base_type ::reverse_monomer_iterator reverse_monomer_iterator

Reimplemented from PolymerStructure.

typedef base_type ::const_reverse_monomer_iterator const_reverse_monomer_iterator

Reimplemented from PolymerStructure.

typedef base_type ::structure_id_type structure_id_type

Reimplemented from PolymerStructure.

typedef base_type ::monomer_id_type monomer_id_type

Reimplemented from PolymerStructure.

typedef monomer_type::atom_type atom_type

The atom type (the type of the atom held by the monomer objects).

typedef atom_type::id_type atom_id_type

THe atom ID type.

typedef UTILITY:: GroupedElementIterator<monomer_iterator, typename monomer_type::atom_iterator, monomer_type, atom_type> atom_iterator

typedef boost::reverse_iterator<atom_iterator> reverse_atom_iterator

typedef UTILITY:: GroupedElementIterator<const_monomer_iterator, typename monomer_type::const_atom_iterator, monomer_type const, atom_type const> const_atom_iterator

typedef boost::reverse_iterator<const_atom_iterator> const_reverse_atom_iterator


Constructor & Destructor Documentation

Polymer ( size_type  s = 0,
monomer_type const &  m = monomer_type(),
char  chain_id = ' ',
structure_id_type  t = structure_id_type() 
)

Construct a Polymer of a given size.

Parameters:
s Size of the new Polymer.
m An instance of the MonomerType to copy into the new Polymer.
chain_id The chain ID value.
t The structure ID value (currently unused).

Polymer ( MonomerIterator  first,
MonomerIterator  last,
char  chain_id = ' ',
structure_id_type  t = structure_id_type() 
)

Construct a Polymer from a range of monomer objects.

Parameters:
first The start iterator of the monomer range.
last The end iterator of the monomer range.
chain_id The chain ID value.
t The structure ID value (currently unused).

Polymer ( self_type const &  source  ) 

virtual ~Polymer (  )  [virtual]


Member Function Documentation

atom_iterator structure_begin (  ) 

Get an atom_iterator (start of range).

const_atom_iterator structure_begin (  )  const

Get an atom_iterator (start of range).

reverse_atom_iterator structure_rbegin (  ) 

Get a reverse_atom_iterator.

const_reverse_atom_iterator structure_rbegin (  )  const

Get a reverse_atom_iterator.

atom_iterator structure_end (  ) 

Get a reverse_atom_iterator (end of range).

const_atom_iterator structure_end (  )  const

Get an atom_iterator (end of range).

reverse_atom_iterator structure_rend (  ) 

Get a reverse_atom_iterator (end of range).

const_reverse_atom_iterator structure_rend (  )  const

Get a reverse_atom_iterator (end of range).

size_type num_atoms (  )  const

Get the size of the Polymer, in atoms.

Runs in linear time with the number of monomers in the Polymer.

virtual std::ostream& print ( std::ostream &  os,
size_type  first_atom_num = 1,
size_type  first_monomer_num = 1 
) const [virtual]

Print the atoms in a Polymer to an output stream.

Deprecated:
This interface will change when the simplified output system is completed in future versions of the library.

char chain_id (  )  const

Get the current chain ID value.

void set_chain_id ( char  chain_id  ) 

Set the current chain ID value.

void insert ( iterator  p,
InputIterator  i,
InputIterator  j 
)

Reimplemented from BTKSequence< MonomerType, StorageStrategy >.

virtual dictionary const& get_dictionary (  )  const [virtual]

Implements PolymerStructure.

virtual dictionary& get_dictionary (  )  [virtual]

Implements PolymerStructure.

void swap ( self_type b  ) 

self_type const& operator= ( self_type const &  rhs  ) 

bool operator== ( self_type const &  rhs  )  const

bool operator!= ( self_type const &  rhs  )  const

bool operator< ( self_type const &  rhs  )  const


The documentation for this class was generated from the following file:
Generated on Sun Jul 15 20:46:41 2007 for BTK Core by  doxygen 1.5.1