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 // $Id: event.h 1348 2013-08-16 00:45:07Z secanell $
3 //
4 // Copyright (C) 2006, 2007, 2008, 2009 by Guido Kanschat.
5 // Copyright (C) 2012 by Valentin N. Zingan, University of Alberta.
6 //
7 // This file is subject to QPL and may not be distributed
8 // without copyright and license information. Please refer
9 // to the file deal.II/doc/license.html for the text and
10 // further information on this license.
11 // ------------------------------------------------------------------
12 
13 #ifndef _DEALII_APPFRAME_EVENT_H_
14 #define _DEALII_APPFRAME_EVENT_H_
15 
16 #include <lac/vector_memory.h>
17 #include <lac/block_vector.h>
18 
19 #include <algorithm>
20 #include <fstream>
21 
22 using namespace dealii;
23 
24 namespace AppFrame
25 {
26 
46 class Event
47 {
48 public:
49 
54  Event();
55 
67  static Event assign(const char* name);
68 
72  void all();
73 
77  void clear();
78 
84  bool test(const Event& other) const;
85 
90  bool any() const;
91 
95  Event& operator += (const Event& other);
96 
100  Event& operator -= (const Event& other);
101 
105  template<typename OS>
106  void print(OS& os) const;
107 
111  template<typename OS>
112  static void print_assigned(OS& os);
113 
114 private:
115 
123  bool all_true;
124 
128  std::vector<bool> flags;
129 
133  static std::vector<std::string> names;
134 };
135 
136 }
137 
138 #endif