BALL  1.5.0
atomContainer.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 
5 #ifndef BALL_KERNEL_ATOMCONTAINER_H
6 #define BALL_KERNEL_ATOMCONTAINER_H
7 
8 #ifndef BALL_KERNEL_ATOMITERATOR_H
10 #endif
11 
12 #ifndef BALL_KERNEL_ATOMCONTAINERITERATOR_H
14 #endif
15 
16 #define BALL_ATOMCONTAINER_DEFAULT_NAME ""
17 
18 namespace BALL
19 {
20  class Molecule;
21 
30  : public Composite,
31  public PropertyManager
32  {
33  public:
34 
36 
37 
40 
41 
42  enum Property
43  {
45  NUMBER_OF_PROPERTIES = 0
46  };
47 
49 
52 
56 
61  AtomContainer(const AtomContainer& atom_container, bool deep = true);
62 
66  AtomContainer(const String& name);
67 
70  virtual ~AtomContainer();
71 
76  virtual void clear();
77 
82  virtual void destroy();
83 
85 
88 
92  virtual void persistentWrite(PersistenceManager& pm, const char* name = 0) const;
93 
98 
100 
103 
110  void set(const AtomContainer& atom_container, bool deep = true);
111 
118  AtomContainer& operator = (const AtomContainer& atom_container);
119 
125  void get(AtomContainer& atom_container, bool deep = true) const;
126 
130  void swap(AtomContainer& atom_container);
131 
133 
136 
140  bool operator == (const AtomContainer& atom_container) const;
141 
145  bool operator != (const AtomContainer& atom_container) const;
146 
148 
151 
155  void setName(const String& name);
156 
160  const String& getName() const;
161 
167 
173 
181 
188  const AtomContainer* getAtomContainer(Position position) const;
189 
196  Atom* getAtom(Position position);
197 
204  const Atom* getAtom(Position position) const;
205 
212  Atom* getAtom(const String& name);
213 
220  const Atom* getAtom(const String& name) const;
221 
226 
230  Size countAtoms() const;
231 
235  Size countBonds() const;
236 
241 
246 
250  void prepend(Atom& atom);
251 
255  void append(Atom& atom);
256 
260  void insert(Atom& atom);
261 
266  void insertBefore(Atom& atom, Composite& before);
267 
272  void insertAfter(Atom& atom, Composite& after);
273 
277  bool remove(Atom& atom);
278 
281  Size removeHavingProperty(const string& name);
282  Size removeNotHavingProperty(const string& name);
283 
287  void prepend(AtomContainer& atom_container);
288 
292  void append(AtomContainer& atom_container);
293 
297  void insert(AtomContainer& atom_container);
298 
303  void insertBefore(AtomContainer& atom_container, Composite& before);
304 
309  void insertAfter(AtomContainer& atom_container, Composite& after);
310 
315  void spliceBefore(AtomContainer& atom_container);
316 
321  void spliceAfter(AtomContainer& atom_container);
322 
328  void splice(AtomContainer& atom_container);
329 
334  bool remove(AtomContainer& atom_container);
335 
337 
340 
343  void destroyBonds();
344 
346 
349 
353  bool isSubAtomContainerOf(const AtomContainer& atom_container) const;
354 
358  bool isSuperAtomContainerOf(const AtomContainer& atom_container) const;
359 
361 
364 
370  virtual bool isValid() const;
371 
378  virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
379 
381 
384 
387 
390 
392 
393  // --- EXTERNAL ITERATORS
394 
397 
400 
401  private:
402 
403  /*_ The name of this container
404  */
405  String name_;
406 
407  };
408 
409 } // namespace BALL
410 
411 #endif // BALL_KERNEL_ATOMCONTAINER_H
#define BALL_DECLARE_STD_ITERATOR_WRAPPER(container, type, method_name)
#define BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Type)
Definition: iterator.h:25
#define BALL_CREATE_DEEP(name)
Definition: create.h:26
BALL_EXPORT AtomList atoms(const AtomContainer &fragment, const String &expression=String())
Definition: constants.h:13
BALL_EXPORT AtomContainerList atomContainers(const AtomContainer &fragment, bool selected_only=false)
BALL_EXPORT bool operator==(const String &s1, const String &s2)
BALL_EXPORT bool operator!=(const String &s1, const String &s2)
const String & getName() const
void setName(const String &name)
Size countBonds() const
Size removeNotHavingProperty(BALL::Property p)
void prepend(Atom &atom)
void swap(AtomContainer &atom_container)
virtual void persistentWrite(PersistenceManager &pm, const char *name=0) const
Atom * getAtom(Position position)
AtomContainer(const AtomContainer &atom_container, bool deep=true)
Size removeHavingProperty(const string &name)
const Atom * getAtom(const String &name) const
void spliceBefore(AtomContainer &atom_container)
virtual void destroy()
bool remove(AtomContainer &atom_container)
void insertAfter(AtomContainer &atom_container, Composite &after)
Size removeHavingProperty(BALL::Property p)
void append(Atom &atom)
bool remove(Atom &atom)
Size removeNotHavingProperty(const string &name)
bool applyInterBond(UnaryProcessor< Bond > &processor)
Apply to all bonds connected to atoms outside this AtomContainer.
void append(AtomContainer &atom_container)
Size countAtomContainers() const
void insert(Atom &atom)
bool applyIntraBond(UnaryProcessor< Bond > &processor)
Apply to all bonds connecting two atoms inside this AtomContainer.
virtual void persistentRead(PersistenceManager &pm)
void splice(AtomContainer &atom_container)
bool isSuperAtomContainerOf(const AtomContainer &atom_container) const
AtomContainer * getSuperAtomContainer()
const AtomContainer * getAtomContainer(Position position) const
void get(AtomContainer &atom_container, bool deep=true) const
Size countAtoms() const
void insert(AtomContainer &atom_container)
void insertAfter(Atom &atom, Composite &after)
virtual void dump(std::ostream &s=std::cout, Size depth=0) const
const Atom * getAtom(Position position) const
void set(const AtomContainer &atom_container, bool deep=true)
AtomContainer(const String &name)
void insertBefore(Atom &atom, Composite &before)
void prepend(AtomContainer &atom_container)
virtual void clear()
bool isSubAtomContainerOf(const AtomContainer &atom_container) const
Property
The number of predefined properties for AtomContainer.
Definition: atomContainer.h:43
virtual bool isValid() const
Size countIntraBonds() const
Atom * getAtom(const String &name)
AtomContainer * getAtomContainer(Position position)
const AtomContainer * getSuperAtomContainer() const
virtual ~AtomContainer()
Size countInterBonds() const
void insertBefore(AtomContainer &atom_container, Composite &before)
void spliceAfter(AtomContainer &atom_container)
#define BALL_EXPORT
Definition: COMMON/global.h:50