Last change
on this file since 5aefaa was 98a2987, checked in by Tillmann Crueger <crueger@…>, 16 years ago |
Added -Wall flag and fixed several small hickups
|
-
Property mode
set to
100644
|
File size:
853 bytes
|
Line | |
---|
1 | /*
|
---|
2 | * AtomIdDescriptor.cpp
|
---|
3 | *
|
---|
4 | * Created on: Feb 5, 2010
|
---|
5 | * Author: crueger
|
---|
6 | */
|
---|
7 |
|
---|
8 | #include "AtomIdDescriptor.hpp"
|
---|
9 | #include "AtomIdDescriptor_impl.hpp"
|
---|
10 |
|
---|
11 | #include "atom.hpp"
|
---|
12 |
|
---|
13 | using namespace std;
|
---|
14 |
|
---|
15 |
|
---|
16 | AtomIdDescriptor_impl::AtomIdDescriptor_impl(atomId_t _id) :
|
---|
17 | id(_id)
|
---|
18 | {}
|
---|
19 |
|
---|
20 | AtomIdDescriptor_impl::~AtomIdDescriptor_impl()
|
---|
21 | {}
|
---|
22 |
|
---|
23 | bool AtomIdDescriptor_impl::predicate(std::pair<atomId_t,atom*> atom) {
|
---|
24 | return atom.first==id;
|
---|
25 | }
|
---|
26 |
|
---|
27 | AtomDescriptor AtomById(atomId_t id){
|
---|
28 | return AtomDescriptor(AtomDescriptor::impl_ptr(new AtomIdDescriptor_impl(id)));
|
---|
29 | }
|
---|
30 |
|
---|
31 | atom *AtomIdDescriptor_impl::find(){
|
---|
32 | World::AtomSet atoms = getAtoms();
|
---|
33 | World::AtomSet::iterator res = atoms.find(id);
|
---|
34 | return (res!=atoms.end())?((*res).second):0;
|
---|
35 | }
|
---|
36 |
|
---|
37 | vector<atom*> AtomIdDescriptor_impl::findAll(){
|
---|
38 | atom *res = find();
|
---|
39 | return (res)?(vector<atom*>(1,res)):(vector<atom*>());
|
---|
40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.