source: molecuilder/src/Descriptors/AtomIdDescriptor.cpp@ 86b917

Last change on this file since 86b917 was 86b917, checked in by Tillmann Crueger <crueger@…>, 16 years ago

Added descriptors that allow multiple kinds of access to atoms

  • Property mode set to 100644
File size: 558 bytes
Line 
1/*
2 * AtomIdDescriptor.cpp
3 *
4 * Created on: Feb 5, 2010
5 * Author: crueger
6 */
7
8#include "AtomIdDescriptor.hpp"
9
10#include "atom.hpp"
11
12using namespace std;
13
14AtomIdDescriptor::AtomIdDescriptor(int _id) :
15 id(_id)
16{}
17
18AtomIdDescriptor::~AtomIdDescriptor()
19{}
20
21
22atom *AtomIdDescriptor::find(){
23 map<int,atom*> atoms = getAtoms();
24 map<int,atom*>::iterator res = atoms.find(id);
25 return (res!=atoms.end())?((*res).second):0;
26}
27
28vector<atom*> AtomIdDescriptor::findAll(){
29 atom *res = find();
30 return (res)?(vector<atom*>(1,res)):(vector<atom*>());
31}
Note: See TracBrowser for help on using the repository browser.