Changeset 2171 for code/trunk/src/core
- Timestamp:
- Nov 10, 2008, 12:05:03 AM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/objecthierarchy merged: 2111-2115,2123,2132-2134,2143-2144,2153-2158,2160-2169
- Property svn:mergeinfo changed
-
code/trunk/src/core/BaseObject.cc
r2087 r2171 41 41 #include "Template.h" 42 42 #include "util/String.h" 43 #include "util/mbool.h" 43 44 44 45 namespace orxonox -
code/trunk/src/core/BaseObject.h
r2087 r2171 28 28 29 29 /** 30 @file BaseObject.h30 @file 31 31 @brief Definition of the BaseObject class. 32 32 … … 45 45 #include "XMLIncludes.h" 46 46 #include "Event.h" 47 #include "util/mbool.h" 47 48 48 49 namespace orxonox … … 72 73 73 74 /** @brief Sets the state of the objects activity. @param bActive True = active */ 74 inline void setActive(bool bActive) { this->bActive_ = bActive; this->changedActivity(); } 75 inline void setActive(bool bActive) 76 { 77 if (this->bActive_ != bActive) 78 { 79 this->bActive_ = bActive; 80 this->changedActivity(); 81 } 82 } 75 83 /** @brief Returns the state of the objects activity. @return The state of the activity */ 76 inline boolisActive() const { return this->bActive_; }84 inline const mbool& isActive() const { return this->bActive_; } 77 85 /** @brief This function gets called if the activity of the object changes. */ 78 86 virtual void changedActivity() {} 79 87 80 88 /** @brief Sets the state of the objects visibility. @param bVisible True = visible */ 81 inline void setVisible(bool bVisible) { this->bVisible_ = bVisible; this->changedVisibility(); } 89 inline void setVisible(bool bVisible) 90 { 91 if (this->bVisible_ != bVisible) 92 { 93 this->bVisible_ = bVisible; 94 this->changedVisibility(); 95 } 96 } 82 97 /** @brief Returns the state of the objects visibility. @return The state of the visibility */ 83 inline boolisVisible() const { return this->bVisible_; }98 inline const mbool& isVisible() const { return this->bVisible_; } 84 99 /** @brief This function gets called if the visibility of the object changes. */ 85 100 virtual void changedVisibility() {} … … 138 153 std::string name_; //!< The name of the object 139 154 std::string oldName_; //!< The old name of the object 140 bool bActive_;//!< True = the object is active141 bool bVisible_;//!< True = the object is visible155 mbool bActive_; //!< True = the object is active 156 mbool bVisible_; //!< True = the object is visible 142 157 143 158 private: -
code/trunk/src/core/ClassFactory.h
r2087 r2171 28 28 29 29 /** 30 @file ClassFactory.h30 @file 31 31 @brief Definition and implementation of the ClassFactory class 32 32 -
code/trunk/src/core/ClassTreeMask.cc
r1757 r2171 28 28 29 29 /** 30 @file ClassTreeMask.cc30 @file 31 31 @brief Implementation of the ClassTreeMask, ClassTreeMaskNode and ClassTreeMaskIterator classes. 32 32 */ -
code/trunk/src/core/ClassTreeMask.h
r1759 r2171 28 28 29 29 /** 30 @file ClassTreeMask.h30 @file 31 31 @brief Definition of the ClassTreeMask, ClassTreeMaskNode and ClassTreeMaskIterator classes. 32 32 -
code/trunk/src/core/Clock.h
r1755 r2171 28 28 29 29 /** 30 @file Core.h30 @file 31 31 @brief Declaration of the Core class. 32 32 -
code/trunk/src/core/ConfigValueContainer.cc
r1887 r2171 28 28 29 29 /** 30 @file ConfigValueContainer.cc30 @file 31 31 @brief Implementation of the ConfigValueContainer class. 32 32 */ -
code/trunk/src/core/ConfigValueContainer.h
r2087 r2171 28 28 29 29 /** 30 @file ConfigValueContainer.h30 @file 31 31 @brief Definition of the ConfigValueContainer class. 32 32 -
code/trunk/src/core/ConfigValueIncludes.h
r2103 r2171 28 28 29 29 /** 30 @file ConfigValueIncludes.h30 @file 31 31 @brief Definition of macros for config-values. 32 32 */ -
code/trunk/src/core/Core.cc
r2087 r2171 28 28 29 29 /** 30 @file Core.cc30 @file 31 31 @brief Implementation of the Core class. 32 32 */ -
code/trunk/src/core/Core.h
r2087 r2171 28 28 29 29 /** 30 @file Core.h30 @file 31 31 @brief Declaration of the Core class. 32 32 -
code/trunk/src/core/CoreIncludes.h
r2103 r2171 28 28 29 29 /** 30 @file CoreIncludes.h30 @file 31 31 @brief Definition of macros for Identifier and Factory. 32 32 -
code/trunk/src/core/Factory.cc
r2087 r2171 28 28 29 29 /** 30 @file Factory.cc30 @file 31 31 @brief Implementation of the Factory class. 32 32 */ -
code/trunk/src/core/Factory.h
r2087 r2171 28 28 29 29 /** 30 @file Factory.h30 @file 31 31 @brief Definition of the Factory and the BaseFactory class. 32 32 -
code/trunk/src/core/Identifier.cc
r2087 r2171 28 28 29 29 /** 30 @file Identifier.cc30 @file 31 31 @brief Implementation of the Identifier class. 32 32 */ -
code/trunk/src/core/Identifier.h
r2103 r2171 28 28 29 29 /** 30 @file Identifier.h30 @file 31 31 @brief Definition of the Identifier, ClassIdentifier and SubclassIdentifier classes, implementation of the ClassIdentifier and SubclassIdentifier classes. 32 32 -
code/trunk/src/core/Iterator.h
r1854 r2171 28 28 29 29 /** 30 @file Iterator.h30 @file 31 31 @brief Definition and implementation of the Iterator class. 32 32 -
code/trunk/src/core/Language.cc
r2103 r2171 28 28 29 29 /** 30 @file Language.cc30 @file 31 31 @brief Implementation of the Language and the LanguageEntry classes. 32 32 */ -
code/trunk/src/core/Language.h
r2103 r2171 28 28 29 29 /** 30 @file Language.h30 @file 31 31 @brief Definition of the Language and the LanguageEntry class. 32 32 -
code/trunk/src/core/Loader.cc
r2087 r2171 37 37 #include "Namespace.h" 38 38 #include "util/Debug.h" 39 #include "util/Exception.h" 39 40 40 41 #include "tinyxml/ticpp.h" … … 157 158 return true; 158 159 } 159 catch(ticpp::Exception& ex) 160 catch (ticpp::Exception& ex) 161 { 162 COUT(1) << std::endl; 163 COUT(1) << "An XML-error occurred in Loader.cc while loading " << file->getFilename() << ":" << std::endl; 164 COUT(1) << ex.what() << std::endl; 165 COUT(1) << "Loading aborted." << std::endl; 166 return false; 167 } 168 catch (Exception& ex) 169 { 170 COUT(1) << std::endl; 171 COUT(1) << "A loading-error occurred in Loader.cc while loading " << file->getFilename() << ":" << std::endl; 172 COUT(1) << ex.what() << std::endl; 173 COUT(1) << "Loading aborted." << std::endl; 174 return false; 175 } 176 catch (std::exception& ex) 160 177 { 161 178 COUT(1) << std::endl; 162 179 COUT(1) << "An error occurred in Loader.cc while loading " << file->getFilename() << ":" << std::endl; 163 180 COUT(1) << ex.what() << std::endl; 181 COUT(1) << "Loading aborted." << std::endl; 182 return false; 183 } 184 catch (...) 185 { 186 COUT(1) << std::endl; 187 COUT(1) << "An unknown error occurred in Loader.cc while loading " << file->getFilename() << ":" << std::endl; 164 188 COUT(1) << "Loading aborted." << std::endl; 165 189 return false; -
code/trunk/src/core/MetaObjectList.cc
r1747 r2171 28 28 29 29 /** 30 @file MetaObjectList.cc30 @file 31 31 @brief Implementation of the MetaObjectList class. 32 32 */ -
code/trunk/src/core/MetaObjectList.h
r1747 r2171 28 28 29 29 /** 30 @file MetaObjectList.h30 @file 31 31 @brief Definition of the MetaObjectList class. 32 32 -
code/trunk/src/core/ObjectList.h
r1747 r2171 28 28 29 29 /** 30 @file ObjectList.h30 @file 31 31 @brief Definition and implementation of the ObjectList class. 32 32 -
code/trunk/src/core/ObjectListBase.cc
r1747 r2171 28 28 29 29 /** 30 @file ObjectListBase.cc30 @file 31 31 @brief Implementation of the ObjectListBase class. 32 32 -
code/trunk/src/core/ObjectListBase.h
r1854 r2171 28 28 29 29 /** 30 @file ObjectListBase.h30 @file 31 31 @brief Definition of the ObjectListBase class. 32 32 -
code/trunk/src/core/OrxonoxClass.cc
r1747 r2171 28 28 29 29 /** 30 @file OrxonoxClass.cc30 @file 31 31 @brief Implementation of the OrxonoxClass Class. 32 32 */ -
code/trunk/src/core/OrxonoxClass.h
r1755 r2171 28 28 29 29 /** 30 @file OrxonoxClass.h30 @file 31 31 @brief Declaration of the OrxonoxClass Class. 32 32 -
code/trunk/src/core/Super.h
r2087 r2171 28 28 29 29 /** 30 @file Super.h30 @file 31 31 @brief Definition of all super-function related macros. 32 32 -
code/trunk/src/core/Template.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/trunk/src/core/Template.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/trunk/src/core/XMLFile.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/trunk/src/core/XMLIncludes.h
- Property svn:mergeinfo changed
/code/branches/objecthierarchy/src/core/XMLIncludes.h merged: 2114
r2103 r2171 28 28 29 29 /** 30 @file XMLIncludes.h30 @file 31 31 @brief Forward declarations of some XML classes. 32 32 */ - Property svn:mergeinfo changed
-
code/trunk/src/core/XMLPort.h
r2087 r2171 28 28 29 29 /** 30 @file XMLPort.h30 @file 31 31 @brief Declaration of the XMLPort helper classes and macros. 32 32 … … 44 44 45 45 #include "util/Debug.h" 46 #include "util/Exception.h" 46 47 #include "util/MultiType.h" 47 48 #include "tinyxml/ticpp.h" … … 495 496 if (this->identifierIsIncludedInLoaderMask(identifier)) 496 497 { 497 COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "fabricating " << child->Value() << "..." << std::endl; 498 499 BaseObject* newObject = identifier->fabricate((BaseObject*)object); 500 assert(newObject); 501 newObject->setLoaderIndentation(((BaseObject*)object)->getLoaderIndentation() + " "); 502 503 O* castedObject = dynamic_cast<O*>(newObject); 504 assert(castedObject); 505 506 if (this->bLoadBefore_) 498 try 507 499 { 508 newObject->XMLPort(*child, XMLPort::LoadObject); 509 COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->identifier_->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")" << std::endl; 500 COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "fabricating " << child->Value() << "..." << std::endl; 501 502 BaseObject* newObject = identifier->fabricate((BaseObject*)object); 503 assert(newObject); 504 newObject->setLoaderIndentation(((BaseObject*)object)->getLoaderIndentation() + " "); 505 506 O* castedObject = dynamic_cast<O*>(newObject); 507 assert(castedObject); 508 509 if (this->bLoadBefore_) 510 { 511 newObject->XMLPort(*child, XMLPort::LoadObject); 512 COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->identifier_->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")" << std::endl; 513 } 514 else 515 { 516 COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "assigning " << child->Value() << " (object not yet loaded) to " << this->identifier_->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")" << std::endl; 517 } 518 519 COUT(5) << ((BaseObject*)object)->getLoaderIndentation(); 520 (*this->loadexecutor_)(object, castedObject); 521 522 if (!this->bLoadBefore_) 523 newObject->XMLPort(*child, XMLPort::LoadObject); 524 525 COUT(5) << ((BaseObject*)object)->getLoaderIndentation() << "...fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << std::endl; 510 526 } 511 else527 catch (AbortLoadingException& ex) 512 528 { 513 COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "assigning " << child->Value() << " (object not yet loaded) to " << this->identifier_->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")" << std::endl; 529 COUT(1) << "An error occurred while loading object, abort loading..." << std::endl; 530 throw ex; 514 531 } 515 516 COUT(5) << ((BaseObject*)object)->getLoaderIndentation(); 517 (*this->loadexecutor_)(object, castedObject); 518 519 if (!this->bLoadBefore_) 520 newObject->XMLPort(*child, XMLPort::LoadObject); 521 522 COUT(5) << ((BaseObject*)object)->getLoaderIndentation() << "...fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << std::endl; 532 catch (std::exception& ex) 533 { 534 COUT(1) << "An error occurred while loading object:" << std::endl; 535 COUT(1) << ex.what() << std::endl; 536 } 537 catch (...) 538 { 539 COUT(1) << "An unknown error occurred while loading object." << std::endl; 540 } 523 541 } 524 542 }
Note: See TracChangeset
for help on using the changeset viewer.