From 4e92e480e06a0a41cd640aaadaa651aafbee5b7c Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 23 Dec 2013 20:46:20 +0000 Subject: [PATCH] Make DatagramIterator typed (ask me if you want to know why) --- panda/src/express/config_express.cxx | 2 ++ panda/src/express/datagramIterator.cxx | 3 ++- panda/src/express/datagramIterator.h | 16 ++++++++++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/panda/src/express/config_express.cxx b/panda/src/express/config_express.cxx index d5a0abcf58..8a37739c32 100644 --- a/panda/src/express/config_express.cxx +++ b/panda/src/express/config_express.cxx @@ -14,6 +14,7 @@ #include "config_express.h" #include "datagram.h" +#include "datagramIterator.h" #include "nodeReferenceCount.h" #include "referenceCount.h" #include "textEncoder.h" @@ -99,6 +100,7 @@ init_libexpress() { initialized = true; Datagram::init_type(); + DatagramIterator::init_type(); Namable::init_type(); NodeReferenceCount::init_type(); ReferenceCount::init_type(); diff --git a/panda/src/express/datagramIterator.cxx b/panda/src/express/datagramIterator.cxx index 898d9dd7dd..c679536931 100644 --- a/panda/src/express/datagramIterator.cxx +++ b/panda/src/express/datagramIterator.cxx @@ -12,10 +12,11 @@ // //////////////////////////////////////////////////////////////////// - #include "datagramIterator.h" #include "pnotify.h" +TypeHandle DatagramIterator::_type_handle; + //////////////////////////////////////////////////////////////////// // Function: DatagramIterator::get_string // Access: Public diff --git a/panda/src/express/datagramIterator.h b/panda/src/express/datagramIterator.h index fbb6d0f867..c30a402453 100644 --- a/panda/src/express/datagramIterator.h +++ b/panda/src/express/datagramIterator.h @@ -28,8 +28,9 @@ // know the correct type and order of each element. //////////////////////////////////////////////////////////////////// class EXPCL_PANDAEXPRESS DatagramIterator { -public: - INLINE void assign(Datagram &datagram, size_t offset = 0); +public: + INLINE void assign(Datagram &datagram, size_t offset = 0); + PUBLISHED: INLINE DatagramIterator(); INLINE DatagramIterator(const Datagram &datagram, size_t offset = 0); @@ -82,6 +83,17 @@ PUBLISHED: private: const Datagram *_datagram; size_t _current_index; + +public: + static TypeHandle get_class_type() { + return _type_handle; + } + static void init_type() { + register_type(_type_handle, "DatagramIterator"); + } + +private: + static TypeHandle _type_handle; }; // These generic functions are primarily for reading a value from a