diff options
author | Roberto C. Sanchez <roberto@connexer.com> | 2014-03-29 10:53:52 -0400 |
---|---|---|
committer | Roberto C. Sanchez <roberto@connexer.com> | 2014-03-29 10:53:52 -0400 |
commit | 148bd343f3e7e32d141f66b5b5c9b98b2975b0b3 (patch) | |
tree | 31078963b85110d57310759016e60e8d26ccb1e6 /include/swobject.h | |
parent | 8c8aa6b07e595cfac56838b5964ab3e96051f1b2 (diff) |
Imported Upstream version 1.5.8
Diffstat (limited to 'include/swobject.h')
-rw-r--r-- | include/swobject.h | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/include/swobject.h b/include/swobject.h deleted file mode 100644 index 27eafd6..0000000 --- a/include/swobject.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef SWOBJECT_H -#define SWOBJECT_H - -#include <utilfuns.h> -#if !defined(__GNUC__) && !defined(_WIN32_WCE) -#else -#include <unixstr.h> -#endif - -#include <defs.h> - -SWORD_NAMESPACE_START -#define SWDYNAMIC_CAST(className, object) (className *)((object)?((object->getClass()->isAssignableFrom(#className))?object:0):0) - -/** -* Class used for SWDYNAMIC_CAST to save the inheritance order. -*/ -class SWDLLEXPORT SWClass { -private: - const char **descends; - -public: - SWClass(const char **descends) { - this->descends = descends; - } - - bool isAssignableFrom(const char *className) const { - for (int i = 0; descends[i]; i++) { - if (!stricmp(descends[i], className)) - return true; - } - return false; - } -}; - -/** Base class for major Sword classes. -* SWObject is the base class for major Sword classes like SWKey. -* It is used because dynamic_cast is not available on all plattforms supported -* by Sword. Use SWDYNAMIC_CAST(classname, object) instead of dynamic_cast<classname>(object). -*/ -class SWObject { -protected: - SWClass * myclass; - -public: - /** Use this to get the class definition and inheritance order. - * @return The class definition of this object - */ - const SWClass *getClass () const { - return myclass; - } -}; - -SWORD_NAMESPACE_END -#endif |