Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: core/cross/object_base.h

Issue 149236: Add o3djs.DestinationBuffer to converter.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/cross/object_base.h
===================================================================
--- core/cross/object_base.h (revision 19848)
+++ core/cross/object_base.h (working copy)
@@ -50,11 +50,12 @@
#define O3D_STRING_CONSTANT(value) \
(O3D_NAMESPACE O3D_NAMESPACE_SEPARATOR value)
+
// This macro declares the necessary functions for the type mechanism to work.
// It needs to be used in each of the definition of any class that derives from
// ObjectBase.
// CLASS is the class being defined, BASE is its base class.
-#define O3D_DECL_CLASS(CLASS, BASE) \
+#define O3D_OBJECT_BASE_DECL_CLASS(CLASS, BASE) \
public: \
static const ObjectBase::Class *GetApparentClass() { return &class_; } \
static const String GetApparentClassName() { \
@@ -72,11 +73,25 @@
// This macro defines the class descriptor for the type mechanism. It needs to
// be used once in the definition file of any class that derives from
// ObjectBase.
+// CLASSNAME is the name to use to identify the class.
+// CLASS is the class being defined.
+// BASE is its base class.
+#define O3D_OBJECT_BASE_DEFN_CLASS(CLASSNAME, CLASS, BASE) \
+ ObjectBase::Class CLASS::class_ = { CLASSNAME, BASE::GetApparentClass() };
+
+// This macro declares the necessary functions for the type mechanism to work.
+// It needs to be used in each of the definition of any class that derives from
+// ObjectBase.
// CLASS is the class being defined, BASE is its base class.
-#define O3D_DEFN_CLASS(CLASS, BASE) \
- ObjectBase::Class CLASS::class_ = \
- { O3D_STRING_CONSTANT(#CLASS), BASE::GetApparentClass() };
+#define O3D_DECL_CLASS(CLASS, BASE) O3D_OBJECT_BASE_DECL_CLASS(CLASS, BASE)
+// This macro defines the class descriptor for the type mechanism. It needs to
+// be used once in the definition file of any class that derives from
+// ObjectBase.
+// CLASS is the class being defined, BASE is its base class.
+#define O3D_DEFN_CLASS(CLASS, BASE) \
+ O3D_OBJECT_BASE_DEFN_CLASS(O3D_STRING_CONSTANT(#CLASS), CLASS, BASE)
+
namespace o3d {
class ServiceLocator;
@@ -142,10 +157,7 @@
return name_;
}
- const char* unqualified_name() const {
- return name_ + sizeof(O3D_NAMESPACE) +
- sizeof(O3D_NAMESPACE_SEPARATOR) - 2;
- }
+ const char* unqualified_name() const;
public:
// The name of the class.

Powered by Google App Engine
This is Rietveld 408576698