comparison engine/core/model/model.h @ 35:bf7f838e6684

Added methods for removing Objects from the Model.
author jwt@33b003aa-7bff-0310-803a-e67f0ece8222
date Sat, 12 Jul 2008 02:50:09 +0000
parents 112fc4af772d
children 90005975cdbb
comparison
equal deleted inserted replaced
34:d66538926e78 35:bf7f838e6684
95 * @param parent Objects may optionally inherit values from a parent object. 95 * @param parent Objects may optionally inherit values from a parent object.
96 * @note This object belongs to the model, so don't delete the returned pointer 96 * @note This object belongs to the model, so don't delete the returned pointer
97 */ 97 */
98 Object* createObject(const std::string& identifier, const std::string& name_space, Object* parent=0); 98 Object* createObject(const std::string& identifier, const std::string& name_space, Object* parent=0);
99 99
100 /** Attempt to remove an object from the model
101 * Fails and returns false if the object is referenced by an instance.
102 */
103 bool deleteObject(Object*);
104
105 /** Attempt to remove all objects from the model
106 * Fails and returns false if any maps with instances are present.
107 */
108 bool deleteObjects();
109
100 /** Get an object by its id. If no namespace is specified, the namespaces are searched in order 110 /** Get an object by its id. If no namespace is specified, the namespaces are searched in order
101 * and the first matching object is returned. Returns 0 if object is not found. 111 * and the first matching object is returned. Returns 0 if object is not found.
102 */ 112 */
103 Object* getObject(const std::string& id, const std::string& name_space); 113 Object* getObject(const std::string& id, const std::string& name_space);
104 114