gpufilter
GPU-Efficient Recursive Filtering and Summed-Area Tables
gpufilter::base_timer Class Reference

Base timer class. More...

#include <timer.h>

Inheritance diagram for gpufilter::base_timer:
gpufilter::cpu_timer gpufilter::gpu_timer

List of all members.

Public Member Functions

 base_timer (const char *type_label, size_t data_size=0, const std::string &unit="")
void start ()
 Start counting timing.
void stop ()
 Stop counting timing.
float elapsed ()
 Time elapsed.
bool is_stopped () const
 Check if this timer is not counting timing.
size_t data_size () const
 Data size associated with this timer.
const std::string & unit () const
 Unit of the data associated with this timer.
const char * type_label ()
 Type of this timer.

Protected Member Functions

virtual void do_start ()=0
 Do start this timer.
virtual void do_stop ()=0
 Do stop this timer.
virtual float do_get_elapsed () const =0
 Do get time elapsed by this timer.

Private Member Functions

 base_timer (const base_timer &bt)
 Prevent the assignment declaration by derived classes.
base_timeroperator= (const base_timer &bt)
 Assign operator (deleted)

Private Attributes

const char * m_type_label
 Label for this timer type.
float m_elapsed
 Elapsed time.
bool m_started
 Flag true if this timer is counting timing.
size_t m_data_size
 Data size associated with this timer.
std::string m_unit
 Unit of the associated data.

Detailed Description

Base timer class.

Base timer is the abstract class for timing computation.


Constructor & Destructor Documentation

gpufilter::base_timer::base_timer ( const char *  type_label,
size_t  data_size = 0,
const std::string &  unit = "" 
)

Constructor

Parameters:
[in]type_labelThe label string for this timer type
[in]data_sizeData size associated with this timer
[in]unitThe unit of the associated data
gpufilter::base_timer::base_timer ( const base_timer bt) [private]

Prevent the assignment declaration by derived classes.

Copy Constructor (deleted)

Parameters:
[in]btObject to copy to this object

Member Function Documentation

size_t gpufilter::base_timer::data_size ( ) const [inline]

Data size associated with this timer.

Returns:
The data size associated with this timer
virtual float gpufilter::base_timer::do_get_elapsed ( ) const [protected, pure virtual]

Do get time elapsed by this timer.

Returns:
Time elapsed in seconds

Implemented in gpufilter::cpu_timer, and gpufilter::gpu_timer.

float gpufilter::base_timer::elapsed ( )

Time elapsed.

Returns:
Elapsed time in seconds
bool gpufilter::base_timer::is_stopped ( ) const [inline]

Check if this timer is not counting timing.

Returns:
True if this timer is not counting timing
base_timer& gpufilter::base_timer::operator= ( const base_timer bt) [private]

Assign operator (deleted)

Prevent the assignment declaration by derived classes

Parameters:
[in]btObject to copy from
Returns:
This timer with assigned values
const char* gpufilter::base_timer::type_label ( ) [inline]

Type of this timer.

Returns:
The label string for this timer type
const std::string& gpufilter::base_timer::unit ( ) const [inline]

Unit of the data associated with this timer.

Returns:
The unit of the associated data

The documentation for this class was generated from the following file: