Panda3D
|
00001 // Filename: callbackData.h 00002 // Created by: drose (13Mar09) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef CALLBACKDATA_H 00016 #define CALLBACKDATA_H 00017 00018 #include "pandabase.h" 00019 #include "typedObject.h" 00020 00021 //////////////////////////////////////////////////////////////////// 00022 // Class : CallbackData 00023 // Description : This is a generic data block that is passed along to 00024 // a CallbackObject when a callback is made. It 00025 // contains data specific to the particular callback 00026 // type in question. 00027 // 00028 // This is actually an abstract base class and contains 00029 // no data. Specializations of this class will contain 00030 // the actual data relevant to each callback type. 00031 //////////////////////////////////////////////////////////////////// 00032 class EXPCL_PANDA_PUTIL CallbackData : public TypedObject { 00033 protected: 00034 INLINE CallbackData(); 00035 00036 PUBLISHED: 00037 virtual void output(ostream &out) const; 00038 00039 virtual void upcall(); 00040 00041 public: 00042 static TypeHandle get_class_type() { 00043 return _type_handle; 00044 } 00045 static void init_type() { 00046 TypedObject::init_type(); 00047 register_type(_type_handle, "CallbackData", 00048 TypedObject::get_class_type()); 00049 } 00050 virtual TypeHandle get_type() const { 00051 return get_class_type(); 00052 } 00053 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00054 00055 private: 00056 static TypeHandle _type_handle; 00057 }; 00058 00059 inline ostream &operator << (ostream &out, const CallbackData &cbd) { 00060 cbd.output(out); 00061 return out; 00062 } 00063 00064 #include "callbackData.I" 00065 00066 #endif