From 7470a32d17950660d7749e0754faf7545423e8d3 Mon Sep 17 00:00:00 2001 From: Dave Schuyler Date: Thu, 22 Jan 2004 02:26:55 +0000 Subject: [PATCH] expanded comment --- panda/src/express/typedObject.h | 60 +++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/panda/src/express/typedObject.h b/panda/src/express/typedObject.h index 0ffedead96..3f810fd202 100644 --- a/panda/src/express/typedObject.h +++ b/panda/src/express/typedObject.h @@ -34,6 +34,66 @@ // return the specific type of the derived class. // Inheriting from this automatically provides support // for is_of_type() and is_exact_type(). +// +// Defining get_type() and force_init_type() are not +// necessary if your class does not define any virtual +// functions. +// +// There is a specific layout for defining the +// overrides from this class. Keeping the definitions +// formatted just like these examples will allow +// someone in the future to use a sed (or similar) +// script to make global changes, if necessary. Avoid +// rearranging the braces or the order of the functions +// unless you're ready to change them in every file all +// at once. +// +// What follows are some examples that can be used in +// new classes that you create. +// +// --------------------------------------------------- +// In the class definition (.h file) +// --------------------------------------------------- +// +// public: +// static TypeHandle get_class_type() { +// return _type_handle; +// } +// static void init_type() { +// <<>>::init_type(); +// <<>>::init_type(); +// <<>>::init_type(); +// register_type(_type_handle, "<<>>", +// <<>>::get_class_type(), +// <<>>::get_class_type(), +// <<>>::get_class_type()); +// } +// virtual TypeHandle get_type() const { +// return get_class_type(); +// } +// virtual TypeHandle force_init_type() {init_type(); return get_class_type();} +// +// private: +// static TypeHandle _type_handle; +// +// +// ---------------------- +// In the class .cxx file +// ---------------------- +// +// TypeHandle <<>>::_type_handle; +// +// +// ---------------------------------------------- +// In the class config_<<>>.cxx file +// ---------------------------------------------- +// +// ConfigureFn(config_<<>>) { +// <<>>::init_type(); +// <<>>::init_type(); +// <<>>::init_type(); +// } +// //////////////////////////////////////////////////////////////////// class EXPCL_PANDAEXPRESS TypedObject { public: