SLAMflex SE  0.1.0
SLAMflex provides detection and tracking of dominant planes for smartphone devices. This plane can then be used to show AR content relative to the plane orientation. The detection of plane is performed in the field of view of the smartphone camera. In subsequent frames it is tracked. The interface returns the plane position and orientation.
Public Member Functions | Private Attributes | List of all members
CVD::SimpleTimer Class Reference

#include <timer.h>

Public Member Functions

 SimpleTimer (const std::string &description, const int &cycles_to_time=1, bool output=true, std::ostream &out=std::cout)
 
 ~SimpleTimer ()
 Destructor. Deletes the internal cvd_timer. More...
 
void click ()
 Begin or end a timing cycle. Automatically calls print() when cycles_to_time cycles are reached. More...
 
void print ()
 
double get_max ()
 Calculate the max cycle time as double. More...
 
double get_min ()
 Calculate the min cycle time as double. More...
 
double get_average ()
 Calculate the average cycle time as double. More...
 

Private Attributes

bool output_info
 
double max
 
double min
 
double average
 
std::string text
 
int period
 
double increment
 
int timings
 
double cumulative_time
 
double time_at_start_of_timing
 
bool timing_started
 
cvd_timerinternal_cvd_timer
 
std::ostream & sout
 
std::deque< double > time_buffer
 

Detailed Description

Provides a simple timer class which uses cvd_timer internally. Statistics (average, max and min cycle time) are kept and output for a number of timing cycles. Cycle times are stored in a std::deque<double> and statistics only calculated when the get or print functions are called.

Definition at line 89 of file timer.h.

Constructor & Destructor Documentation

CVD::SimpleTimer::SimpleTimer ( const std::string &  description,
const int &  cycles_to_time = 1,
bool  output = true,
std::ostream &  out = std::cout 
)
inline

Create a simple timer object.

Parameters
descriptionA string description of what is being timed (used in output)
cycles_to_timeHow many cycles to time before the times are averaged and output (default 1).
outputWhether or not to output timing information. Default is true.
outstd::ostream to send output information to. Default std::cout.

Definition at line 97 of file timer.h.

CVD::SimpleTimer::~SimpleTimer ( )
inline

Destructor. Deletes the internal cvd_timer.

Definition at line 104 of file timer.h.

Member Function Documentation

void CVD::SimpleTimer::click ( )
inline

Begin or end a timing cycle. Automatically calls print() when cycles_to_time cycles are reached.

Definition at line 110 of file timer.h.

double CVD::SimpleTimer::get_average ( )
inline

Calculate the average cycle time as double.

Definition at line 170 of file timer.h.

double CVD::SimpleTimer::get_max ( )
inline

Calculate the max cycle time as double.

Definition at line 146 of file timer.h.

double CVD::SimpleTimer::get_min ( )
inline

Calculate the min cycle time as double.

Definition at line 159 of file timer.h.

void CVD::SimpleTimer::print ( )
inline

Output timing information (average, maximum and minimum times for a set of cycles). Automatically called after cycles_to_time cycles but can be called manually.

Definition at line 132 of file timer.h.

Member Data Documentation

double CVD::SimpleTimer::average
private

Definition at line 183 of file timer.h.

double CVD::SimpleTimer::cumulative_time
private

Definition at line 188 of file timer.h.

double CVD::SimpleTimer::increment
private

Definition at line 186 of file timer.h.

cvd_timer* CVD::SimpleTimer::internal_cvd_timer
private

Definition at line 191 of file timer.h.

double CVD::SimpleTimer::max
private

Definition at line 183 of file timer.h.

double CVD::SimpleTimer::min
private

Definition at line 183 of file timer.h.

bool CVD::SimpleTimer::output_info
private

Definition at line 182 of file timer.h.

int CVD::SimpleTimer::period
private

Definition at line 185 of file timer.h.

std::ostream& CVD::SimpleTimer::sout
private

Definition at line 192 of file timer.h.

std::string CVD::SimpleTimer::text
private

Definition at line 184 of file timer.h.

double CVD::SimpleTimer::time_at_start_of_timing
private

Definition at line 189 of file timer.h.

std::deque<double> CVD::SimpleTimer::time_buffer
private

Definition at line 193 of file timer.h.

bool CVD::SimpleTimer::timing_started
private

Definition at line 190 of file timer.h.

int CVD::SimpleTimer::timings
private

Definition at line 187 of file timer.h.


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