![]() |
|
|
00001 /*************************************************************************** 00002 * inspectorJ - java profiler * 00003 * Copyright (C) 2007 by James May 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 00027 #ifndef MODEL_JAVA_CLASS_H 00028 #define MODEL_JAVA_CLASS_H 00029 00030 #include "inspectorj/model/javafield.h" 00031 #include "inspectorj/model/javamethod.h" 00032 #include "inspectorj/jdwp/jdwppacket.h" 00033 #include "inspectorj/client/clientpackethandler.h" 00034 #include "inspectorj/toolset/toolsetutils.h" 00035 #include <QtAlgorithms> 00036 00037 namespace inspectorj { 00038 namespace model { 00039 00040 using inspectorj::jdwp::ReferenceTypeID; 00041 using inspectorj::jdwp::JDWPPacket; 00042 using inspectorj::client::ClientPacketHandler; 00043 using inspectorj::model::JavaField; 00044 using inspectorj::toolset::ToolSetUtils; 00045 00052 class JavaClass : public QObject 00053 { 00054 00055 Q_OBJECT 00056 00057 public: 00058 JavaClass(); 00059 JavaClass(const JavaClass&); 00060 00061 ~JavaClass(); 00062 00063 jbyte getRefTypeTag(); 00064 ReferenceTypeID& getRefTypeId(); 00065 QString getJNIClassSignature(); 00066 QString getClassSignature() const; 00067 QList<JavaField*>& getFields(); 00068 QList<JavaMethod*>& getMethods(); 00069 int getStatus(); 00070 00071 void setRefTypeTag(jbyte); 00072 void setRefTypeId(ReferenceTypeID); 00073 void setJNIClassSignature(QString); 00074 void setClassSignature(QString); 00075 void setStatus(int); 00076 bool isMethodsSet(); 00077 bool isFieldsSet(); 00078 bool isInitialized(); 00079 00080 bool const operator==(const JavaClass& another); 00081 bool operator==(const ReferenceTypeID&); 00082 bool operator<(const JavaClass& rhs); 00083 JavaClass& operator=(const model::JavaClass&); 00084 00085 00086 public slots: 00087 void setFields(JDWPPacket&); 00088 void setMethods(JDWPPacket&); 00089 00090 signals: 00091 void initialized(); 00092 00093 private: 00094 void addField(JavaField*); 00095 void addMethod(JavaMethod*); 00096 00098 jbyte refTypeTag; 00099 00101 ReferenceTypeID refTypeId; 00102 00104 QString jniClassSignature; 00105 00107 QString classSignature; 00108 00110 int status; 00111 00112 QList<JavaField*> fields; 00113 QList<JavaMethod*> methods; 00114 00115 bool fieldsSet; 00116 bool methodsSet; 00117 }; 00118 00119 } // end namespace model 00120 } // end namespace inspectorj 00121 00122 #endif //MODEL_JAVA_CLASS_H 00123