Changeset 10512 for code/branches/core7/src/libraries/core/CoreIncludes.h
- Timestamp:
- May 30, 2015, 10:59:13 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/libraries/core/CoreIncludes.h
r10481 r10512 218 218 class _CoreExport StaticallyInitializedIdentifier : public StaticallyInitializedInstance 219 219 { 220 struct InheritsFrom 220 template <class T> 221 struct InheritsFromClass : public Identifier::InheritsFrom 221 222 { 222 virtual ~InheritsFrom() {} 223 virtual Identifier* getParent() = 0; 224 }; 225 226 template <class T> 227 struct InheritsFromClass : public InheritsFrom 228 { 229 virtual Identifier* getParent() { return Class(T); } 223 virtual Identifier* getParent() const { return Class(T); } 230 224 }; 231 225 232 226 public: 233 227 StaticallyInitializedIdentifier(Identifier* identifier) : identifier_(identifier) {} 234 ~StaticallyInitializedIdentifier()235 {236 for (size_t i = 0; i < this->parents_.size(); ++i)237 delete parents_[i];238 }239 228 240 229 virtual void load() 241 230 { 242 231 IdentifierManager::getInstance().addIdentifier(this->identifier_); 243 for (size_t i = 0; i < this->parents_.size(); ++i)244 this->identifier_->inheritsFrom(this->parents_[i]->getParent());245 232 } 246 233 … … 255 242 template <class T> 256 243 inline StaticallyInitializedIdentifier& inheritsFrom() 257 { this-> parents_.push_back(new InheritsFromClass<T>()); return *this; }244 { this->identifier_->inheritsFrom(new InheritsFromClass<T>()); return *this; } 258 245 259 246 inline StaticallyInitializedIdentifier& virtualBase() … … 262 249 private: 263 250 Identifier* identifier_; 264 std::vector<InheritsFrom*> parents_;265 251 }; 266 252
Note: See TracChangeset
for help on using the changeset viewer.