ug4
class_helper.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2013: G-CSC, Goethe University Frankfurt
3  * Author: Martin Rupp
4  *
5  * This file is part of UG4.
6  *
7  * UG4 is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License version 3 (as published by the
9  * Free Software Foundation) with the following additional attribution
10  * requirements (according to LGPL/GPL v3 §7):
11  *
12  * (1) The following notice must be displayed in the Appropriate Legal Notices
13  * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14  *
15  * (2) The following notice must be displayed at a prominent place in the
16  * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17  *
18  * (3) The following bibliography is recommended for citation and must be
19  * preserved in all covered files:
20  * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21  * parallel geometric multigrid solver on hierarchically distributed grids.
22  * Computing and visualization in science 16, 4 (2013), 151-164"
23  * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24  * flexible software system for simulating pde based models on high performance
25  * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  * GNU Lesser General Public License for more details.
31  */
32 
45 #ifndef __H__UG_BRIDGE__CLASS_HELPER__
46 #define __H__UG_BRIDGE__CLASS_HELPER__
47 
48 #include <string>
49 #include "common/ug_config.h"
50 
51 #include "registry.h"
52 #include "class.h"
53 #include "global_function.h"
54 
55 namespace ug
56 {
57 namespace bridge
58 {
59 
62 
63 // ClassHierarchy
64 //--------------
71 {
72  public:
73  ClassHierarchy() : name(), bGroup(false), subclasses() {}
74 
81  void insert_class(const IExportedClass &c);
82 
90  ClassHierarchy *find_class(const char *name);
91 
92  bool operator < (const ClassHierarchy &other) const
93  {
94  return name < other.name;
95  }
96 
97  void sort();
98 
99  std::string name;
100  bool bGroup;
101  std::vector<ClassHierarchy> subclasses;
102 };
106 UG_API void GetClassHierarchy(ClassHierarchy &hierarchy, const Registry &reg);
107 
112 UG_API std::string FunctionInfo(const Registry &reg, const char *functionname);
113 
114 UG_API std::string FunctionInfo(const ExportedFunctionBase &thefunc, bool isConst=false,
115  const char *classname=NULL, const char *highlightclassname=NULL, bool bPrintHelp=false);
116 UG_API std::string ConstructorInfo(const ExportedConstructor &constr, const char *classname,
117  const char *highlightclassname=NULL);
118 
119 UG_API std::string ClassHierarchyString(const Registry &reg, const char *classname);
120 UG_API std::string ClassInfo(const IExportedClass &c);
121 UG_API std::string ClassInfo(const Registry &reg, const char *classname);
122 UG_API std::string ClassUsageExact(const Registry &reg, const char *classname, bool OutParameters);
123 UG_API const ExportedFunction *FindFunction(const Registry &reg, const char *functionname);
124 UG_API std::string ParameterToString(const ParameterInfo &par, int i);
125 UG_API bool IsClassInParameters(const ParameterInfo &par, const char *classname);
126 
127 // end group registry
129 
130 } // end namespace
131 } // end namespace
132 
133 #endif
location name
Definition: checkpoint_util.lua:128
Class Hierarchy Helper Class for UG Registry This class stores class names and their subclasses.
Definition: class_helper.h:71
bool bGroup
Definition: class_helper.h:100
std::string name
Definition: class_helper.h:99
ClassHierarchy()
Definition: class_helper.h:73
std::vector< ClassHierarchy > subclasses
Definition: class_helper.h:101
describing information for constructor
Definition: class.h:353
Base class for function/method export.
Definition: global_function.h:66
This class describes a wrapper for a c++ - function, that is exported by ug.
Definition: global_function.h:186
Base class for exported Classes.
Definition: class.h:499
a stack holding parameter infos about a parameter stack
Definition: parameter_stack.h:73
Registry for functions and classes that are exported to scripts and visualizations.
Definition: registry.h:138
void GetClassHierarchy(ClassHierarchy &hierarchy, const Registry &reg)
Definition: class_helper.cpp:144
string ClassInfo(const IExportedClass &c)
Prints the (const) method of one class.
Definition: class_helper.cpp:376
string ClassHierarchyString(const Registry &reg, const char *classname)
Definition: class_helper.cpp:168
bool IsClassInParameters(const ParameterInfo &par, const char *classname)
Definition: class_helper.cpp:424
const ExportedFunction * FindFunction(const Registry &reg, const char *functionname)
Definition: class_helper.cpp:347
string ConstructorInfo(const ExportedConstructor &constr, const char *classname, const char *highlightclassname)
Definition: class_helper.cpp:339
string ParameterToString(const ParameterInfo &par, int i)
Gets a description of the i-th parameter of a ParameterStack todo: perhaps this function would be bet...
Definition: class_helper.cpp:213
string ClassUsageExact(const Registry &reg, const char *classname, bool OutParameters)
Definition: class_helper.cpp:446
#define UG_API
Definition: ug_config.h:65
bool operator<(const MathVector< N, T > &v, const MathVector< N, T > &w)
Definition: math_vector.h:541
string FunctionInfo(lua_State *L, bool bComplete, const char *functionName)
prints out information for a lua function (a function defined in lua script)
Definition: info_commands.cpp:399
the ug namespace