blitzdg
an open-source project aiming to implement parallel discontinuous Galerkin (dg) solvers for common partial differential equations systems using blitz++ for array and tensor manipulations and MPI for distributed parallelism.
contextbase.h
1 
2 // Copyright Joakim Karlsson & Kim Gräsman 2010-2013.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 
7 #ifndef IGLOO_CONTEXT_BASE_H
8 #define IGLOO_CONTEXT_BASE_H
9 
10 namespace igloo {
11 
12  //
13  // This is the base class for all contexts.
14  //
15  struct ContextBase
16  {
17  virtual ~ContextBase() {}
18 
19  virtual void IglooFrameworkSetUp()
20  {}
21 
22  virtual void IglooFrameworkTearDown()
23  {}
24 
25  virtual void SetUp()
26  {
27  }
28 
29  virtual void TearDown()
30  {
31  }
32 
33  static void SetUpContext()
34  {
35  }
36 
37  static void TearDownContext()
38  {
39  }
40 
41  void SetName(const std::string& name)
42  {
43  m_name = name;
44  }
45 
46  std::string Name() const
47  {
48  return m_name;
49  }
50 
51  virtual void SetAttribute(const std::string& name, const char* value) const = 0;
52  virtual const std::string& GetAttribute(const std::string& name) const = 0;
53 
54  private:
55  std::string m_name;
56  };
57 
58 }
59 #endif
Definition: context.h:13
Definition: contextbase.h:15