preCICE v3.2.0
Loading...
Searching...
No Matches
Event Class Reference

#include <Event.hpp>

Collaboration diagram for Event:
[legend]

Classes

struct  Options

Public Types

enum class  State : bool { STOPPED = false , RUNNING = true }
using Clock = std::chrono::steady_clock
 Default clock type. All other chrono types are derived from it.

Public Member Functions

template<typename... Args>
constexpr Options optionsFromTags (Args... args)
template<typename... Args>
 Event (std::string_view eventName, Args... args)
 Event (std::string_view eventName, Options options)
 Event (Event &&)=default
 Event (const Event &other)=delete
Eventoperator= (Event &&)=default
Eventoperator= (const Event &)=delete
 ~Event ()
 Stops the event if it's running and report its times to the EventRegistry.
void start ()
 Starts or restarts a stopped event.
void stop ()
 Stops a running event.
void addData (std::string_view key, int value)
 Adds named integer data, associated to an event.

Public Attributes

std::string name
 Name used to identify the timer. Events of the same name are accumulated to.

Private Attributes

int _eid
int _sid {-1}
State _state = State::STOPPED
bool _fundamental {false}
bool _synchronize {false}

Detailed Description

Represents an event that can be started and stopped.

Also allows to attach data in a key-value format using addData()

The event keeps minimal state. Events are passed to the EventRegistry.

Definition at line 33 of file Event.hpp.

Member Typedef Documentation

◆ Clock

Default clock type. All other chrono types are derived from it.

Definition at line 41 of file Event.hpp.

Member Enumeration Documentation

◆ State

enum class precice::profiling::Event::State : bool
strong
Enumerator
STOPPED 
RUNNING 

Definition at line 35 of file Event.hpp.

Constructor & Destructor Documentation

◆ Event() [1/4]

template<typename... Args>
precice::profiling::Event::Event ( std::string_view eventName,
Args... args )
inline

Definition at line 70 of file Event.hpp.

◆ Event() [2/4]

precice::profiling::Event::Event ( std::string_view eventName,
Options options )

Definition at line 8 of file Event.cpp.

◆ Event() [3/4]

precice::profiling::Event::Event ( Event && )
default

◆ Event() [4/4]

precice::profiling::Event::Event ( const Event & other)
delete

◆ ~Event()

precice::profiling::Event::~Event ( )

Stops the event if it's running and report its times to the EventRegistry.

Definition at line 21 of file Event.cpp.

Member Function Documentation

◆ addData()

void precice::profiling::Event::addData ( std::string_view key,
int value )

Adds named integer data, associated to an event.

Definition at line 62 of file Event.cpp.

◆ operator=() [1/2]

Event & precice::profiling::Event::operator= ( const Event & )
delete

◆ operator=() [2/2]

Event & precice::profiling::Event::operator= ( Event && )
default

◆ optionsFromTags()

template<typename... Args>
Options precice::profiling::Event::optionsFromTags ( Args... args)
inlineconstexpr

Definition at line 61 of file Event.hpp.

◆ start()

void precice::profiling::Event::start ( )

Starts or restarts a stopped event.

Definition at line 28 of file Event.cpp.

◆ stop()

void precice::profiling::Event::stop ( )

Stops a running event.

Definition at line 51 of file Event.cpp.

Member Data Documentation

◆ _eid

int precice::profiling::Event::_eid
private

Definition at line 97 of file Event.hpp.

◆ _fundamental

bool precice::profiling::Event::_fundamental {false}
private

Definition at line 100 of file Event.hpp.

◆ _sid

int precice::profiling::Event::_sid {-1}
private

Definition at line 98 of file Event.hpp.

◆ _state

State precice::profiling::Event::_state = State::STOPPED
private

Definition at line 99 of file Event.hpp.

◆ _synchronize

bool precice::profiling::Event::_synchronize {false}
private

Definition at line 101 of file Event.hpp.

◆ name

std::string precice::profiling::Event::name

Name used to identify the timer. Events of the same name are accumulated to.

Definition at line 44 of file Event.hpp.


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