ug4
parameter_stack.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2015: G-CSC, Goethe University Frankfurt
3  * Author: Sebastian Reiter, Andreas Vogel
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 <cstring>
34 #include "class_name_provider.h"
35 #include "function_traits.h"
36 #include "common/common.h"
38 #include "common/util/variant.h"
39 #ifdef UG_FOR_LUA
41 #endif
42 
43 #ifndef __H__UG_BRIDGE__PARAMETER_STACK__
44 #define __H__UG_BRIDGE__PARAMETER_STACK__
45 
46 #include <iostream>
47 #define untested() ( std::cerr << "@@#\n@@@:"<< __FILE__ << ":"<< __LINE__ \
48  <<":" << __func__ << "\n" )
49 
50 namespace ug
51 {
52 namespace bridge
53 {
54 
57 
59 
73 {
74  protected:
77 
79  static inline int ARRAY_INDEX_TO_STACK_INDEX(int index, int stackSize)
80  {
81  int nIndex = index;
82  if(nIndex < 0)
83  nIndex = stackSize + nIndex;
84 
85  if(nIndex < 0 || nIndex >= stackSize)
86  UG_THROW("Invalid index "<<nIndex<<" used in Parameter Stack.");
87 
88  return nIndex;
89  }
90 
91  public:
94 
96  // info
98 
100  inline int size() const {return m_numEntries;}
101 
103  inline bool is_vector(int index) const{
105  return m_vEntryType[index].bVector;
106  }
107 
109  Variant::Type type(int index) const{
111  return m_vEntryType[index].type;
112  }
113 
115  const ClassNameNode* class_name_node(int index) const{
117  if(m_vEntryType[index].pClassNameNode == NULL)
118  UG_THROW("ClassNameNode missing in Parameter stack.");
119  return m_vEntryType[index].pClassNameNode;
120  }
121 
123  const char* class_name(int index) const{
124  return class_name_node(index)->name().c_str();
125  }
126 
128  bool parameter_named(int index) const{
129  return class_name_node(index)->named();
130  }
131 
133  // push_type
135  protected:
136  template <typename TType, typename TNode>
137  inline void _push_type(){
138  m_vEntryType[m_numEntries].type = Variant::type<TType>();
141  ++m_numEntries;
142  }
143 
144  template <typename TNative>
145  inline void _push_type(){_push_type<TNative,TNative>();}
146 
147  template <typename TType, typename TNode>
148  inline void _push_vector_type(){
149  m_vEntryType[m_numEntries].type = Variant::type<TType>();
152  ++m_numEntries;
153  }
154 
155  template <typename TNative>
156  inline void _push_vector_type(){_push_vector_type<TNative,TNative>();}
157 
158  template <typename T>
159  struct PushType{
160  static void push(ParameterInfo* This){
161  T::___UG_REGISTRY_ERROR___FUNCTION_OR_METHOD_PARAMETERS_RESTRICTED_to__NATIVE_TYPES__or__POINTER_resp_SMARTPOINTER_to_registered_types____();
162  }
163  };
164 
165  public:
167  template <typename T>
168  inline void push_type(){PushType<T>::push(this);}
169 
170  protected:
172  struct EntryType{
174  type(Variant::VT_INVALID), pClassNameNode(NULL), bVector(false)
175  {}
176  Variant::Type type; //< enum ParameterTypes indicating stored type
177  const ClassNameNode* pClassNameNode; //< class name for user defined data
178  bool bVector; //< boolean if vector data
179  };
180 
181  // This array is of fixed size, since we want to introduce a minimal
182  // overhead during argument assignment.
184 
187 };
188 
189 // implementation native types
190 template <> struct ParameterInfo::PushType<bool> {static void push(ParameterInfo* This){This->_push_type<bool>();}};
191 template <> struct ParameterInfo::PushType<int> {static void push(ParameterInfo* This){This->_push_type<int>();}};
192 template <> struct ParameterInfo::PushType<size_t> {static void push(ParameterInfo* This){This->_push_type<size_t>();}};
193 template <> struct ParameterInfo::PushType<float> {static void push(ParameterInfo* This){This->_push_type<float>();}};
194 template <> struct ParameterInfo::PushType<double> {static void push(ParameterInfo* This){This->_push_type<double>();}};
195 template <> struct ParameterInfo::PushType<const char*> {static void push(ParameterInfo* This){This->_push_type<const char*>();}};
196 template <> struct ParameterInfo::PushType<std::string> {static void push(ParameterInfo* This){This->_push_type<std::string>();}};
197 template <> struct ParameterInfo::PushType<const std::string&> {static void push(ParameterInfo* This){This->_push_type<std::string>();}};
198 #ifdef UG_FOR_LUA
199 template <> struct ParameterInfo::PushType<LuaFunctionHandle> {static void push(ParameterInfo* This){This->_push_type<LuaFunctionHandle>();}};
200 template <> struct ParameterInfo::PushType<LuaTableHandle> {static void push(ParameterInfo* This){ This->_push_type<LuaTableHandle>();}};
201 #endif
202 
203 // implementation pointers and references to registered types
204 template <typename TClass> struct ParameterInfo::PushType<TClass*> {static void push(ParameterInfo* This){This->_push_type<void*, TClass>();}};
205 template <typename TClass> struct ParameterInfo::PushType<const TClass*> {static void push(ParameterInfo* This){This->_push_type<const void*, TClass>();}};
206 template <typename TClass> struct ParameterInfo::PushType<TClass&> {static void push(ParameterInfo* This){This->_push_type<void*, TClass>();}};
207 template <typename TClass> struct ParameterInfo::PushType<const TClass&> {static void push(ParameterInfo* This){This->_push_type<const void*, TClass>();}};
208 template <typename TClass> struct ParameterInfo::PushType<SmartPtr<TClass> > {static void push(ParameterInfo* This){This->_push_type<SmartPtr<void>, TClass>();}};
209 template <typename TClass> struct ParameterInfo::PushType<ConstSmartPtr<TClass> > {static void push(ParameterInfo* This){This->_push_type<ConstSmartPtr<void>, TClass>();}};
210 
211 // implementation for std::vector, std::vector& and const std::vector& (native types)
212 template <> struct ParameterInfo::PushType<std::vector<bool> > {static void push(ParameterInfo* This){This->_push_vector_type<bool>();}};
213 template <> struct ParameterInfo::PushType<std::vector<int> > {static void push(ParameterInfo* This){This->_push_vector_type<int>();}};
214 template <> struct ParameterInfo::PushType<std::vector<size_t> > {static void push(ParameterInfo* This){This->_push_vector_type<size_t>();}};
215 template <> struct ParameterInfo::PushType<std::vector<float> > {static void push(ParameterInfo* This){This->_push_vector_type<float>();}};
216 template <> struct ParameterInfo::PushType<std::vector<double> > {static void push(ParameterInfo* This){This->_push_vector_type<double>();}};
217 template <> struct ParameterInfo::PushType<std::vector<const char*> > {static void push(ParameterInfo* This){This->_push_vector_type<const char*>();}};
218 template <> struct ParameterInfo::PushType<std::vector<std::string> > {static void push(ParameterInfo* This){This->_push_vector_type<std::string>();}};
219 
220 /* Note: we do not support non-const references, since the bindings do not support the back-copy into the the binded language
221 template <> struct ParameterInfo::PushType<std::vector<bool>&> {static void push(ParameterInfo* This){This->_push_vector_type<bool>();}};
222 template <> struct ParameterInfo::PushType<std::vector<int>&> {static void push(ParameterInfo* This){This->_push_vector_type<int>();}};
223 template <> struct ParameterInfo::PushType<std::vector<size_t>&> {static void push(ParameterInfo* This){This->_push_vector_type<size_t>();}};
224 template <> struct ParameterInfo::PushType<std::vector<float>&> {static void push(ParameterInfo* This){This->_push_vector_type<float>();}};
225 template <> struct ParameterInfo::PushType<std::vector<double>&> {static void push(ParameterInfo* This){This->_push_vector_type<double>();}};
226 template <> struct ParameterInfo::PushType<std::vector<const char*>&> {static void push(ParameterInfo* This){This->_push_vector_type<const char*>();}};
227 template <> struct ParameterInfo::PushType<std::vector<std::string>&> {static void push(ParameterInfo* This){This->_push_vector_type<std::string>();}};
228 */
229 
230 template <> struct ParameterInfo::PushType<const std::vector<bool>&> {static void push(ParameterInfo* This){This->_push_vector_type<bool>();}};
231 template <> struct ParameterInfo::PushType<const std::vector<int>&> {static void push(ParameterInfo* This){This->_push_vector_type<int>();}};
232 template <> struct ParameterInfo::PushType<const std::vector<size_t>&> {static void push(ParameterInfo* This){This->_push_vector_type<size_t>();}};
233 template <> struct ParameterInfo::PushType<const std::vector<float>&> {static void push(ParameterInfo* This){This->_push_vector_type<float>();}};
234 template <> struct ParameterInfo::PushType<const std::vector<double>&> {static void push(ParameterInfo* This){This->_push_vector_type<double>();}};
235 template <> struct ParameterInfo::PushType<const std::vector<const char*>&> {static void push(ParameterInfo* This){This->_push_vector_type<const char*>();}};
236 template <> struct ParameterInfo::PushType<const std::vector<std::string>&> {static void push(ParameterInfo* This){This->_push_vector_type<std::string>();}};
237 
238 // implementation for std::vector, std::vector& and const std::vector& (registered types)
239 template <typename TClass> struct ParameterInfo::PushType<std::vector<TClass*> > {static void push(ParameterInfo* This){This->_push_vector_type<void*, TClass>();}};
240 //template <typename TClass> struct ParameterInfo::PushType<std::vector<TClass*>& > {static void push(ParameterInfo* This){This->_push_vector_type<void*, TClass>();}};
241 template <typename TClass> struct ParameterInfo::PushType<const std::vector<TClass*>&> {static void push(ParameterInfo* This){This->_push_vector_type<void*, TClass>();}};
242 
243 template <typename TClass> struct ParameterInfo::PushType<std::vector<const TClass*> > {static void push(ParameterInfo* This){This->_push_vector_type<const void*, TClass>();}};
244 //template <typename TClass> struct ParameterInfo::PushType<std::vector<const TClass*>& > {static void push(ParameterInfo* This){This->_push_vector_type<const void*, TClass>();}};
245 template <typename TClass> struct ParameterInfo::PushType<const std::vector<const TClass*>&> {static void push(ParameterInfo* This){This->_push_vector_type<const void*, TClass>();}};
246 
247 template <typename TClass> struct ParameterInfo::PushType<std::vector<SmartPtr<TClass> > > {static void push(ParameterInfo* This){This->_push_vector_type<SmartPtr<void>, TClass>();}};
248 //template <typename TClass> struct ParameterInfo::PushType<std::vector<SmartPtr<TClass> >& > {static void push(ParameterInfo* This){This->_push_vector_type<SmartPtr<void>, TClass>();}};
249 template <typename TClass> struct ParameterInfo::PushType<const std::vector<SmartPtr<TClass> >&> {static void push(ParameterInfo* This){This->_push_vector_type<SmartPtr<void>, TClass>();}};
250 
251 template <typename TClass> struct ParameterInfo::PushType<std::vector<ConstSmartPtr<TClass> > > {static void push(ParameterInfo* This){This->_push_vector_type<ConstSmartPtr<void>, TClass>();}};
252 //template <typename TClass> struct ParameterInfo::PushType<std::vector<ConstSmartPtr<TClass> >& > {static void push(ParameterInfo* This){This->_push_vector_type<ConstSmartPtr<void>, TClass>();}};
253 template <typename TClass> struct ParameterInfo::PushType<const std::vector<ConstSmartPtr<TClass> >&> {static void push(ParameterInfo* This){This->_push_vector_type<ConstSmartPtr<void>, TClass>();}};
254 
255 
258 
270 {
271 
273  // push
275  protected:
283  template <typename T>
284  inline void _push_native(const T& val){
285  this->push_type<T>();
286  m_vEntry[m_numEntries-1] = Variant(val);
287  }
288 
289  template <typename TPtr, typename TType>
290  inline void _push_pointer(TPtr val){
291  this->push_type<TType>();
292  m_vEntry[m_numEntries-1] = Variant(val);
293  }
294 
303  template <typename T>
304  inline void _push_void_pointer(T val, const ClassNameNode* classNameNode){
305  m_vEntry[m_numEntries] = Variant(val);
306  m_vEntryType[m_numEntries].type = Variant::type<T>();
307  m_vEntryType[m_numEntries].pClassNameNode = classNameNode;
309  ++m_numEntries;
310  }
311 
317  template<class T>
318  inline void _push_vector(SmartPtr<std::vector<T> > spVec)
319  {
320  this->push_type<std::vector<T> >();
321  SmartPtr<void> sp = spVec;
322  m_vEntry[m_numEntries-1] = Variant(sp);
323  }
324 
334  template <typename TVoid>
335  inline void _push_void_pointer_vector(SmartPtr<std::vector<std::pair<TVoid, const ClassNameNode*> > > spVec,
336  const ClassNameNode* baseNameNode = NULL){
337  SmartPtr<void> sp = spVec;
339  m_vEntryType[m_numEntries].type = Variant::type<TVoid>();
340  m_vEntryType[m_numEntries].pClassNameNode = baseNameNode;
342  ++m_numEntries;
343  }
344 
353  template <typename TVoid, typename TPtr, typename TNode>
354  inline void _push_pointer_vector(const std::vector<TPtr>& vec){
356  = SmartPtr<std::vector<std::pair<TVoid, const ClassNameNode*> > >(new std::vector<std::pair<TVoid, const ClassNameNode*> >());
357 
358  for(size_t i = 0; i < vec.size(); ++i){
359  spVec->push_back(std::pair<TVoid, const ClassNameNode*>(vec[i], &ClassNameProvider<TNode>::class_name_node()));
360  }
362  }
363 
364  public:
367  inline void push(void* ptr, const ClassNameNode* classNameNode){_push_void_pointer<void*>(ptr, classNameNode);}
368  inline void push(const void* ptr, const ClassNameNode* classNameNode){_push_void_pointer<const void*>(ptr, classNameNode);}
369  inline void push(SmartPtr<void> ptr, const ClassNameNode* classNameNode){_push_void_pointer<SmartPtr<void> >(ptr, classNameNode);}
370  inline void push(ConstSmartPtr<void> ptr, const ClassNameNode* classNameNode){_push_void_pointer<ConstSmartPtr<void> >(ptr, classNameNode);}
372 
375  inline void push(SmartPtr<std::vector<std::pair<void*, const ClassNameNode*> > > spVec){_push_void_pointer_vector<void*>(spVec);}
376  inline void push(SmartPtr<std::vector<std::pair<const void*, const ClassNameNode*> > > spVec){_push_void_pointer_vector<const void*>(spVec);}
377  inline void push(SmartPtr<std::vector<std::pair<SmartPtr<void>, const ClassNameNode*> > > spVec){_push_void_pointer_vector<SmartPtr<void> >(spVec);}
378  inline void push(SmartPtr<std::vector<std::pair<ConstSmartPtr<void>, const ClassNameNode*> > > spVec){_push_void_pointer_vector<ConstSmartPtr<void> >(spVec);}
380 
383  inline void push(SmartPtr<std::vector<bool> > spVec){_push_vector<bool>(spVec);}
384  inline void push(SmartPtr<std::vector<size_t> > spVec){_push_vector<size_t>(spVec);}
385  inline void push(SmartPtr<std::vector<int> > spVec){_push_vector<int>(spVec);}
386  inline void push(SmartPtr<std::vector<float> > spVec){_push_vector<float>(spVec);}
387  inline void push(SmartPtr<std::vector<double> > spVec){_push_vector<double>(spVec);}
388  inline void push(SmartPtr<std::vector<const char*> > spVec){_push_vector<const char*>(spVec);}
389  inline void push(SmartPtr<std::vector<std::string> > spVec){_push_vector<std::string>(spVec);}
391 
392  protected:
393  template <typename T>
394  struct PushType{
395  static void push(ParameterStack* This, T data){
396  T::___UG_REGISTRY_ERROR___FUNCTION_OR_METHOD_PARAMETERS_RESTRICTED_to__NATIVE_TYPES__or__POINTER_resp_SMARTPOINTER_to_registered_types____();
397  }};
398 
399  public:
401  template <typename T>
402  inline void push(T data) {PushType<T>::push(this, data);}
403 
405  // to
407  protected:
409  template <typename T>
410  inline T _to_native(int index) const{
412  return m_vEntry[index].to<T>();
413  }
414 
416 
424  template <typename T, typename TPtr, typename TVoid>
425  inline TPtr _to_pointer(int index) const{
427  const ClassNameNode* pClassNameNode = m_vEntryType[index].pClassNameNode;
428  TPtr ptr = ClassCastProvider::cast_to<T>(m_vEntry[index].to<TVoid>(), pClassNameNode);
429  return ptr;
430  }
431 
433  template <typename T>
434  inline std::vector<T>& _to_native_vector(int index) const{
436  SmartPtr<void> smartPtr = m_vEntry[index].to<SmartPtr<void> >();
437  SmartPtr<std::vector<T> > spVec = smartPtr.cast_reinterpret<std::vector<T>, FreeDelete>();
438  if(spVec.invalid()) UG_THROW("Cannot cast back to std::vector<T> for native type.");
439  return *spVec;
440  }
441 
443  template <typename T, typename TPtr, typename TVoid>
444  inline std::vector<TPtr>& _to_pointer_vector(int index) const{
446  SmartPtr<void> smartPtr = m_vEntry[index].to<SmartPtr<void> >();
447  SmartPtr<std::vector<std::pair<TVoid, const ClassNameNode*> > > spVec = smartPtr.cast_reinterpret<std::vector<std::pair<TVoid, const ClassNameNode*> > , FreeDelete>();
448  if(spVec.invalid()) UG_THROW("Cannot cast back to std::vector<T> for native type.");
449 
450  SmartPtr<std::vector<TPtr> > sp = SmartPtr<std::vector<TPtr> >(new std::vector<TPtr>());
451 
452  for(size_t i = 0; i < spVec->size(); ++i){
453  sp->push_back(ClassCastProvider::cast_to<T>((*spVec)[i].first, (*spVec)[i].second));
454  }
455 
456  const_cast<std::vector<SmartPtr<void> >*>(&m_vStoredSmartPtr)->push_back(sp);
457  return *sp;
458  }
459  std::vector<SmartPtr<void> > m_vStoredSmartPtr;
460 
462  template <typename TPtr>
465  SmartPtr<void> smartPtr = m_vEntry[index].to<SmartPtr<void> >();
466  SmartPtr<std::vector<std::pair<TPtr, const ClassNameNode*> > > spVec = smartPtr.cast_reinterpret<std::vector<std::pair<TPtr, const ClassNameNode*> > , FreeDelete>();
467  if(spVec.invalid()) UG_THROW("Cannot cast back to std::vector<T> for native type.");
468 
469  return spVec;
470  }
471 
472  template <typename T>
473  struct ToType{
474  static T to(const ParameterStack* This, int index){
475  return T::___UG_REGISTRY_ERROR___FUNCTION_OR_METHOD_PARAMETERS_RESTRICTED_to__NATIVE_TYPES__or__POINTER_resp_SMARTPOINTER_to_registered_types____();
476  }};
477 
478  public:
480  template <typename T>
481  inline T to(int index) const {return ToType<T>::to(this, index);}
482 
484  const Variant& get(int index) const {return m_vEntry[index];}
485 
486  private:
489 };
490 
492 // PushType
494 
495 // convert to native types
496 template <> struct ParameterStack::PushType<bool> {static void push(ParameterStack* This, bool data) {This->_push_native<bool>(data);}};
497 template <> struct ParameterStack::PushType<int> {static void push(ParameterStack* This, int data) {This->_push_native<int>(data);}};
498 template <> struct ParameterStack::PushType<size_t> {static void push(ParameterStack* This, size_t data) {This->_push_native<size_t>(data);}};
499 template <> struct ParameterStack::PushType<float> {static void push(ParameterStack* This, float data) {This->_push_native<float>(data);}};
500 template <> struct ParameterStack::PushType<double> {static void push(ParameterStack* This, double data) {This->_push_native<double>(data);}};
501 template <> struct ParameterStack::PushType<const char*> {static void push(ParameterStack* This, const char* data) {This->_push_native<const char*>(data);}};
502 template <> struct ParameterStack::PushType<std::string> {static void push(ParameterStack* This, std::string data){This->_push_native<std::string>(data);}};
503 template <> struct ParameterStack::PushType<const std::string&> {static void push(ParameterStack* This, const std::string& data){This->_push_native<std::string>(data);}};
504 #ifdef UG_FOR_LUA
505 template <> struct ParameterStack::PushType<LuaFunctionHandle> {static void push(ParameterStack* This, LuaFunctionHandle data) {This->_push_native<LuaFunctionHandle>(data);}};
506 template <> struct ParameterStack::PushType<LuaTableHandle> {static void push(ParameterStack* This, LuaTableHandle data) {This->_push_native<LuaTableHandle>(data);}};
507 #endif
508 
509 // convert pointers to native types
510 template <> struct ParameterStack::PushType<std::vector<bool> > {static void push(ParameterStack* This, const std::vector<bool>& spVec) {This->push(SmartPtr<std::vector<bool> >(new std::vector<bool>(spVec)));}};
511 template <> struct ParameterStack::PushType<std::vector<int> > {static void push(ParameterStack* This, const std::vector<int>& spVec) {This->push(SmartPtr<std::vector<int> >(new std::vector<int>(spVec)));}};
512 template <> struct ParameterStack::PushType<std::vector<size_t> > {static void push(ParameterStack* This, const std::vector<size_t>& spVec) {This->push(SmartPtr<std::vector<size_t> >(new std::vector<size_t>(spVec)));}};
513 template <> struct ParameterStack::PushType<std::vector<float> > {static void push(ParameterStack* This, const std::vector<float>& spVec) {This->push(SmartPtr<std::vector<float> >(new std::vector<float>(spVec)));}};
514 template <> struct ParameterStack::PushType<std::vector<double> > {static void push(ParameterStack* This, const std::vector<double>& spVec) {This->push(SmartPtr<std::vector<double> >(new std::vector<double>(spVec)));}};
515 template <> struct ParameterStack::PushType<std::vector<const char*> > {static void push(ParameterStack* This, const std::vector<const char*>& spVec) {This->push(SmartPtr<std::vector<const char*> >(new std::vector<const char*>(spVec)));}};
516 template <> struct ParameterStack::PushType<std::vector<std::string> > {static void push(ParameterStack* This, const std::vector<std::string>& spVec) {This->push(SmartPtr<std::vector<std::string> >(new std::vector<std::string>(spVec)));}};
517 
518 /* Note: we do not support non-const references, since the bindings do not support the back-copy into the the binded language
519 template <> struct ParameterStack::PushType<std::vector<bool>& > {static void push(ParameterStack* This, const std::vector<bool>& spVec) {This->push(SmartPtr<std::vector<bool> >(new std::vector<bool>(spVec)));}};
520 template <> struct ParameterStack::PushType<std::vector<int>& > {static void push(ParameterStack* This, const std::vector<int>& spVec) {This->push(SmartPtr<std::vector<int> >(new std::vector<int>(spVec)));}};
521 template <> struct ParameterStack::PushType<std::vector<size_t>& > {static void push(ParameterStack* This, const std::vector<size_t>& spVec) {This->push(SmartPtr<std::vector<size_t> >(new std::vector<size_t>(spVec)));}};
522 template <> struct ParameterStack::PushType<std::vector<float>& > {static void push(ParameterStack* This, const std::vector<float>& spVec) {This->push(SmartPtr<std::vector<float> >(new std::vector<float>(spVec)));}};
523 template <> struct ParameterStack::PushType<std::vector<double>& > {static void push(ParameterStack* This, const std::vector<double>& spVec) {This->push(SmartPtr<std::vector<double> >(new std::vector<double>(spVec)));}};
524 template <> struct ParameterStack::PushType<std::vector<const char*>& > {static void push(ParameterStack* This, const std::vector<const char*>& spVec) {This->push(SmartPtr<std::vector<const char*> >(new std::vector<const char*>(spVec)));}};
525 template <> struct ParameterStack::PushType<std::vector<std::string>& > {static void push(ParameterStack* This, const std::vector<std::string>& spVec) {This->push(SmartPtr<std::vector<std::string> >(new std::vector<std::string>(spVec)));}};
526 */
527 
528 template <> struct ParameterStack::PushType<const std::vector<bool>& > {static void push(ParameterStack* This, const std::vector<bool>& spVec) {This->push(SmartPtr<std::vector<bool> >(new std::vector<bool>(spVec)));}};
529 template <> struct ParameterStack::PushType<const std::vector<int>& > {static void push(ParameterStack* This, const std::vector<int>& spVec) {This->push(SmartPtr<std::vector<int> >(new std::vector<int>(spVec)));}};
530 template <> struct ParameterStack::PushType<const std::vector<size_t>& > {static void push(ParameterStack* This, const std::vector<size_t>& spVec) {This->push(SmartPtr<std::vector<size_t> >(new std::vector<size_t>(spVec)));}};
531 template <> struct ParameterStack::PushType<const std::vector<float>& > {static void push(ParameterStack* This, const std::vector<float>& spVec) {This->push(SmartPtr<std::vector<float> >(new std::vector<float>(spVec)));}};
532 template <> struct ParameterStack::PushType<const std::vector<double>& > {static void push(ParameterStack* This, const std::vector<double>& spVec) {This->push(SmartPtr<std::vector<double> >(new std::vector<double>(spVec)));}};
533 template <> struct ParameterStack::PushType<const std::vector<const char*>& > {static void push(ParameterStack* This, const std::vector<const char*>& spVec) {This->push(SmartPtr<std::vector<const char*> >(new std::vector<const char*>(spVec)));}};
534 template <> struct ParameterStack::PushType<const std::vector<std::string>& > {static void push(ParameterStack* This, const std::vector<std::string>& spVec) {This->push(SmartPtr<std::vector<std::string> >(new std::vector<std::string>(spVec)));}};
535 
536 // convert push concrete pointer types
537 template <class T> struct ParameterStack::PushType<T*> {static void push(ParameterStack* This, T* data) {This->_push_pointer<void*, T*>(data);}};
538 template <class T> struct ParameterStack::PushType<T&> {static void push(ParameterStack* This, T& data) {PushType<T*>::push(This, &data);}};
539 template <class T> struct ParameterStack::PushType<const T*> {static void push(ParameterStack* This, const T* data) {This->_push_pointer<const void*, const T*>(data);}};
540 template <class T> struct ParameterStack::PushType<const T&> {static void push(ParameterStack* This, const T& data) {PushType<const T*>::push(This, &data);}};
541 template <class T> struct ParameterStack::PushType<SmartPtr<T> > {static void push(ParameterStack* This, SmartPtr<T> data) {This->_push_pointer<SmartPtr<void> , SmartPtr<T> >(data);}};
542 template <class T> struct ParameterStack::PushType<ConstSmartPtr<T> > {static void push(ParameterStack* This, ConstSmartPtr<T> data) {This->_push_pointer<ConstSmartPtr<void>, ConstSmartPtr<T> >(data);}};
543 
544 // convert to std::vector, std::vector& and const std::vector& (registered types)
545 template<class T> struct ParameterStack::PushType<std::vector<T*> > {static void push(ParameterStack* This, const std::vector<T*>& data) {This->_push_pointer_vector<void*, T*, T>(data);}};
546 //template<class T> struct ParameterStack::PushType<std::vector<T*>& > {static void push(ParameterStack* This, const std::vector<T*>& data) {This->_push_pointer_vector<void*, T*, T>(data);}};
547 template<class T> struct ParameterStack::PushType<const std::vector<T*>&> {static void push(ParameterStack* This, const std::vector<T*>& data) {This->_push_pointer_vector<void*, T*, T>(data);}};
548 
549 template<class T> struct ParameterStack::PushType<std::vector<const T*> > {static void push(ParameterStack* This, const std::vector<const T*>& data) {This->_push_pointer_vector<const void*, const T*, T>(data);}};
550 //template<class T> struct ParameterStack::PushType<std::vector<const T*>& > {static void push(ParameterStack* This, const std::vector<const T*>& data) {This->_push_pointer_vector<const void*, const T*, T>(data);}};
551 template<class T> struct ParameterStack::PushType<const std::vector<const T*>&> {static void push(ParameterStack* This, const std::vector<const T*>& data) {This->_push_pointer_vector<const void*, const T*, T>(data);}};
552 
553 template<class T> struct ParameterStack::PushType<std::vector<SmartPtr<T> > > {static void push(ParameterStack* This, const std::vector<SmartPtr<T> >& data) {This->_push_pointer_vector<SmartPtr<void>, SmartPtr<T>, T>(data);}};
554 //template<class T> struct ParameterStack::PushType<std::vector<SmartPtr<T> >& > {static void push(ParameterStack* This, const std::vector<SmartPtr<T> >& data) {This->_push_pointer_vector<SmartPtr<void>, SmartPtr<T>, T>(data);}};
555 template<class T> struct ParameterStack::PushType<const std::vector<SmartPtr<T> >&> {static void push(ParameterStack* This, const std::vector<SmartPtr<T> >& data) {This->_push_pointer_vector<SmartPtr<void>, SmartPtr<T>, T>(data);}};
556 
557 template<class T> struct ParameterStack::PushType<std::vector<ConstSmartPtr<T> > > {static void push(ParameterStack* This, const std::vector<ConstSmartPtr<T> >& data) {This->_push_pointer_vector<ConstSmartPtr<void>, ConstSmartPtr<T>, T>(data);}};
558 //template<class T> struct ParameterStack::PushType<std::vector<ConstSmartPtr<T> >& > {static void push(ParameterStack* This, const std::vector<ConstSmartPtr<T> >& data) {This->_push_pointer_vector<ConstSmartPtr<void>, ConstSmartPtr<T>, T>(data);}};
559 template<class T> struct ParameterStack::PushType<const std::vector<ConstSmartPtr<T> >&>{static void push(ParameterStack* This, const std::vector<ConstSmartPtr<T> >& data) {This->_push_pointer_vector<ConstSmartPtr<void>, ConstSmartPtr<T>, T>(data);}};
560 
561 
563 // ToType
565 
566 // convert to native types
567 template <> struct ParameterStack::ToType<bool> {static bool to(const ParameterStack* This, int index) {return This->_to_native<bool>(index);}};
568 template <> struct ParameterStack::ToType<int> {static int to(const ParameterStack* This, int index) {return This->_to_native<int>(index);}};
569 template <> struct ParameterStack::ToType<size_t> {static size_t to(const ParameterStack* This, int index) {return This->_to_native<size_t>(index);}};
570 template <> struct ParameterStack::ToType<float> {static float to(const ParameterStack* This, int index) {return This->_to_native<float>(index);}};
571 template <> struct ParameterStack::ToType<double> {static double to(const ParameterStack* This, int index) {return This->_to_native<double>(index);}};
572 template <> struct ParameterStack::ToType<const char*> {static const char* to(const ParameterStack* This, int index) {return This->_to_native<const char*>(index);}};
573 template <> struct ParameterStack::ToType<std::string> {static std::string to(const ParameterStack* This, int index) {return This->_to_native<std::string>(index);}};
574 template <> struct ParameterStack::ToType<const std::string&>{static const std::string& to(const ParameterStack* This, int index) {return This->_to_native<const std::string&>(index);}};
575 #ifdef UG_FOR_LUA
576 template <> struct ParameterStack::ToType<LuaFunctionHandle> {static LuaFunctionHandle to(const ParameterStack* This, int index) {return This->_to_native<LuaFunctionHandle>(index);}};
577 template <> struct ParameterStack::ToType<LuaTableHandle> {static LuaTableHandle to(const ParameterStack* This, int index) {return This->_to_native<LuaTableHandle>(index);}};
578 #endif
579 
580 // convert to void types
581 template <> struct ParameterStack::ToType<void*> {static void* to(const ParameterStack* This, int index) {return This->_to_native<void*>(index);}};
582 template <> struct ParameterStack::ToType<const void*> {static const void* to(const ParameterStack* This, int index) {return This->_to_native<const void*>(index);}};
583 template <> struct ParameterStack::ToType<SmartPtr<void> > {static SmartPtr<void> to(const ParameterStack* This, int index) {return This->_to_native<SmartPtr<void> >(index);}};
584 template <> struct ParameterStack::ToType<ConstSmartPtr<void> > {static ConstSmartPtr<void> to(const ParameterStack* This, int index) {return This->_to_native<ConstSmartPtr<void> >(index);}};
585 
586 // convert to concrete pointer types
587 template <class T> struct ParameterStack::ToType<T*> {static T* to(const ParameterStack* This, int index){return This->_to_pointer<T, T*, void*>(index);}};
588 template <class T> struct ParameterStack::ToType<T&> {static T& to(const ParameterStack* This, int index){return *ToType<T*>::to(This, index);}};
589 template <class T> struct ParameterStack::ToType<const T*> {static const T* to(const ParameterStack* This, int index){return This->_to_pointer<T, const T*, const void*>(index);}};
590 template <class T> struct ParameterStack::ToType<const T&> {static const T& to(const ParameterStack* This, int index){return *ToType<const T*>::to(This, index);}};
591 template <class T> struct ParameterStack::ToType<SmartPtr<T> > {static SmartPtr<T> to(const ParameterStack* This, int index){return This->_to_pointer<T, SmartPtr<T>, SmartPtr<void> >(index);}};
592 template <class T> struct ParameterStack::ToType<ConstSmartPtr<T> > {static ConstSmartPtr<T> to(const ParameterStack* This, int index){return This->_to_pointer<T, ConstSmartPtr<T>, ConstSmartPtr<void> >(index);}};
593 
594 // convert to std::vector, std::vector& and const std::vector& (native types)
595 template<> struct ParameterStack::ToType<std::vector<bool> > {static std::vector<bool> to(const ParameterStack* This, int index) {return This->_to_native_vector<bool>(index);}};
596 template<> struct ParameterStack::ToType<std::vector<int> > {static std::vector<int> to(const ParameterStack* This, int index) {return This->_to_native_vector<int>(index);}};
597 template<> struct ParameterStack::ToType<std::vector<size_t> > {static std::vector<size_t> to(const ParameterStack* This, int index) {return This->_to_native_vector<size_t>(index);}};
598 template<> struct ParameterStack::ToType<std::vector<float> > {static std::vector<float> to(const ParameterStack* This, int index) {return This->_to_native_vector<float>(index);}};
599 template<> struct ParameterStack::ToType<std::vector<double> > {static std::vector<double> to(const ParameterStack* This, int index) {return This->_to_native_vector<double>(index);}};
600 template<> struct ParameterStack::ToType<std::vector<const char*> > {static std::vector<const char*> to(const ParameterStack* This, int index) {return This->_to_native_vector<const char*>(index);}};
601 template<> struct ParameterStack::ToType<std::vector<std::string> > {static std::vector<std::string> to(const ParameterStack* This, int index) {return This->_to_native_vector<std::string>(index);}};
602 
603 /* Note: we do not support non-const references, since the bindings do not support the back-copy into the the binded language
604 template<> struct ParameterStack::ToType<std::vector<bool>&> {static std::vector<bool>& to(const ParameterStack* This, int index) {return This->_to_native_vector<bool>(index);}};
605 template<> struct ParameterStack::ToType<std::vector<int>&> {static std::vector<int>& to(const ParameterStack* This, int index) {return This->_to_native_vector<int>(index);}};
606 template<> struct ParameterStack::ToType<std::vector<size_t>&> {static std::vector<size_t>& to(const ParameterStack* This, int index) {return This->_to_native_vector<size_t>(index);}};
607 template<> struct ParameterStack::ToType<std::vector<float>&> {static std::vector<float>& to(const ParameterStack* This, int index) {return This->_to_native_vector<float>(index);}};
608 template<> struct ParameterStack::ToType<std::vector<double>&> {static std::vector<double>& to(const ParameterStack* This, int index) {return This->_to_native_vector<double>(index);}};
609 template<> struct ParameterStack::ToType<std::vector<const char*>&> {static std::vector<const char*>& to(const ParameterStack* This, int index) {return This->_to_native_vector<const char*>(index);}};
610 template<> struct ParameterStack::ToType<std::vector<std::string>&> {static std::vector<std::string>& to(const ParameterStack* This, int index) {return This->_to_native_vector<std::string>(index);}};
611 */
612 
613 template<> struct ParameterStack::ToType<const std::vector<bool>&> {static const std::vector<bool>& to(const ParameterStack* This, int index) {return This->_to_native_vector<bool>(index);}};
614 template<> struct ParameterStack::ToType<const std::vector<int>&> {static const std::vector<int>& to(const ParameterStack* This, int index) {return This->_to_native_vector<int>(index);}};
615 template<> struct ParameterStack::ToType<const std::vector<size_t>&> {static const std::vector<size_t>& to(const ParameterStack* This, int index) {return This->_to_native_vector<size_t>(index);}};
616 template<> struct ParameterStack::ToType<const std::vector<float>&> {static const std::vector<float>& to(const ParameterStack* This, int index) {return This->_to_native_vector<float>(index);}};
617 template<> struct ParameterStack::ToType<const std::vector<double>&> {static const std::vector<double>& to(const ParameterStack* This, int index) {return This->_to_native_vector<double>(index);}};
618 template<> struct ParameterStack::ToType<const std::vector<const char*>&> {static const std::vector<const char*>& to(const ParameterStack* This, int index) {return This->_to_native_vector<const char*>(index);}};
619 template<> struct ParameterStack::ToType<const std::vector<std::string>&> {static const std::vector<std::string>& to(const ParameterStack* This, int index) {return This->_to_native_vector<std::string>(index);}};
620 
621 // convert to std::vector, std::vector& and const std::vector& (registered types)
622 template<class T> struct ParameterStack::ToType<std::vector<T*> >{static std::vector<T*> to(const ParameterStack* This, int index){return This->_to_pointer_vector<T, T*, void*>(index);}};
623 //template<class T> struct ParameterStack::ToType<std::vector<T*>& >{static std::vector<T*>& to(const ParameterStack* This, int index){return This->_to_pointer_vector<T, T*, void*>(index);}};
624 template<class T> struct ParameterStack::ToType<const std::vector<T*>&>{static const std::vector<T*>& to(const ParameterStack* This, int index){return This->_to_pointer_vector<T, T*, void*>(index);}};
625 
626 template<class T> struct ParameterStack::ToType<std::vector<const T*> >{static std::vector<const T*> to(const ParameterStack* This, int index){return This->_to_pointer_vector<T, const T*, const void*>(index);}};
627 //template<class T> struct ParameterStack::ToType<std::vector<const T*>& >{static std::vector<const T*>& to(const ParameterStack* This, int index){return This->_to_pointer_vector<T, const T*, const void*>(index);}};
628 template<class T> struct ParameterStack::ToType<const std::vector<const T*>&>{static const std::vector<const T*>& to(const ParameterStack* This, int index){return This->_to_pointer_vector<T, const T*, const void*>(index);}};
629 
630 template<class T> struct ParameterStack::ToType<std::vector<SmartPtr<T> > >{static std::vector<SmartPtr<T> > to(const ParameterStack* This, int index){return This->_to_pointer_vector<T, SmartPtr<T>, SmartPtr<void> >(index);}};
631 //template<class T> struct ParameterStack::ToType<std::vector<SmartPtr<T> >& >{static std::vector<SmartPtr<T> >& to(const ParameterStack* This, int index){return This->_to_pointer_vector<T, SmartPtr<T>, SmartPtr<void> >(index);}};
632 template<class T> struct ParameterStack::ToType<const std::vector<SmartPtr<T> >&>{static const std::vector<SmartPtr<T> >& to(const ParameterStack* This, int index){return This->_to_pointer_vector<T, SmartPtr<T>, SmartPtr<void> >(index);}};
633 
634 template<class T> struct ParameterStack::ToType<std::vector<ConstSmartPtr<T> > >{static std::vector<ConstSmartPtr<T> > to(const ParameterStack* This, int index){return This->_to_pointer_vector<T, ConstSmartPtr<T>, ConstSmartPtr<void> >(index);}};
635 //template<class T> struct ParameterStack::ToType<std::vector<ConstSmartPtr<T> >& >{static std::vector<ConstSmartPtr<T> >& to(const ParameterStack* This, int index){return This->_to_pointer_vector<T, ConstSmartPtr<T>, ConstSmartPtr<void> >(index);}};
636 template<class T> struct ParameterStack::ToType<const std::vector<ConstSmartPtr<T> >&>{static const std::vector<ConstSmartPtr<T> >& to(const ParameterStack* This, int index){return This->_to_pointer_vector<T, ConstSmartPtr<T>, ConstSmartPtr<void> >(index);}};
637 
638 // convert to std::vector for void pointer (registered types)
639 template<> struct ParameterStack::ToType<SmartPtr<std::vector<std::pair<void*, const ClassNameNode*> > > >{static SmartPtr<std::vector<std::pair<void*, const ClassNameNode*> > > to(const ParameterStack* This, int index){return This->_to_void_pointer_vector<void*>(index);}};
640 template<> struct ParameterStack::ToType<SmartPtr<std::vector<std::pair<const void*, const ClassNameNode*> > > >{static SmartPtr<std::vector<std::pair<const void*, const ClassNameNode*> > > to(const ParameterStack* This, int index){return This->_to_void_pointer_vector<const void*>(index);}};
641 template<> struct ParameterStack::ToType<SmartPtr<std::vector<std::pair<SmartPtr<void>, const ClassNameNode*> > > >{static SmartPtr<std::vector<std::pair<SmartPtr<void>, const ClassNameNode*> > > to(const ParameterStack* This, int index){return This->_to_void_pointer_vector<SmartPtr<void> >(index);}};
642 template<> struct ParameterStack::ToType<SmartPtr<std::vector<std::pair<ConstSmartPtr<void>, const ClassNameNode*> > > >{static SmartPtr<std::vector<std::pair<ConstSmartPtr<void>, const ClassNameNode*> > > to(const ParameterStack* This, int index){return This->_to_void_pointer_vector<ConstSmartPtr<void> >(index);}};
643 
644 // end group registry
646 
647 } // end namespace bridge
648 } // end namespace ug
649 
650 #endif
Definition: smart_pointer.h:650
Definition: smart_pointer.h:296
Definition: smart_pointer.h:51
Definition: smart_pointer.h:525
SmartPtr< T, TFreePolicy > cast_reinterpret() const
Returns a SmartPtr with the specified type and shared reference counting.
Definition: smart_pointer.h:599
Definition: smart_pointer.h:108
bool invalid() const
returns true if the pointer is invalid, false if not.
Definition: smart_pointer.h:212
Handle for a lua reference.
Definition: lua_function_handle.h:40
Handle for a lua reference.
Definition: lua_table_handle.h:49
A variant can represent variables of different types.
Definition: variant.h:87
Type
Definition: variant.h:89
T to() const
node for class names
Definition: class_name_provider.h:65
bool named() const
returns if a name has been set by the user
Definition: class_name_provider.cpp:63
const std::string & name() const
returns own name
Definition: class_name_provider.h:77
provides the name for a class
Definition: class_name_provider.h:102
static const ClassNameNode & class_name_node()
return the class name node in the class hierarchy
Definition: class_name_provider.h:136
a stack holding parameter infos about a parameter stack
Definition: parameter_stack.h:73
int m_numEntries
number of currently stored entries
Definition: parameter_stack.h:186
Variant::Type type(int index) const
returns ParameterType enum of data type for a stack entry
Definition: parameter_stack.h:109
static const int PARAMETER_STACK_MAX_SIZE
maximal number of parameter in a parameter list
Definition: parameter_stack.h:76
void _push_type()
Definition: parameter_stack.h:137
bool is_vector(int index) const
returns if index is a std::vector
Definition: parameter_stack.h:103
void _push_vector_type()
Definition: parameter_stack.h:156
bool parameter_named(int index) const
returns true if a parameter of the stack has been named by user
Definition: parameter_stack.h:128
ParameterInfo()
default constructor
Definition: parameter_stack.h:93
EntryType m_vEntryType[PARAMETER_STACK_MAX_SIZE]
Definition: parameter_stack.h:183
void push_type()
pushes a type to the parameter stack
Definition: parameter_stack.h:168
const char * class_name(int index) const
returns the class name for an element in the param stack
Definition: parameter_stack.h:123
const ClassNameNode * class_name_node(int index) const
returns the class name node for an element in the param stack
Definition: parameter_stack.h:115
static int ARRAY_INDEX_TO_STACK_INDEX(int index, int stackSize)
help function to compute correct parameter index
Definition: parameter_stack.h:79
void _push_type()
Definition: parameter_stack.h:145
void _push_vector_type()
Definition: parameter_stack.h:148
int size() const
returns number of parameters in the param stack
Definition: parameter_stack.h:100
A stack that can hold values together with their type-id.
Definition: parameter_stack.h:270
void _push_void_pointer(T val, const ClassNameNode *classNameNode)
Definition: parameter_stack.h:304
void push(SmartPtr< std::vector< const char * > > spVec)
Definition: parameter_stack.h:388
void push(SmartPtr< std::vector< std::string > > spVec)
Definition: parameter_stack.h:389
void _push_pointer_vector(const std::vector< TPtr > &vec)
Definition: parameter_stack.h:354
Variant m_vEntry[PARAMETER_STACK_MAX_SIZE]
fixed size array storing the data for a stack entry
Definition: parameter_stack.h:488
T to(int index) const
return element in param stack casted to type
Definition: parameter_stack.h:481
std::vector< SmartPtr< void > > m_vStoredSmartPtr
Definition: parameter_stack.h:459
T _to_native(int index) const
return element in param stack casted to native type
Definition: parameter_stack.h:410
void push(SmartPtr< std::vector< float > > spVec)
Definition: parameter_stack.h:386
void push(const void *ptr, const ClassNameNode *classNameNode)
Definition: parameter_stack.h:368
std::vector< T > & _to_native_vector(int index) const
return element in param stack casted to native type vector
Definition: parameter_stack.h:434
void push(ConstSmartPtr< void > ptr, const ClassNameNode *classNameNode)
Definition: parameter_stack.h:370
void push(SmartPtr< std::vector< int > > spVec)
Definition: parameter_stack.h:385
SmartPtr< std::vector< std::pair< TPtr, const ClassNameNode * > > > _to_void_pointer_vector(int index) const
return element in param stack casted to native type vector
Definition: parameter_stack.h:463
void push(SmartPtr< std::vector< std::pair< ConstSmartPtr< void >, const ClassNameNode * > > > spVec)
Definition: parameter_stack.h:378
void push(void *ptr, const ClassNameNode *classNameNode)
Definition: parameter_stack.h:367
void push(SmartPtr< std::vector< std::pair< SmartPtr< void >, const ClassNameNode * > > > spVec)
Definition: parameter_stack.h:377
void _push_vector(SmartPtr< std::vector< T > > spVec)
Definition: parameter_stack.h:318
void push(SmartPtr< std::vector< bool > > spVec)
Definition: parameter_stack.h:383
void _push_pointer(TPtr val)
Definition: parameter_stack.h:290
void _push_native(const T &val)
Definition: parameter_stack.h:284
void push(SmartPtr< std::vector< double > > spVec)
Definition: parameter_stack.h:387
void push(SmartPtr< std::vector< std::pair< void *, const ClassNameNode * > > > spVec)
Definition: parameter_stack.h:375
void _push_void_pointer_vector(SmartPtr< std::vector< std::pair< TVoid, const ClassNameNode * > > > spVec, const ClassNameNode *baseNameNode=NULL)
Definition: parameter_stack.h:335
std::vector< TPtr > & _to_pointer_vector(int index) const
return element in param stack casted to native type vector
Definition: parameter_stack.h:444
TPtr _to_pointer(int index) const
returns element in param stack casted to pointer type
Definition: parameter_stack.h:425
void push(T data)
return element in param stack casted to type
Definition: parameter_stack.h:402
const Variant & get(int index) const
return element in param stack as plain variant
Definition: parameter_stack.h:484
void push(SmartPtr< void > ptr, const ClassNameNode *classNameNode)
Definition: parameter_stack.h:369
void push(SmartPtr< std::vector< size_t > > spVec)
Definition: parameter_stack.h:384
void push(SmartPtr< std::vector< std::pair< const void *, const ClassNameNode * > > > spVec)
Definition: parameter_stack.h:376
const int UG_REGISTRY_MAX_NUM_ARGS
Definition: function_traits.h:46
#define UG_THROW(msg)
Definition: error.h:57
Definition: smart_pointer.h:814
the ug namespace
structure to store a data entry with additional information
Definition: parameter_stack.h:172
const ClassNameNode * pClassNameNode
Definition: parameter_stack.h:177
bool bVector
Definition: parameter_stack.h:178
Variant::Type type
Definition: parameter_stack.h:176
EntryType()
Definition: parameter_stack.h:173
static void push(ParameterInfo *This)
Definition: parameter_stack.h:209
static void push(ParameterInfo *This)
Definition: parameter_stack.h:208
static void push(ParameterInfo *This)
Definition: parameter_stack.h:204
static void push(ParameterInfo *This)
Definition: parameter_stack.h:206
static void push(ParameterInfo *This)
Definition: parameter_stack.h:190
static void push(ParameterInfo *This)
Definition: parameter_stack.h:205
static void push(ParameterInfo *This)
Definition: parameter_stack.h:207
static void push(ParameterInfo *This)
Definition: parameter_stack.h:195
static void push(ParameterInfo *This)
Definition: parameter_stack.h:197
static void push(ParameterInfo *This)
Definition: parameter_stack.h:253
static void push(ParameterInfo *This)
Definition: parameter_stack.h:249
static void push(ParameterInfo *This)
Definition: parameter_stack.h:241
static void push(ParameterInfo *This)
Definition: parameter_stack.h:230
static void push(ParameterInfo *This)
Definition: parameter_stack.h:245
static void push(ParameterInfo *This)
Definition: parameter_stack.h:235
static void push(ParameterInfo *This)
Definition: parameter_stack.h:234
static void push(ParameterInfo *This)
Definition: parameter_stack.h:233
static void push(ParameterInfo *This)
Definition: parameter_stack.h:231
static void push(ParameterInfo *This)
Definition: parameter_stack.h:232
static void push(ParameterInfo *This)
Definition: parameter_stack.h:236
static void push(ParameterInfo *This)
Definition: parameter_stack.h:194
static void push(ParameterInfo *This)
Definition: parameter_stack.h:193
static void push(ParameterInfo *This)
Definition: parameter_stack.h:191
static void push(ParameterInfo *This)
Definition: parameter_stack.h:192
static void push(ParameterInfo *This)
Definition: parameter_stack.h:196
static void push(ParameterInfo *This)
Definition: parameter_stack.h:251
static void push(ParameterInfo *This)
Definition: parameter_stack.h:247
static void push(ParameterInfo *This)
Definition: parameter_stack.h:239
static void push(ParameterInfo *This)
Definition: parameter_stack.h:212
static void push(ParameterInfo *This)
Definition: parameter_stack.h:243
static void push(ParameterInfo *This)
Definition: parameter_stack.h:217
static void push(ParameterInfo *This)
Definition: parameter_stack.h:216
static void push(ParameterInfo *This)
Definition: parameter_stack.h:215
static void push(ParameterInfo *This)
Definition: parameter_stack.h:213
static void push(ParameterInfo *This)
Definition: parameter_stack.h:214
static void push(ParameterInfo *This)
Definition: parameter_stack.h:218
Definition: parameter_stack.h:159
static void push(ParameterInfo *This)
Definition: parameter_stack.h:160
static void push(ParameterStack *This, ConstSmartPtr< T > data)
Definition: parameter_stack.h:542
static void push(ParameterStack *This, SmartPtr< T > data)
Definition: parameter_stack.h:541
static void push(ParameterStack *This, T *data)
Definition: parameter_stack.h:537
static void push(ParameterStack *This, T &data)
Definition: parameter_stack.h:538
static void push(ParameterStack *This, bool data)
Definition: parameter_stack.h:496
static void push(ParameterStack *This, const T *data)
Definition: parameter_stack.h:539
static void push(ParameterStack *This, const T &data)
Definition: parameter_stack.h:540
static void push(ParameterStack *This, const char *data)
Definition: parameter_stack.h:501
static void push(ParameterStack *This, const std::string &data)
Definition: parameter_stack.h:503
static void push(ParameterStack *This, const std::vector< ConstSmartPtr< T > > &data)
Definition: parameter_stack.h:559
static void push(ParameterStack *This, const std::vector< SmartPtr< T > > &data)
Definition: parameter_stack.h:555
static void push(ParameterStack *This, const std::vector< T * > &data)
Definition: parameter_stack.h:547
static void push(ParameterStack *This, const std::vector< bool > &spVec)
Definition: parameter_stack.h:528
static void push(ParameterStack *This, const std::vector< const T * > &data)
Definition: parameter_stack.h:551
static void push(ParameterStack *This, const std::vector< const char * > &spVec)
Definition: parameter_stack.h:533
static void push(ParameterStack *This, const std::vector< double > &spVec)
Definition: parameter_stack.h:532
static void push(ParameterStack *This, const std::vector< float > &spVec)
Definition: parameter_stack.h:531
static void push(ParameterStack *This, const std::vector< int > &spVec)
Definition: parameter_stack.h:529
static void push(ParameterStack *This, const std::vector< size_t > &spVec)
Definition: parameter_stack.h:530
static void push(ParameterStack *This, const std::vector< std::string > &spVec)
Definition: parameter_stack.h:534
static void push(ParameterStack *This, double data)
Definition: parameter_stack.h:500
static void push(ParameterStack *This, float data)
Definition: parameter_stack.h:499
static void push(ParameterStack *This, int data)
Definition: parameter_stack.h:497
static void push(ParameterStack *This, size_t data)
Definition: parameter_stack.h:498
static void push(ParameterStack *This, std::string data)
Definition: parameter_stack.h:502
static void push(ParameterStack *This, const std::vector< ConstSmartPtr< T > > &data)
Definition: parameter_stack.h:557
static void push(ParameterStack *This, const std::vector< SmartPtr< T > > &data)
Definition: parameter_stack.h:553
static void push(ParameterStack *This, const std::vector< T * > &data)
Definition: parameter_stack.h:545
static void push(ParameterStack *This, const std::vector< bool > &spVec)
Definition: parameter_stack.h:510
static void push(ParameterStack *This, const std::vector< const T * > &data)
Definition: parameter_stack.h:549
static void push(ParameterStack *This, const std::vector< const char * > &spVec)
Definition: parameter_stack.h:515
static void push(ParameterStack *This, const std::vector< double > &spVec)
Definition: parameter_stack.h:514
static void push(ParameterStack *This, const std::vector< float > &spVec)
Definition: parameter_stack.h:513
static void push(ParameterStack *This, const std::vector< int > &spVec)
Definition: parameter_stack.h:511
static void push(ParameterStack *This, const std::vector< size_t > &spVec)
Definition: parameter_stack.h:512
static void push(ParameterStack *This, const std::vector< std::string > &spVec)
Definition: parameter_stack.h:516
Definition: parameter_stack.h:394
static void push(ParameterStack *This, T data)
Definition: parameter_stack.h:395
static ConstSmartPtr< T > to(const ParameterStack *This, int index)
Definition: parameter_stack.h:592
static ConstSmartPtr< void > to(const ParameterStack *This, int index)
Definition: parameter_stack.h:584
static SmartPtr< T > to(const ParameterStack *This, int index)
Definition: parameter_stack.h:591
static SmartPtr< std::vector< std::pair< void *, const ClassNameNode * > > > to(const ParameterStack *This, int index)
Definition: parameter_stack.h:639
static SmartPtr< std::vector< std::pair< const void *, const ClassNameNode * > > > to(const ParameterStack *This, int index)
Definition: parameter_stack.h:640
static SmartPtr< std::vector< std::pair< ConstSmartPtr< void >, const ClassNameNode * > > > to(const ParameterStack *This, int index)
Definition: parameter_stack.h:642
static SmartPtr< std::vector< std::pair< SmartPtr< void >, const ClassNameNode * > > > to(const ParameterStack *This, int index)
Definition: parameter_stack.h:641
static SmartPtr< void > to(const ParameterStack *This, int index)
Definition: parameter_stack.h:583
static T * to(const ParameterStack *This, int index)
Definition: parameter_stack.h:587
static T & to(const ParameterStack *This, int index)
Definition: parameter_stack.h:588
static bool to(const ParameterStack *This, int index)
Definition: parameter_stack.h:567
static const T * to(const ParameterStack *This, int index)
Definition: parameter_stack.h:589
static const T & to(const ParameterStack *This, int index)
Definition: parameter_stack.h:590
static const char * to(const ParameterStack *This, int index)
Definition: parameter_stack.h:572
static const std::string & to(const ParameterStack *This, int index)
Definition: parameter_stack.h:574
static const std::vector< ConstSmartPtr< T > > & to(const ParameterStack *This, int index)
Definition: parameter_stack.h:636
static const std::vector< SmartPtr< T > > & to(const ParameterStack *This, int index)
Definition: parameter_stack.h:632
static const std::vector< T * > & to(const ParameterStack *This, int index)
Definition: parameter_stack.h:624
static const std::vector< bool > & to(const ParameterStack *This, int index)
Definition: parameter_stack.h:613
static const std::vector< const T * > & to(const ParameterStack *This, int index)
Definition: parameter_stack.h:628
static const std::vector< const char * > & to(const ParameterStack *This, int index)
Definition: parameter_stack.h:618
static const std::vector< double > & to(const ParameterStack *This, int index)
Definition: parameter_stack.h:617
static const std::vector< float > & to(const ParameterStack *This, int index)
Definition: parameter_stack.h:616
static const std::vector< int > & to(const ParameterStack *This, int index)
Definition: parameter_stack.h:614
static const std::vector< size_t > & to(const ParameterStack *This, int index)
Definition: parameter_stack.h:615
static const std::vector< std::string > & to(const ParameterStack *This, int index)
Definition: parameter_stack.h:619
static const void * to(const ParameterStack *This, int index)
Definition: parameter_stack.h:582
static double to(const ParameterStack *This, int index)
Definition: parameter_stack.h:571
static float to(const ParameterStack *This, int index)
Definition: parameter_stack.h:570
static int to(const ParameterStack *This, int index)
Definition: parameter_stack.h:568
static size_t to(const ParameterStack *This, int index)
Definition: parameter_stack.h:569
static std::string to(const ParameterStack *This, int index)
Definition: parameter_stack.h:573
static std::vector< ConstSmartPtr< T > > to(const ParameterStack *This, int index)
Definition: parameter_stack.h:634
static std::vector< SmartPtr< T > > to(const ParameterStack *This, int index)
Definition: parameter_stack.h:630
static std::vector< T * > to(const ParameterStack *This, int index)
Definition: parameter_stack.h:622
static std::vector< bool > to(const ParameterStack *This, int index)
Definition: parameter_stack.h:595
static std::vector< const T * > to(const ParameterStack *This, int index)
Definition: parameter_stack.h:626
static std::vector< const char * > to(const ParameterStack *This, int index)
Definition: parameter_stack.h:600
static std::vector< double > to(const ParameterStack *This, int index)
Definition: parameter_stack.h:599
static std::vector< float > to(const ParameterStack *This, int index)
Definition: parameter_stack.h:598
static std::vector< int > to(const ParameterStack *This, int index)
Definition: parameter_stack.h:596
static std::vector< size_t > to(const ParameterStack *This, int index)
Definition: parameter_stack.h:597
static std::vector< std::string > to(const ParameterStack *This, int index)
Definition: parameter_stack.h:601
static void * to(const ParameterStack *This, int index)
Definition: parameter_stack.h:581
Definition: parameter_stack.h:473
static T to(const ParameterStack *This, int index)
Definition: parameter_stack.h:474