- Timestamp:
- Aug 11, 2013, 11:00:43 AM (11 years ago)
- Location:
- code/branches/core6
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core6/src/libraries/core/class/Identifier.cc
r9629 r9632 174 174 @return The new object 175 175 */ 176 OrxonoxClass* Identifier::fabricate(Context* context)176 Identifiable* Identifier::fabricate(Context* context) 177 177 { 178 178 if (this->factory_) -
code/branches/core6/src/libraries/core/class/Identifier.h
r9629 r9632 56 56 object->getIdentifier()->getName(); // returns "MyClass" 57 57 58 OrxonoxClass* other = object->getIdentifier()->fabricate(0); // fabricates a new instance of MyClass58 Identifiable* other = object->getIdentifier()->fabricate(0); // fabricates a new instance of MyClass 59 59 60 60 … … 125 125 inline bool hasFactory() const { return (this->factory_ != 0); } 126 126 127 OrxonoxClass* fabricate(Context* context);127 Identifiable* fabricate(Context* context); 128 128 129 129 /// Returns true if the class can be loaded through XML. -
code/branches/core6/src/libraries/core/class/IdentifierManager.cc
r9564 r9632 91 91 if (it->second->hasFactory()) 92 92 { 93 OrxonoxClass* temp = it->second->fabricate(0);94 temp->destroy();93 Identifiable* temp = it->second->fabricate(0); 94 delete temp; 95 95 } 96 96 } -
code/branches/core6/src/libraries/core/class/SubclassIdentifier.h
r9629 r9632 165 165 T* fabricate(Context* context) const 166 166 { 167 OrxonoxClass* newObject = this->identifier_->fabricate(context);167 Identifiable* newObject = this->identifier_->fabricate(context); 168 168 169 169 // Check if the creation was successful -
code/branches/core6/src/libraries/core/object/ClassFactory.h
r9629 r9632 55 55 public: 56 56 virtual ~Factory() {}; 57 virtual OrxonoxClass* fabricate(Context* context) = 0;57 virtual Identifiable* fabricate(Context* context) = 0; 58 58 }; 59 59 … … 82 82 @return The new object 83 83 */ 84 inline OrxonoxClass* fabricate(Context* context)84 inline Identifiable* fabricate(Context* context) 85 85 { 86 86 return static_cast<OrxonoxClass*>(new T(context)); -
code/branches/core6/test/core/object/ClassFactoryTest.cc
r9603 r9632 8 8 { 9 9 Factory* factory = new ClassFactory<BaseObject>("BaseObject"); 10 OrxonoxClass* object = factory->fabricate(NULL);10 Identifiable* object = factory->fabricate(NULL); 11 11 ASSERT_TRUE(object != NULL); 12 12 BaseObject* baseObject = dynamic_cast<BaseObject*>(object);
Note: See TracChangeset
for help on using the changeset viewer.