Plugins
ug_docu_class_description.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2016: 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 
33 #include <iostream>
34 
35 #include <string>
36 #include <vector>
37 #include "bridge/bridge.h"
38 
39 
40 #ifndef __UG__UGDOCUCLASSDESCRIPTION_H__
41 #define __UG__UGDOCUCLASSDESCRIPTION_H__
42 
43 namespace ug
44 {
45 namespace DocuGen
46 {
47 
50 {
51 public:
53  mp_class( klass )
54  , mp_group( NULL )
55  {}
56 
58  mp_class( NULL )
59  , mp_group( group )
60  {}
61 
62  const std::string name() const
63  {
64  if(mp_class) return mp_class->name();
65  else if(mp_group) return mp_group->name();
66  else return " ";
67  }
68 
69  const std::string group_str() const
70  {
71  if(mp_class) return mp_class->group();
72  if(mp_group)
73  {
75  else if(mp_group->num_classes() > 0) return mp_group->get_class(0)->group();
76  else return " ";
77  }
78  else return " ";
79  }
80 
81 
84  std::string tag;
85 };
86 
89 
90 UGDocuClassDescription *GetUGDocuClassDescription(std::vector<UGDocuClassDescription> &classes, const bridge::IExportedClass* c);
91 void GetGroups(std::vector<UGDocuClassDescription> &classes, std::vector<UGDocuClassDescription> &classesAndGroups,
92  std::vector<UGDocuClassDescription> &classesAndGroupsAndImplementations );
93 
94 
95 } // namespace DocuGen
96 } // namespace ug
97 
98 #endif /* __UG__UGDOCUCLASSDESCRIPTION_H__ */
Definition: ug_docu_class_description.h:50
const bridge::ClassGroupDesc * mp_group
Definition: ug_docu_class_description.h:83
UGDocuClassDescription(const bridge::ClassGroupDesc *group)
Definition: ug_docu_class_description.h:57
const std::string group_str() const
Definition: ug_docu_class_description.h:69
std::string tag
Definition: ug_docu_class_description.h:84
UGDocuClassDescription(const bridge::IExportedClass *klass)
Definition: ug_docu_class_description.h:52
const bridge::IExportedClass * mp_class
Definition: ug_docu_class_description.h:82
const std::string name() const
Definition: ug_docu_class_description.h:62
size_t num_classes() const
const std::string & name() const
IExportedClass * get_default_class() const
IExportedClass * get_class(size_t i)
virtual const std::string & name() const=0
virtual const std::string & group() const=0
vector< UGDocuClassDescription > classes
Definition: ugdocu.cpp:111
vector< UGDocuClassDescription > classesAndGroups
Definition: ugdocu.cpp:112
vector< UGDocuClassDescription > classesAndGroupsAndImplementations
Definition: ugdocu.cpp:113
bool NameSortFunction(const UGDocuClassDescription &i, const UGDocuClassDescription &j)
Definition: ug_docu_class_description.cpp:49
bool GroupNameSortFunction(const UGDocuClassDescription &i, const UGDocuClassDescription &j)
Definition: ug_docu_class_description.cpp:54
void GetGroups(std::map< string, UGRegistryGroup > &g)
Definition: ug_docu_class_description.cpp:75
UGDocuClassDescription * GetUGDocuClassDescription(std::vector< UGDocuClassDescription > &classes, const IExportedClass *c)
Definition: ug_docu_class_description.cpp:63