17 #ifndef _SIMPLEBOND_H_
18 #define _SIMPLEBOND_H_
31 namespace Victor {
namespace Biopool {
43 SimpleBond(
unsigned int mI = 1,
unsigned int mO = 4);
48 virtual string getType()
const;
53 bool isIndirectBond(
const SimpleBond& c)
const;
55 bool isIndirectInBond(
const SimpleBond& c)
const;
56 bool isIndirectOutBond(
const SimpleBond& c)
const;
60 virtual const SimpleBond& getInBond(
unsigned int n)
const;
61 virtual const SimpleBond& getOutBond(
unsigned int n)
const;
63 virtual SimpleBond& getOutBond(
unsigned int n);
65 unsigned int sizeInBonds()
const;
66 unsigned int sizeOutBonds()
const;
68 unsigned int getMaxInBonds()
const;
69 unsigned int getMaxOutBonds()
const;
74 virtual void setType(
string _name);
82 void setMaxInBonds(
unsigned int m);
83 void setMaxOutBonds(
unsigned int m);
86 bool operator==(
const SimpleBond& other)
const;
96 vector<SimpleBond*> inBonds, outBonds;
97 unsigned int maxIn, maxOut;
114 inline string SimpleBond::getType()
const {
123 return (isInBond(c) || isOutBond(c));
130 inline bool SimpleBond::isInBond(
const SimpleBond& c)
const {
131 return find(inBonds.begin(), inBonds.end(), &c) != inBonds.end();
140 return find(outBonds.begin(), outBonds.end(), &c) != outBonds.end();
146 inline unsigned int SimpleBond::sizeInBonds()
const {
147 return inBonds.size();
153 inline unsigned int SimpleBond::sizeOutBonds()
const {
154 return outBonds.size();
161 PRECOND(n < sizeInBonds(), exception);
169 PRECOND(n < sizeOutBonds(), exception);
176 inline const SimpleBond& SimpleBond::getInBond(
unsigned int n)
const {
177 PRECOND(n < sizeInBonds(), exception);
184 inline const SimpleBond& SimpleBond::getOutBond(
unsigned int n)
const {
185 PRECOND(n < sizeOutBonds(), exception);
193 inline unsigned int SimpleBond::getMaxInBonds()
const {
200 inline unsigned int SimpleBond::getMaxOutBonds()
const {
209 inline void SimpleBond::setType(
string _name) {
216 inline void SimpleBond::setMaxInBonds(
unsigned int m) {
217 PRECOND((m >= inBonds.size()), exception);
225 inline void SimpleBond::setMaxOutBonds(
unsigned int m) {
226 PRECOND((m >= outBonds.size()), exception);
239 inline bool SimpleBond::operator==(
const SimpleBond& other)
const {
240 return id == (other.id);
245 #endif //_SimpleBond_H_
Defines chemical and abstract bonds between objects. eg.: covalent bonds. Attention: copy() strips or...
Definition: SimpleBond.h:39
Implements object id. With a "number" a "name" and a "counter".
Definition: Identity.h:36