OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
event.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2006-2009 by Guido Kanschat
6 // Copyright (C) 2006-2014 by Energy Systems Design Laboratory, University of Alberta
7 //
8 // This software is distributed under the MIT License
9 // For more information, see the README file in /doc/LICENSE
10 //
11 // - Class: event.h
12 // - Description: This class implements notifications of applications
13 // - Developers: Guido Kanschat, Texas A&M University
14 // Valentin N. Zingan, University of Alberta
15 // Marc Secanell, University of Alberta
16 // - Id: $Id: event.h 2605 2014-08-15 03:36:44Z secanell $
17 //
18 // ----------------------------------------------------------------------------
19 
20 #ifndef _FUEL_CELL_APPLICATION_CORE_EVENT_H_
21 #define _FUEL_CELL_APPLICATION_CORE_EVENT_H_
22 
23 #include <lac/vector_memory.h>
24 #include <lac/block_vector.h>
25 
26 #include <algorithm>
27 #include <fstream>
28 
29 using namespace dealii;
30 
31 namespace FuelCell
32 {
33 namespace ApplicationCore
34 {
35 
57 class Event
58 {
59 public:
60 
65  Event();
66 
78  static Event assign(const char* name);
79 
83  void all();
84 
88  void clear();
89 
95  bool test(const Event& other) const;
96 
101  bool any() const;
102 
106  Event& operator += (const Event& other);
107 
111  Event& operator -= (const Event& other);
112 
116  template<typename OS>
117  void print(OS& os) const;
118 
122  template<typename OS>
123  static void print_assigned(OS& os);
124 
125 private:
126 
134  bool all_true;
135 
139  std::vector<bool> flags;
140 
144  static std::vector<std::string> names;
145 };
146 
147 } // ApplicationCore
148 
149 } // FuelCell
150 
151 #endif
bool all_true
Sometimes, actions have to be taken by all means.
Definition: event.h:134
static std::vector< std::string > names
The actual list of names of events.
Definition: event.h:144
std::vector< bool > flags
The actual list of events.
Definition: event.h:139
Objects of this kind are used to notify interior applications of changes provoked by an outer loop...
Definition: event.h:57