Panda3D

pStatViewLevel.h

00001 // Filename: pStatViewLevel.h
00002 // Created by:  drose (11Jul00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef PSTATVIEWLEVEL_H
00016 #define PSTATVIEWLEVEL_H
00017 
00018 #include "pandatoolbase.h"
00019 
00020 #include "pvector.h"
00021 
00022 class PStatClientData;
00023 
00024 ////////////////////////////////////////////////////////////////////
00025 //       Class : PStatViewLevel
00026 // Description : This is a single level value, or band of color,
00027 //               within a View.
00028 //
00029 //               It generally indicates either the elapsed time, or
00030 //               the "level" value, for a particular Collector within
00031 //               a given frame for a particular thread.
00032 ////////////////////////////////////////////////////////////////////
00033 class PStatViewLevel {
00034 public:
00035   INLINE int get_collector() const;
00036   INLINE double get_value_alone() const;
00037   double get_net_value() const;
00038 
00039   void sort_children(const PStatClientData *client_data);
00040 
00041   int get_num_children() const;
00042   const PStatViewLevel *get_child(int n) const;
00043 
00044 private:
00045   int _collector;
00046   double _value_alone;
00047   PStatViewLevel *_parent;
00048 
00049   typedef pvector<PStatViewLevel *> Children;
00050   Children _children;
00051 
00052   friend class PStatView;
00053 };
00054 
00055 #include "pStatViewLevel.I"
00056 
00057 #endif
 All Classes Functions Variables Enumerations