// Filename: pointerDataAttribute.h // Created by: jason (07Aug00) // //////////////////////////////////////////////////////////////////// // // PANDA 3D SOFTWARE // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved // // All use of this software is subject to the terms of the Panda 3d // Software license. You should have received a copy of this license // along with this source code; you will also find a current copy of // the license at http://www.panda3d.org/license.txt . // // To contact the maintainers of this program write to // panda3d@yahoogroups.com . // //////////////////////////////////////////////////////////////////// #ifndef POINTERDATAATTRIBUTE_H #define POINTERDATAATTRIBUTE_H #include #include #include template class PointerDataTransition; //////////////////////////////////////////////////////////////////// // Class : PointerDataTransition // Description : //////////////////////////////////////////////////////////////////// template class PointerDataAttribute : public NodeAttribute { public: INLINE PointerDataAttribute(); INLINE PointerDataAttribute(PtrType* ptr); INLINE PointerDataAttribute(const PointerDataAttribute ©); INLINE void operator = (const PointerDataAttribute ©); public: INLINE void set_value(PtrType* ptr); INLINE PtrType* get_value() const; virtual TypeHandle get_handle() const; virtual void output(ostream &out) const; virtual void write(ostream &out, int indent_level = 0) const; protected: virtual int internal_compare_to(const NodeAttribute *other) const; private: PtrType* _ptr; public: virtual TypeHandle get_type() const { return get_class_type(); } virtual TypeHandle force_init_type() {init_type(); return get_class_type();} static TypeHandle get_class_type() { return _type_handle; } static void init_type() { NodeAttribute::init_type(); register_type(_type_handle, string("PointerDataAttribute<") + get_type_handle(PtrType).get_name() + ">", NodeAttribute::get_class_type()); } private: static TypeHandle _type_handle; friend class PointerDataTransition; //Variable is just to make the compiler happy for the default //constructor static PtrType* _null_ptr; }; #include "pointerDataAttribute.I" #endif