deal.II version GIT relicensing-6834-g5b78e6bcdf 2026-10-01 11:20:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | Related Symbols | List of all members
Algorithms::Event Class Reference

#include <deal.II/base/event.h>

Detailed Description

Objects of this kind are used to notify interior applications of changes provoked by an outer loop. They are handed to the application through Operator::notify() and it is up to the actual application how to handle them.

Event is organized as an extensible binary enumerator. Every class can add its own events using assign(). A typical code example is

class A
{
static Event event;
};
Event A::event = Event::assign("Event for A");
static Event assign(const std::string &name)
Definition event.cc:32

Definition at line 46 of file event.h.

Public Member Functions

 Event ()
 
void clear ()
 
void all ()
 
Event & operator+= (const Event &event)
 
Event & operator-= (const Event &event)
 
bool test (const Event &event) const
 
bool any () const
 
template<class OS >
void print (OS &os) const
 

Static Public Member Functions

static Event assign (const std::string &name)
 
template<class OS >
static void print_assigned (OS &os)
 

Private Attributes

bool all_true
 
std::vector< bool > flags
 

Static Private Attributes

static std::vector< std::string > names
 

Related Symbols

(Note that these are not member symbols.)

template<class OS >
OS & operator<< (OS &o, const Event &e)
 

Constructor & Destructor Documentation

◆ Event()

Algorithms::Event::Event ( )

If you forgot to store the result of assign, here is how to retrieve it knowing the name. Constructor, generating a clear Event.

Definition at line 47 of file event.cc.

Member Function Documentation

◆ assign()

Event Algorithms::Event::assign ( const std::string &  name)
static

This function registers a new event type and assigns a unique identifier to it. The result of this function should be stored for later use.

Definition at line 32 of file event.cc.

◆ clear()

void Algorithms::Event::clear ( )

Clear all flags

Definition at line 54 of file event.cc.

◆ all()

void Algorithms::Event::all ( )

Set all flags

Definition at line 62 of file event.cc.

◆ operator+=()

Event & Algorithms::Event::operator+= ( const Event &  event)
inline

Add the flags of the other event

Definition at line 223 of file event.h.

◆ operator-=()

Event & Algorithms::Event::operator-= ( const Event &  event)
inline

Clear the flags of the other event

Definition at line 239 of file event.h.

◆ test()

bool Algorithms::Event::test ( const Event &  event) const
inline

Test whether all the flags set in the other Event are also set in this one.

Definition at line 183 of file event.h.

◆ any()

bool Algorithms::Event::any ( ) const
inline

Return true if any event is set.

Definition at line 174 of file event.h.

◆ print()

template<class OS >
void Algorithms::Event::print ( OS &  os) const
inline

List the flags to a stream.

Definition at line 263 of file event.h.

◆ print_assigned()

template<class OS >
void Algorithms::Event::print_assigned ( OS &  os)
inlinestatic

List all assigned events.

Definition at line 276 of file event.h.

Friends And Related Symbol Documentation

◆ operator<<()

template<class OS >
OS & operator<< ( OS &  o,
const Event &  e 
)
related

Output shift operator for events. Calls Event::print().

Definition at line 289 of file event.h.

Member Data Documentation

◆ all_true

bool Algorithms::Event::all_true
private

Sometimes, actions have to be taken by all means. Therefore, if this value is true, test() always returns true.

Definition at line 124 of file event.h.

◆ flags

std::vector<bool> Algorithms::Event::flags
private

The actual list of events

Definition at line 129 of file event.h.

◆ names

std::vector< std::string > Algorithms::Event::names
staticprivate

The names of registered events

Definition at line 135 of file event.h.


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