Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/pstatclient/pStatFrameData.h

Go to the documentation of this file.
00001 // Filename: pStatFrameData.h
00002 // Created by:  drose (10Jul00)
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 PSTATFRAMEDATA_H
00020 #define PSTATFRAMEDATA_H
00021 
00022 #include <pandabase.h>
00023 
00024 #include <notify.h>
00025 
00026 #include "pvector.h"
00027 
00028 class Datagram;
00029 class DatagramIterator;
00030 class PStatClientVersion;
00031 
00032 ////////////////////////////////////////////////////////////////////
00033 //       Class : PStatFrameData
00034 // Description : Contains the raw timing and level data for a single
00035 //               frame.  This is a sequence of start/stop events, as
00036 //               well as a table of level values, associated with a
00037 //               number of collectors within a single frame.
00038 ////////////////////////////////////////////////////////////////////
00039 class EXPCL_PANDA PStatFrameData {
00040 public:
00041   INLINE bool is_time_empty() const;
00042   INLINE bool is_level_empty() const;
00043   INLINE bool is_empty() const;
00044   INLINE void clear();
00045 
00046   INLINE void add_start(int index, float time);
00047   INLINE void add_stop(int index, float time);
00048   INLINE void add_level(int index, float level);
00049 
00050   INLINE float get_start() const;
00051   INLINE float get_end() const;
00052   INLINE float get_net_time() const;
00053 
00054   INLINE int get_num_events() const;
00055   INLINE int get_time_collector(int n) const;
00056   INLINE bool is_start(int n) const;
00057   INLINE float get_time(int n) const;
00058 
00059   INLINE int get_num_levels() const;
00060   INLINE int get_level_collector(int n) const;
00061   INLINE float get_level(int n) const;
00062 
00063   void write_datagram(Datagram &destination) const;
00064   void read_datagram(DatagramIterator &source, PStatClientVersion *version);
00065 
00066 private:
00067   class DataPoint {
00068   public:
00069     int _index;
00070     float _value;
00071   };
00072   typedef pvector<DataPoint> Data;
00073 
00074   Data _time_data, _level_data;
00075 };
00076 
00077 #include "pStatFrameData.I"
00078 
00079 #endif
00080 

Generated on Fri May 2 00:43:28 2003 for Panda by doxygen1.3