Ignore:
Timestamp:
06/02/15 20:56:15 (10 years ago)
Author:
epyon
Message:
  • more work on stl
  • fully working vectors!
  • copy & copy_n
  • removal of a lot of std code!
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/core/profiler.hh

    r371 r383  
    2121#if NV_PROFILER
    2222#define NV_PROFILE( tag ) nv::profiler_guard __profile( tag )
     23#define NV_PROFILE_IF( tag, condition ) nv::profiler_condition_guard __profile( tag, condition )
    2324#else
    2425#define NV_PROFILE( tag )
     26#define NV_PROFILE_IF( tag, condition )
    2527#endif
     28
    2629
    2730namespace nv
     
    6871                friend class auto_singleton< profiler >;
    6972                friend class profiler_guard;
     73                friend class profiler_condition_guard;
    7074                void log_report();
    7175        private:
     
    8993        };
    9094
     95        class profiler_condition_guard
     96        {
     97        public:
     98                profiler_condition_guard( string_ref tag, bool condition )
     99                        : m_active( condition )
     100                {
     101                        if ( m_active ) profiler::pointer()->start_profile( tag );
     102                }
     103
     104                ~profiler_condition_guard()
     105                {
     106                        if ( m_active ) profiler::pointer()->stop_profile();
     107                }
     108        private:
     109                bool m_active;
     110        };
     111
    91112} // namespace nv
    92113
Note: See TracChangeset for help on using the changeset viewer.