diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-04-19 14:52:44 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-04-19 14:52:44 -0400 |
commit | 7fbf42dec8bae638b62676c280b3f042f9458057 (patch) | |
tree | 28949f9335c16f4e814bd3607383a24ab770427f /indra/newview/llvoavatar.h | |
parent | adf5b5c1efaed30dc043652b174d76c9088f4b18 (diff) |
Move phase tracking to its own set of classes inside LLViewerStats - simplifies llvoavatar and allows adding such tracking to classes that live outside the avatar lifetime
Diffstat (limited to 'indra/newview/llvoavatar.h')
-rwxr-xr-x | indra/newview/llvoavatar.h | 50 |
1 files changed, 20 insertions, 30 deletions
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 8b72682040..6334c43f8e 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -287,32 +287,10 @@ public: S32 mLastRezzedStatus; - // Tracking progress of active/completed phases for activities like outfit changing. - LLFrameTimer& getPhaseTimer(const std::string& phase_name); - void startPhase(const std::string& phase_name); - void stopPhase(const std::string& phase_name); - void stopAllPhases(); - void clearPhases(); - LLSD dumpPhases(); - static LLViewerStats::StatsAccumulator& getPhaseStats(const std::string& phase_name); - static void recordPhaseStat(const std::string& phase_name, F32 value); - - class ScopedPhaseSetter + LLViewerStats::PhaseMap& getPhases() { - public: - ScopedPhaseSetter(LLVOAvatar* avatar, std::string phase_name): - mAvatar(avatar),mPhaseName(phase_name) - { - if (mAvatar) { mAvatar->startPhase(mPhaseName); } - } - ~ScopedPhaseSetter() - { - if (mAvatar) { mAvatar->stopPhase(mPhaseName); } - } - private: - std::string mPhaseName; - LLVOAvatar* mAvatar; - }; + return mPhases; + } protected: BOOL updateIsFullyLoaded(); @@ -329,14 +307,26 @@ private: LLFrameTimer mFullyLoadedTimer; LLFrameTimer mRuthTimer; - // TODO move all the phase stuff to its down data structure. public: - typedef std::map<std::string,LLViewerStats::StatsAccumulator> phase_stats_t; - typedef std::map<std::string,LLFrameTimer> phase_map_t; + class ScopedPhaseSetter + { + public: + ScopedPhaseSetter(LLVOAvatar *avatarp, std::string phase_name): + mAvatar(avatarp), mPhaseName(phase_name) + { + if (mAvatar) { mAvatar->getPhases().startPhase(mPhaseName); } + } + ~ScopedPhaseSetter() + { + if (mAvatar) { mAvatar->getPhases().stopPhase(mPhaseName); } + } + private: + std::string mPhaseName; + LLVOAvatar* mAvatar; + }; private: - phase_map_t mPhases; - static phase_stats_t sPhaseStats; + LLViewerStats::PhaseMap mPhases; protected: LLFrameTimer mInvisibleTimer; |