comparison engine/core/model/structures/layer.cpp @ 595:ea80b41c9bd7

- tested & applied patch by Helios - fixes API inconsistence and removed NotFound Exceptions for: - layer.getInstance() - model.getObjects() NOTE: - model.getObject() returned 0 if no objects were found, whereas model.getObjects() throws an exception (-> inconsistent)
author chewie@33b003aa-7bff-0310-803a-e67f0ece8222
date Sat, 21 Aug 2010 15:44:03 +0000
parents 16c2b3ee59ce
children 4f36c890b1dd
comparison
equal deleted inserted replaced
594:5df831617b42 595:ea80b41c9bd7
146 for(; it != m_instances.end(); ++it) { 146 for(; it != m_instances.end(); ++it) {
147 if((*it)->getId() == id) 147 if((*it)->getId() == id)
148 return *it; 148 return *it;
149 } 149 }
150 150
151 throw NotFound(id); 151 return 0;
152 } 152 }
153 153
154 std::vector<Instance*> Layer::getInstances(const std::string& id) { 154 std::vector<Instance*> Layer::getInstances(const std::string& id) {
155 std::vector<Instance*> matching_instances; 155 std::vector<Instance*> matching_instances;
156 std::vector<Instance*>::iterator it = m_instances.begin(); 156 std::vector<Instance*>::iterator it = m_instances.begin();