cuIBM
A GPU-based Immersed Boundary Method code
parameterDB.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #include <cstdio>
10 #include <typeinfo>
11 #include <string>
12 #include <map>
13 #include <sstream>
14 #include <iostream>
15 
16 #include "boundaryCondition.h"
17 
18 
23 class property
24 {
25  template <typename T> T getInternal();
26 
27  // hack to get around std::type_info not having a default constructor
28  const std::type_info *type;
29 
30  // 256 bytes of storage for the name of the folder
31  char value[256];
32 
33 public:
38  {
39  memset(value, 0, 256);
40  }
41 
42  // get the value of the property as a given type
43  template <typename T> T get();
44 
45  // set the value of the property given a type
46  template <typename T> void set(T v);
47 
48  // return a string describing the value
49  const char *print();
50 }; // property
51 
52 
57 typedef std::map<std::string, property> componentParameter;
58 
59 
64 typedef std::map<std::string, componentParameter> parameterDB;
Definition of the class boundaryCondition.
std::map< std::string, componentParameter > parameterDB
Map from a string to a componentParameter.
Definition: parameterDB.h:64
char value[256]
Definition: parameterDB.h:31
const std::type_info * type
Definition: parameterDB.h:28
property()
Constructor. Initializes the memory to zero.
Definition: parameterDB.h:37
const char * print()
Returns a string describing the value of property as appropriate.
Definition: parameterDB.cu:96
Stores information about a property in a generic way.
Definition: parameterDB.h:23
std::map< std::string, property > componentParameter
Map from a string to a property object.
Definition: parameterDB.h:57
T getInternal()