[Orxonox-commit 741] r3271 - branches/core4/src/core
rgrieder at orxonox.net
rgrieder at orxonox.net
Thu Jul 9 20:28:00 CEST 2009
Author: rgrieder
Date: 2009-07-09 20:27:59 +0200 (Thu, 09 Jul 2009)
New Revision: 3271
Modified:
branches/core4/src/core/OrxonoxClass.cc
branches/core4/src/core/OrxonoxClass.h
Log:
Modifying some strange template function declarations to avoid forward declaring a non-existent type (like class B).
Modified: branches/core4/src/core/OrxonoxClass.cc
===================================================================
--- branches/core4/src/core/OrxonoxClass.cc 2009-07-06 10:03:05 UTC (rev 3270)
+++ branches/core4/src/core/OrxonoxClass.cc 2009-07-09 18:27:59 UTC (rev 3271)
@@ -77,42 +77,42 @@
/** @brief Returns true if the objects class is of the given type or a derivative. */
- bool OrxonoxClass::isA(const SubclassIdentifier<class B>* identifier)
+ template <class B> bool OrxonoxClass::isA(const SubclassIdentifier<B>* identifier)
{ return this->getIdentifier()->isA(identifier->getIdentifier()); }
/** @brief Returns true if the objects class is exactly of the given type. */
- bool OrxonoxClass::isExactlyA(const SubclassIdentifier<class B>* identifier)
+ template <class B> bool OrxonoxClass::isExactlyA(const SubclassIdentifier<B>* identifier)
{ return this->getIdentifier()->isExactlyA(identifier->getIdentifier()); }
/** @brief Returns true if the objects class is a child of the given type. */
- bool OrxonoxClass::isChildOf(const SubclassIdentifier<class B>* identifier)
+ template <class B> bool OrxonoxClass::isChildOf(const SubclassIdentifier<B>* identifier)
{ return this->getIdentifier()->isChildOf(identifier->getIdentifier()); }
/** @brief Returns true if the objects class is a direct child of the given type. */
- bool OrxonoxClass::isDirectChildOf(const SubclassIdentifier<class B>* identifier)
+ template <class B> bool OrxonoxClass::isDirectChildOf(const SubclassIdentifier<B>* identifier)
{ return this->getIdentifier()->isDirectChildOf(identifier->getIdentifier()); }
/** @brief Returns true if the objects class is a parent of the given type. */
- bool OrxonoxClass::isParentOf(const SubclassIdentifier<class B>* identifier)
+ template <class B> bool OrxonoxClass::isParentOf(const SubclassIdentifier<B>* identifier)
{ return this->getIdentifier()->isParentOf(identifier->getIdentifier()); }
/** @brief Returns true if the objects class is a direct parent of the given type. */
- bool OrxonoxClass::isDirectParentOf(const SubclassIdentifier<class B>* identifier)
+ template <class B> bool OrxonoxClass::isDirectParentOf(const SubclassIdentifier<B>* identifier)
{ return this->getIdentifier()->isDirectParentOf(identifier->getIdentifier()); }
/** @brief Returns true if the objects class is of the given type or a derivative. */
- bool OrxonoxClass::isA(const SubclassIdentifier<class B> identifier)
+ template <class B> bool OrxonoxClass::isA(const SubclassIdentifier<B> identifier)
{ return this->getIdentifier()->isA(identifier.getIdentifier()); }
/** @brief Returns true if the objects class is exactly of the given type. */
- bool OrxonoxClass::isExactlyA(const SubclassIdentifier<class B> identifier)
+ template <class B> bool OrxonoxClass::isExactlyA(const SubclassIdentifier<B> identifier)
{ return this->getIdentifier()->isExactlyA(identifier.getIdentifier()); }
/** @brief Returns true if the objects class is a child of the given type. */
- bool OrxonoxClass::isChildOf(const SubclassIdentifier<class B> identifier)
+ template <class B> bool OrxonoxClass::isChildOf(const SubclassIdentifier<B> identifier)
{ return this->getIdentifier()->isChildOf(identifier.getIdentifier()); }
/** @brief Returns true if the objects class is a direct child of the given type. */
- bool OrxonoxClass::isDirectChildOf(const SubclassIdentifier<class B> identifier)
+ template <class B> bool OrxonoxClass::isDirectChildOf(const SubclassIdentifier<B> identifier)
{ return this->getIdentifier()->isDirectChildOf(identifier.getIdentifier()); }
/** @brief Returns true if the objects class is a parent of the given type. */
- bool OrxonoxClass::isParentOf(const SubclassIdentifier<class B> identifier)
+ template <class B> bool OrxonoxClass::isParentOf(const SubclassIdentifier<B> identifier)
{ return this->getIdentifier()->isParentOf(identifier.getIdentifier()); }
/** @brief Returns true if the objects class is a direct parent of the given type. */
- bool OrxonoxClass::isDirectParentOf(const SubclassIdentifier<class B> identifier)
+ template <class B> bool OrxonoxClass::isDirectParentOf(const SubclassIdentifier<B> identifier)
{ return this->getIdentifier()->isDirectParentOf(identifier.getIdentifier()); }
Modified: branches/core4/src/core/OrxonoxClass.h
===================================================================
--- branches/core4/src/core/OrxonoxClass.h 2009-07-06 10:03:05 UTC (rev 3270)
+++ branches/core4/src/core/OrxonoxClass.h 2009-07-09 18:27:59 UTC (rev 3271)
@@ -69,19 +69,19 @@
bool isParentOf(const Identifier* identifier);
bool isDirectParentOf(const Identifier* identifier);
- bool isA(const SubclassIdentifier<class B>* identifier);
- bool isExactlyA(const SubclassIdentifier<class B>* identifier);
- bool isChildOf(const SubclassIdentifier<class B>* identifier);
- bool isDirectChildOf(const SubclassIdentifier<class B>* identifier);
- bool isParentOf(const SubclassIdentifier<class B>* identifier);
- bool isDirectParentOf(const SubclassIdentifier<class B>* identifier);
+ template <class B> bool isA(const SubclassIdentifier<B>* identifier);
+ template <class B> bool isExactlyA(const SubclassIdentifier<B>* identifier);
+ template <class B> bool isChildOf(const SubclassIdentifier<B>* identifier);
+ template <class B> bool isDirectChildOf(const SubclassIdentifier<B>* identifier);
+ template <class B> bool isParentOf(const SubclassIdentifier<B>* identifier);
+ template <class B> bool isDirectParentOf(const SubclassIdentifier<B>* identifier);
- bool isA(const SubclassIdentifier<class B> identifier);
- bool isExactlyA(const SubclassIdentifier<class B> identifier);
- bool isChildOf(const SubclassIdentifier<class B> identifier);
- bool isDirectChildOf(const SubclassIdentifier<class B> identifier);
- bool isParentOf(const SubclassIdentifier<class B> identifier);
- bool isDirectParentOf(const SubclassIdentifier<class B> identifier);
+ template <class B> bool isA(const SubclassIdentifier<B> identifier);
+ template <class B> bool isExactlyA(const SubclassIdentifier<B> identifier);
+ template <class B> bool isChildOf(const SubclassIdentifier<B> identifier);
+ template <class B> bool isDirectChildOf(const SubclassIdentifier<B> identifier);
+ template <class B> bool isParentOf(const SubclassIdentifier<B> identifier);
+ template <class B> bool isDirectParentOf(const SubclassIdentifier<B> identifier);
bool isA(const OrxonoxClass* object);
bool isExactlyA(const OrxonoxClass* object);
More information about the Orxonox-commit
mailing list