00001 // Filename: interrogateElement.h 00002 // Created by: drose (11Aug00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef INTERROGATEELEMENT_H 00020 #define INTERROGATEELEMENT_H 00021 00022 #include <dtoolbase.h> 00023 00024 #include "interrogateComponent.h" 00025 00026 class IndexRemapper; 00027 00028 //////////////////////////////////////////////////////////////////// 00029 // Class : InterrogateElement 00030 // Description : An internal representation of a data element, like a 00031 // data member or a global variable. 00032 //////////////////////////////////////////////////////////////////// 00033 class EXPCL_DTOOLCONFIG InterrogateElement : public InterrogateComponent { 00034 public: 00035 INLINE InterrogateElement(InterrogateModuleDef *def = NULL); 00036 INLINE InterrogateElement(const InterrogateElement ©); 00037 INLINE void operator = (const InterrogateElement ©); 00038 00039 INLINE bool is_global() const; 00040 00041 INLINE bool has_scoped_name() const; 00042 INLINE const string &get_scoped_name() const; 00043 00044 INLINE TypeIndex get_type() const; 00045 INLINE bool has_getter() const; 00046 INLINE FunctionIndex get_getter() const; 00047 INLINE bool has_setter() const; 00048 INLINE FunctionIndex get_setter() const; 00049 00050 void output(ostream &out) const; 00051 void input(istream &in); 00052 00053 void remap_indices(const IndexRemapper &remap); 00054 00055 private: 00056 enum Flags { 00057 F_global = 0x0001, 00058 F_has_getter = 0x0002, 00059 F_has_setter = 0x0004 00060 }; 00061 00062 int _flags; 00063 string _scoped_name; 00064 TypeIndex _type; 00065 FunctionIndex _getter; 00066 FunctionIndex _setter; 00067 00068 friend class InterrogateBuilder; 00069 }; 00070 00071 INLINE ostream &operator << (ostream &out, const InterrogateElement &element); 00072 INLINE istream &operator >> (istream &in, InterrogateElement &element); 00073 00074 #include "interrogateElement.I" 00075 00076 #endif