mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
allow PStatCollector output
This commit is contained in:
parent
434a9d5a34
commit
1de3b1d9df
@ -149,6 +149,46 @@ is_valid() const {
|
|||||||
return (_client != (PStatClient *)NULL);
|
return (_client != (PStatClient *)NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: PStatCollector::get_name
|
||||||
|
// Access: Published
|
||||||
|
// Description: Returns the local name of this collector. This is
|
||||||
|
// the rightmost part of the fullname, after the
|
||||||
|
// rightmost colon.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
INLINE string PStatCollector::
|
||||||
|
get_name() const {
|
||||||
|
if (_client != (PStatClient *)NULL) {
|
||||||
|
return _client->get_collector_name(_index);
|
||||||
|
}
|
||||||
|
return string();
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: PStatCollector::get_fullname
|
||||||
|
// Access: Published
|
||||||
|
// Description: Returns the full name of this collector. This
|
||||||
|
// includes the names of all the collector's parents,
|
||||||
|
// concatenated together with colons.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
INLINE string PStatCollector::
|
||||||
|
get_fullname() const {
|
||||||
|
if (_client != (PStatClient *)NULL) {
|
||||||
|
return _client->get_collector_fullname(_index);
|
||||||
|
}
|
||||||
|
return string();
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: PStatCollector::output
|
||||||
|
// Access: Published
|
||||||
|
// Description:
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
INLINE void PStatCollector::
|
||||||
|
output(ostream &out) const {
|
||||||
|
out << "PStatCollector(\"" << get_fullname() << "\")";
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: PStatCollector::is_active
|
// Function: PStatCollector::is_active
|
||||||
// Access: Published
|
// Access: Published
|
||||||
|
@ -69,6 +69,9 @@ PUBLISHED:
|
|||||||
INLINE void operator = (const PStatCollector ©);
|
INLINE void operator = (const PStatCollector ©);
|
||||||
|
|
||||||
INLINE bool is_valid() const;
|
INLINE bool is_valid() const;
|
||||||
|
INLINE string get_name() const;
|
||||||
|
INLINE string get_fullname() const;
|
||||||
|
INLINE void output(ostream &out) const;
|
||||||
|
|
||||||
INLINE bool is_active();
|
INLINE bool is_active();
|
||||||
INLINE bool is_started();
|
INLINE bool is_started();
|
||||||
@ -152,5 +155,12 @@ PUBLISHED:
|
|||||||
|
|
||||||
#include "pStatCollector.I"
|
#include "pStatCollector.I"
|
||||||
|
|
||||||
|
inline ostream &operator << (ostream &out, const PStatCollector &pcol) {
|
||||||
|
#ifdef DO_PSTATS
|
||||||
|
pcol.output(out);
|
||||||
|
#endif // DO_PSTATS
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user