|
@@ -24,6 +24,15 @@
|
|
|
|
|
|
|
|
#include "dcClassParameter.h"
|
|
#include "dcClassParameter.h"
|
|
|
|
|
|
|
|
|
|
+#ifdef WITHIN_PANDA
|
|
|
|
|
+#include "pStatTimer.h"
|
|
|
|
|
+
|
|
|
|
|
+#ifndef CPPPARSER
|
|
|
|
|
+PStatCollector DCClass::_update_pcollector("App:Show code:readerPollTask:Update");
|
|
|
|
|
+PStatCollector DCClass::_generate_pcollector("App:Show code:readerPollTask:Generate");
|
|
|
|
|
+#endif // CPPPARSER
|
|
|
|
|
+#endif // WITHIN_PANDA
|
|
|
|
|
+
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: DCClass::Constructor
|
|
// Function: DCClass::Constructor
|
|
|
// Access: Public
|
|
// Access: Public
|
|
@@ -31,6 +40,10 @@
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
DCClass::
|
|
DCClass::
|
|
|
DCClass(const string &name, bool is_struct, bool bogus_class) :
|
|
DCClass(const string &name, bool is_struct, bool bogus_class) :
|
|
|
|
|
+#ifdef WITHIN_PANDA
|
|
|
|
|
+ _class_update_pcollector(_update_pcollector, name),
|
|
|
|
|
+ _class_generate_pcollector(_generate_pcollector, name),
|
|
|
|
|
+#endif
|
|
|
_name(name),
|
|
_name(name),
|
|
|
_is_struct(is_struct),
|
|
_is_struct(is_struct),
|
|
|
_bogus_class(bogus_class)
|
|
_bogus_class(bogus_class)
|
|
@@ -247,32 +260,6 @@ get_inherited_field(int n) const {
|
|
|
return get_field(n);
|
|
return get_field(n);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-////////////////////////////////////////////////////////////////////
|
|
|
|
|
-// Function: DCClass::is_struct
|
|
|
|
|
-// Access: Public
|
|
|
|
|
-// Description: Returns true if the class has been identified with
|
|
|
|
|
-// the "struct" keyword in the dc file, false if it was
|
|
|
|
|
-// declared with "dclass".
|
|
|
|
|
-////////////////////////////////////////////////////////////////////
|
|
|
|
|
-bool DCClass::
|
|
|
|
|
-is_struct() const {
|
|
|
|
|
- return _is_struct;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-////////////////////////////////////////////////////////////////////
|
|
|
|
|
-// Function: DCClass::is_bogus_class
|
|
|
|
|
-// Access: Public
|
|
|
|
|
-// Description: Returns true if the class has been flagged as a bogus
|
|
|
|
|
-// class. This is set for classes that are generated by
|
|
|
|
|
-// the parser as placeholder for missing classes, as
|
|
|
|
|
-// when reading a partial file; it should not occur in a
|
|
|
|
|
-// normal valid dc file.
|
|
|
|
|
-////////////////////////////////////////////////////////////////////
|
|
|
|
|
-bool DCClass::
|
|
|
|
|
-is_bogus_class() const {
|
|
|
|
|
- return _bogus_class;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
#ifdef HAVE_PYTHON
|
|
#ifdef HAVE_PYTHON
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: DCClass::has_class_def
|
|
// Function: DCClass::has_class_def
|
|
@@ -331,6 +318,9 @@ get_class_def() const {
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
void DCClass::
|
|
void DCClass::
|
|
|
receive_update(PyObject *distobj, DatagramIterator &di) const {
|
|
receive_update(PyObject *distobj, DatagramIterator &di) const {
|
|
|
|
|
+#ifdef WITHIN_PANDA
|
|
|
|
|
+ PStatTimer timer(((DCClass *)this)->_class_update_pcollector);
|
|
|
|
|
+#endif
|
|
|
DCPacker packer;
|
|
DCPacker packer;
|
|
|
packer.set_unpack_data(di.get_remaining_bytes());
|
|
packer.set_unpack_data(di.get_remaining_bytes());
|
|
|
|
|
|
|
@@ -356,6 +346,9 @@ receive_update(PyObject *distobj, DatagramIterator &di) const {
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
void DCClass::
|
|
void DCClass::
|
|
|
receive_update_broadcast_required(PyObject *distobj, DatagramIterator &di) const {
|
|
receive_update_broadcast_required(PyObject *distobj, DatagramIterator &di) const {
|
|
|
|
|
+#ifdef WITHIN_PANDA
|
|
|
|
|
+ PStatTimer timer(((DCClass *)this)->_class_update_pcollector);
|
|
|
|
|
+#endif
|
|
|
DCPacker packer;
|
|
DCPacker packer;
|
|
|
packer.set_unpack_data(di.get_remaining_bytes());
|
|
packer.set_unpack_data(di.get_remaining_bytes());
|
|
|
|
|
|
|
@@ -388,6 +381,9 @@ receive_update_broadcast_required(PyObject *distobj, DatagramIterator &di) const
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
void DCClass::
|
|
void DCClass::
|
|
|
receive_update_all_required(PyObject *distobj, DatagramIterator &di) const {
|
|
receive_update_all_required(PyObject *distobj, DatagramIterator &di) const {
|
|
|
|
|
+#ifdef WITHIN_PANDA
|
|
|
|
|
+ PStatTimer timer(((DCClass *)this)->_class_update_pcollector);
|
|
|
|
|
+#endif
|
|
|
DCPacker packer;
|
|
DCPacker packer;
|
|
|
packer.set_unpack_data(di.get_remaining_bytes());
|
|
packer.set_unpack_data(di.get_remaining_bytes());
|
|
|
|
|
|
|
@@ -417,6 +413,9 @@ receive_update_all_required(PyObject *distobj, DatagramIterator &di) const {
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
void DCClass::
|
|
void DCClass::
|
|
|
receive_update_other(PyObject *distobj, DatagramIterator &di) const {
|
|
receive_update_other(PyObject *distobj, DatagramIterator &di) const {
|
|
|
|
|
+#ifdef WITHIN_PANDA
|
|
|
|
|
+ PStatTimer timer(((DCClass *)this)->_class_update_pcollector);
|
|
|
|
|
+#endif
|
|
|
int num_fields = di.get_uint16();
|
|
int num_fields = di.get_uint16();
|
|
|
for (int i = 0; i < num_fields && !PyErr_Occurred(); i++) {
|
|
for (int i = 0; i < num_fields && !PyErr_Occurred(); i++) {
|
|
|
receive_update(distobj, di);
|
|
receive_update(distobj, di);
|