ug4
|
a stack holding parameter infos about a parameter stack More...
#include <parameter_stack.h>
Public Member Functions | |
const char * | class_name (int index) const |
returns the class name for an element in the param stack More... | |
const ClassNameNode * | class_name_node (int index) const |
returns the class name node for an element in the param stack More... | |
bool | is_vector (int index) const |
returns if index is a std::vector More... | |
bool | parameter_named (int index) const |
returns true if a parameter of the stack has been named by user More... | |
ParameterInfo () | |
default constructor More... | |
template<typename T > | |
void | push_type () |
pushes a type to the parameter stack More... | |
int | size () const |
returns number of parameters in the param stack More... | |
Variant::Type | type (int index) const |
returns ParameterType enum of data type for a stack entry More... | |
Protected Member Functions | |
template<typename TType , typename TNode > | |
void | _push_type () |
template<typename TNative > | |
void | _push_type () |
template<typename TType , typename TNode > | |
void | _push_vector_type () |
template<typename TNative > | |
void | _push_vector_type () |
Static Protected Member Functions | |
static int | ARRAY_INDEX_TO_STACK_INDEX (int index, int stackSize) |
help function to compute correct parameter index More... | |
Protected Attributes | |
int | m_numEntries |
number of currently stored entries More... | |
EntryType | m_vEntryType [PARAMETER_STACK_MAX_SIZE] |
Static Protected Attributes | |
static const int | PARAMETER_STACK_MAX_SIZE = UG_REGISTRY_MAX_NUM_ARGS |
maximal number of parameter in a parameter list More... | |
a stack holding parameter infos about a parameter stack
This class is used to store type informations about the entries in a parameter list.
Note that the maximal number of parameters is specified by the constant PARAMETER_STACK_MAX_SIZE. Please note, that this value should not be unnecessarily high. The appropriate choice is UG_REGISTRY_MAX_NUM_ARGS, since the template-method-wrappers can't take any more parameters.
Supported types are bool, integer, number, const char*, std::string, reference, pointer and smart-pointer. References and pointers are stored in a void*. The user is responsible to associate the correct types.
|
inline |
default constructor
|
inlineprotected |
References ug::bridge::ParameterInfo::EntryType::bVector, ug::bridge::ClassNameProvider< TClass >::class_name_node(), m_numEntries, m_vEntryType, ug::bridge::ParameterInfo::EntryType::pClassNameNode, and ug::bridge::ParameterInfo::EntryType::type.
Referenced by ug::bridge::ParameterInfo::PushType< bool >::push(), ug::bridge::ParameterInfo::PushType< int >::push(), ug::bridge::ParameterInfo::PushType< size_t >::push(), ug::bridge::ParameterInfo::PushType< float >::push(), ug::bridge::ParameterInfo::PushType< double >::push(), ug::bridge::ParameterInfo::PushType< const char * >::push(), ug::bridge::ParameterInfo::PushType< std::string >::push(), ug::bridge::ParameterInfo::PushType< const std::string & >::push(), ug::bridge::ParameterInfo::PushType< TClass * >::push(), ug::bridge::ParameterInfo::PushType< const TClass * >::push(), ug::bridge::ParameterInfo::PushType< TClass & >::push(), ug::bridge::ParameterInfo::PushType< const TClass & >::push(), ug::bridge::ParameterInfo::PushType< SmartPtr< TClass > >::push(), and ug::bridge::ParameterInfo::PushType< ConstSmartPtr< TClass > >::push().
|
inlineprotected |
|
inlineprotected |
References ug::bridge::ParameterInfo::EntryType::bVector, ug::bridge::ClassNameProvider< TClass >::class_name_node(), m_numEntries, m_vEntryType, ug::bridge::ParameterInfo::EntryType::pClassNameNode, and ug::bridge::ParameterInfo::EntryType::type.
Referenced by ug::bridge::ParameterInfo::PushType< std::vector< bool > >::push(), ug::bridge::ParameterInfo::PushType< std::vector< int > >::push(), ug::bridge::ParameterInfo::PushType< std::vector< size_t > >::push(), ug::bridge::ParameterInfo::PushType< std::vector< float > >::push(), ug::bridge::ParameterInfo::PushType< std::vector< double > >::push(), ug::bridge::ParameterInfo::PushType< std::vector< const char * > >::push(), ug::bridge::ParameterInfo::PushType< std::vector< std::string > >::push(), ug::bridge::ParameterInfo::PushType< const std::vector< bool > & >::push(), ug::bridge::ParameterInfo::PushType< const std::vector< int > & >::push(), ug::bridge::ParameterInfo::PushType< const std::vector< size_t > & >::push(), ug::bridge::ParameterInfo::PushType< const std::vector< float > & >::push(), ug::bridge::ParameterInfo::PushType< const std::vector< double > & >::push(), ug::bridge::ParameterInfo::PushType< const std::vector< const char * > & >::push(), ug::bridge::ParameterInfo::PushType< const std::vector< std::string > & >::push(), ug::bridge::ParameterInfo::PushType< std::vector< TClass * > >::push(), ug::bridge::ParameterInfo::PushType< const std::vector< TClass * > & >::push(), ug::bridge::ParameterInfo::PushType< std::vector< const TClass * > >::push(), ug::bridge::ParameterInfo::PushType< const std::vector< const TClass * > & >::push(), ug::bridge::ParameterInfo::PushType< std::vector< SmartPtr< TClass > > >::push(), ug::bridge::ParameterInfo::PushType< const std::vector< SmartPtr< TClass > > & >::push(), ug::bridge::ParameterInfo::PushType< std::vector< ConstSmartPtr< TClass > > >::push(), and ug::bridge::ParameterInfo::PushType< const std::vector< ConstSmartPtr< TClass > > & >::push().
|
inlineprotected |
|
inlinestaticprotected |
help function to compute correct parameter index
References UG_THROW.
Referenced by ug::bridge::ParameterStack::_to_native(), ug::bridge::ParameterStack::_to_native_vector(), ug::bridge::ParameterStack::_to_pointer(), ug::bridge::ParameterStack::_to_pointer_vector(), ug::bridge::ParameterStack::_to_void_pointer_vector(), class_name_node(), is_vector(), and type().
|
inline |
returns the class name for an element in the param stack
References class_name_node(), and ug::bridge::ClassNameNode::name().
Referenced by ug::vrl::compareParamTypes(), ug::bridge::IsClassInParameters(), ug::bridge::LuaStackToParams(), ug::bridge::ParameterToString(), ug::vrl::params2NativeParams(), ug::bridge::ParamStackPointerEntryToLuaStack(), ug::vrl::retVal2NativeParam(), and ug::bridge::WriteLUAObject2().
|
inline |
returns the class name node for an element in the param stack
References ARRAY_INDEX_TO_STACK_INDEX(), m_numEntries, m_vEntryType, ug::bridge::ParameterInfo::EntryType::pClassNameNode, and UG_THROW.
Referenced by class_name(), ug::bridge::IsClassInParameters(), parameter_named(), ug::vrl::params2NativeParams(), and ug::vrl::retVal2NativeParam().
|
inline |
returns if index is a std::vector
References ARRAY_INDEX_TO_STACK_INDEX(), ug::bridge::ParameterInfo::EntryType::bVector, m_numEntries, and m_vEntryType.
Referenced by ug::vrl::compareParamTypes(), ug::vrl::jobjectArray2ParamStack(), ug::bridge::LuaStackToParams(), ug::vrl::param2JObject(), ug::bridge::ParameterToString(), ug::vrl::params2NativeParams(), ug::bridge::ParamsToLuaStack(), and ug::vrl::retVal2NativeParam().
|
inline |
returns true if a parameter of the stack has been named by user
References class_name_node(), and ug::bridge::ClassNameNode::named().
Referenced by ug::bridge::ExportedConstructor::check_consistency(), and ug::bridge::ExportedFunctionBase::check_consistency().
|
inline |
pushes a type to the parameter stack
References ug::bridge::ParameterInfo::PushType< T >::push().
Referenced by ug::bridge::CreateParameterInfo< TTypeList >::create().
|
inline |
returns number of parameters in the param stack
References m_numEntries.
Referenced by ug::bridge::ExportedConstructor::check_consistency(), ug::bridge::ExportedFunctionBase::check_consistency(), ug::vrl::compareParamTypes(), ug::bridge::lua::GetTypeMismatchString(), ug::bridge::IsClassInParameters(), Java_edu_gcsc_vrl_ug_UG__1invokeFunction(), Java_edu_gcsc_vrl_ug_UG__1invokeMethod(), ug::vrl::jobjectArray2ParamStack(), ug::bridge::LuaStackToParams(), ug::bridge::ParamsToLuaStack(), and ug::bridge::PrintParametersOut().
|
inline |
returns ParameterType enum of data type for a stack entry
References ARRAY_INDEX_TO_STACK_INDEX(), m_numEntries, m_vEntryType, and ug::bridge::ParameterInfo::EntryType::type.
Referenced by ug::vrl::compareParamTypes(), ug::bridge::IsClassInParameters(), ug::vrl::jobjectArray2ParamStack(), ug::bridge::LuaStackToParams(), ug::vrl::param2JObject(), ug::bridge::ParameterToString(), ug::vrl::params2NativeParams(), ug::bridge::ParamsToLuaStack(), and ug::vrl::paramType2Int().
|
protected |
number of currently stored entries
Referenced by ug::bridge::ParameterStack::_push_native(), ug::bridge::ParameterStack::_push_pointer(), _push_type(), ug::bridge::ParameterStack::_push_vector(), _push_vector_type(), ug::bridge::ParameterStack::_push_void_pointer(), ug::bridge::ParameterStack::_push_void_pointer_vector(), ug::bridge::ParameterStack::_to_native(), ug::bridge::ParameterStack::_to_native_vector(), ug::bridge::ParameterStack::_to_pointer(), ug::bridge::ParameterStack::_to_pointer_vector(), ug::bridge::ParameterStack::_to_void_pointer_vector(), class_name_node(), is_vector(), size(), and type().
|
protected |
|
staticprotected |
maximal number of parameter in a parameter list