ug4
|
Macros | |
#define | FUNC_TRAITS_GENERAL_CONST_MEMBER |
#define | FUNC_TRAITS_GENERAL_NON_CONST_MEMBER |
Typedefs | |
typedef boost::function< void(Registry *pReg)> | ug::bridge::FuncRegistryChanged |
declaration of registry callback function. More... | |
Functions | |
template<class TClass > | |
void | ug::bridge::CastAndDelete (const void *ptr) |
Performs a reinterpret cast on the given pointer, then calls delete on it. More... | |
template<> | |
void | ug::bridge::CastAndDelete< void > (const void *ptr) |
string | ug::bridge::ClassHierarchyString (const Registry ®, const char *classname) |
string | ug::bridge::ClassInfo (const IExportedClass &c) |
Prints the (const) method of one class. More... | |
string | ug::bridge::ClassInfo (const Registry ®, const char *classname) |
bool | ug::bridge::ClassNameTreeContains (const ClassNameNode &node, const std::string &name) |
returns if a name is contained in the name tree at node or in base classes More... | |
bool | ug::bridge::ClassNameTreeWay (std::vector< size_t > &vWay, const ClassNameNode &node, const std::string &name) |
bool | ug::bridge::ClassNameVecContains (const std::vector< const char * > &names, const std::string &name) |
returns if a name is contained in the name vector More... | |
string | ug::bridge::ClassUsageExact (const Registry ®, const char *classname, bool OutParameters) |
string | ug::bridge::ConstructorInfo (const ExportedConstructor &constr, const char *classname, const char *highlightclassname) |
template<typename TClass > | |
void | ug::bridge::DestructorProxy (void *obj) |
void | ug::bridge::ExtractClassNameVec (std::vector< const char * > &names, const ClassNameNode &node, bool clearVec=true) |
returns the vector containing all names in the name tree for node and its base classes More... | |
const ExportedFunction * | ug::bridge::FindFunction (const Registry ®, const char *functionname) |
string | ug::bridge::FunctionInfo (const ExportedFunctionBase &thefunc, bool isConst, const char *classname, const char *highlightclassname, bool bPrintHelp) |
string | ug::bridge::FunctionInfo (const Registry ®, const char *functionname) |
void | ug::bridge::GetClassHierarchy (ClassHierarchy &hierarchy, const Registry ®) |
template<typename TClass > | |
const char * | ug::bridge::GetClassName () |
std::string | ug::GetRegistryIdentifierMessage () |
bool | ug::bridge::IsClassInParameters (const ParameterInfo &par, const char *classname) |
bool | ug::IsValidRegistryIdentifier (const std::string &name) |
string | ug::bridge::ParameterToString (const ParameterInfo &par, int i) |
Gets a description of the i-th parameter of a ParameterStack todo: perhaps this function would be better somewhere else like in parameter_stack.cpp. More... | |
template<typename TBase , typename TDerived > | |
void * | ug::bridge::StaticVoidCast (void *DerivVoidPtr) |
static cast function for two classes More... | |
#define FUNC_TRAITS_GENERAL_CONST_MEMBER |
#define FUNC_TRAITS_GENERAL_NON_CONST_MEMBER |
typedef boost::function<void (Registry* pReg)> ug::bridge::FuncRegistryChanged |
declaration of registry callback function.
Allows to notify listeners if the registry changes. Since FuncRegistryChanged is a functor, you can either pass a normal function or a member function of a class (Have a look at boost::bind in the second case).
void ug::bridge::CastAndDelete | ( | const void * | ptr | ) |
Performs a reinterpret cast on the given pointer, then calls delete on it.
|
inline |
References UG_THROW.
UG_API std::string ug::bridge::ClassInfo | ( | const IExportedClass & | c | ) |
Prints the (const) method of one class.
References ug::bridge::FunctionInfo(), ug::bridge::IExportedClass::get_const_method(), ug::bridge::IExportedClass::get_method(), ug::bridge::IExportedClass::is_instantiable(), ug::bridge::IExportedClass::name(), ug::bridge::IExportedClass::num_const_methods(), and ug::bridge::IExportedClass::num_methods().
Referenced by ug::Factory< TBase, TPairSeq >::register_class(), and ug::bridge::UGTypeInfo().
Searches the classname in the Registry and prints info of the class
References ug::bridge::Registry::get_class().
bool ug::bridge::ClassNameTreeContains | ( | const ClassNameNode & | node, |
const std::string & | name | ||
) |
returns if a name is contained in the name tree at node or in base classes
References ug::bridge::ClassNameNode::base_class(), name, ug::bridge::ClassNameNode::name(), and ug::bridge::ClassNameNode::num_base_classes().
Referenced by ug::bridge::lua::LuaParsing< const void * >::checkAndGet(), ug::bridge::lua::LuaParsing< ConstSmartPtr< void > >::checkAndGet(), ug::bridge::lua::LuaParsing< SmartPtr< void > >::checkAndGet(), ug::bridge::lua::LuaParsing< void * >::checkAndGet(), ug::vrl::compareParamTypes(), ug::bridge::ClassNameProvider< TClass >::is_a(), and ug::script::UGIsBaseClass().
bool ug::bridge::ClassNameTreeWay | ( | std::vector< size_t > & | vWay, |
const ClassNameNode & | node, | ||
const std::string & | name | ||
) |
returns an std::vector that contains in reverse order the base class that must be used in the Class Hierarchy to get to the base class
References ug::bridge::ClassNameNode::base_class(), name, ug::bridge::ClassNameNode::name(), and ug::bridge::ClassNameNode::num_base_classes().
Referenced by ug::bridge::ClassCastProvider::cast_to_base_class().
bool ug::bridge::ClassNameVecContains | ( | const std::vector< const char * > & | names, |
const std::string & | name | ||
) |
returns if a name is contained in the name vector
References name.
Referenced by ug::bridge::ClassInstantiations().
UG_API std::string ug::bridge::ClassUsageExact | ( | const Registry & | reg, |
const char * | classname, | ||
bool | OutParameters | ||
) |
reg | Registry |
classname | the class (and only this class) to print usage in functions/member functions of. |
OutParameters |
References ug::bridge::FunctionInfo(), ug::bridge::Registry::get_class(), ug::bridge::IExportedClass::get_const_method(), ug::bridge::Registry::get_function(), ug::bridge::IExportedClass::get_method(), ug::bridge::IsClassInParameters(), ug::bridge::IExportedClass::name(), ug::bridge::Registry::num_classes(), ug::bridge::IExportedClass::num_const_methods(), ug::bridge::Registry::num_functions(), ug::bridge::IExportedClass::num_methods(), ug::bridge::ExportedFunctionBase::params_in(), and ug::bridge::ExportedFunctionBase::params_out().
Referenced by ug::bridge::ClassUsage().
UG_API std::string ug::bridge::ConstructorInfo | ( | const ExportedConstructor & | constr, |
const char * | classname, | ||
const char * | highlightclassname | ||
) |
Prints parameters of the constructor constr. If highlightclassname != NULL, it highlights parameters which implement the highlightclassname class.
References UG_LOG.
Referenced by ug::bridge::lua::LuaConstructor().
void ug::bridge::DestructorProxy | ( | void * | obj | ) |
void ug::bridge::ExtractClassNameVec | ( | std::vector< const char * > & | names, |
const ClassNameNode & | node, | ||
bool | clearVec | ||
) |
returns the vector containing all names in the name tree for node and its base classes
References ug::bridge::ClassNameNode::base_class(), ug::bridge::ClassNameNode::name(), and ug::bridge::ClassNameNode::num_base_classes().
Referenced by ug::vrl::getBaseClassNames(), and ug::bridge::ClassNameProvider< TClass >::names().
UG_API const ExportedFunction * ug::bridge::FindFunction | ( | const Registry & | reg, |
const char * | functionname | ||
) |
References ug::bridge::Registry::get_function(), ug::bridge::ExportedFunctionBase::name(), and ug::bridge::Registry::num_functions().
Referenced by ug::bridge::FunctionInfo(), and ug::bridge::GetLuaGlobals().
UG_API std::string ug::bridge::FunctionInfo | ( | const ExportedFunctionBase & | thefunc, |
bool | isConst, | ||
const char * | classname, | ||
const char * | highlightclassname, | ||
bool | bPrintHelp | ||
) |
Prints parameters of the function thefunc. If highlightclassname != NULL, it highlights parameters which implement the highlightclassname class.
References ug::bridge::ExportedFunctionBase::help(), ug::bridge::ExportedFunctionBase::name(), ug::bridge::PrintParametersOut(), and ug::bridge::ExportedFunctionBase::tooltip().
searches for a function named functionname in the registry and prints it
Finds the class classname in the default ug registry and returns IExportedClass pointer if found, otherwise NULL
References ug::bridge::FindFunction().
Referenced by ug::bridge::ClassInfo(), and ug::bridge::ClassUsageExact().
UG_API void ug::bridge::GetClassHierarchy | ( | ClassHierarchy & | hierarchy, |
const Registry & | reg | ||
) |
inits hierarchy with all classes of UGBridge
References ug::bridge::Registry::get_class(), ug::bridge::ClassHierarchy::insert_class(), ug::bridge::ClassHierarchy::name, ug::bridge::Registry::num_classes(), ug::bridge::ClassHierarchy::sort(), and ug::bridge::ClassHierarchy::subclasses.
Referenced by ug::bridge::ClassHierarchyString().
const char* ug::bridge::GetClassName | ( | ) |
References ug::bridge::ClassNameProvider< TClass >::name().
UG_API std::string ug::GetRegistryIdentifierMessage | ( | ) |
Returns a message describing which registry identifiers are valid and which are not.
Referenced by ug::bridge::Registry::add_and_get_function(), ug::bridge::Registry::add_class_(), ug::bridge::ExportedClass< TClass >::add_method(), and ug::bridge::Registry::get_class_group().
UG_API bool ug::bridge::IsClassInParameters | ( | const ParameterInfo & | par, |
const char * | classname | ||
) |
References ug::bridge::ParameterInfo::class_name(), ug::bridge::ParameterInfo::class_name_node(), ug::bridge::ParameterInfo::size(), and ug::bridge::ParameterInfo::type().
Referenced by ug::bridge::ClassUsageExact().
UG_API bool ug::IsValidRegistryIdentifier | ( | const std::string & | name | ) |
Checks whether the specified name is a valid registry identifier name.
Note: identifiers starting with F_
, C_
, I_
or containing __
(double underscore) or being equal to 'constructor' are invalid.
name | name to check |
true
if the specified name is valid; false
otherwise References ug::Contains(), name, and ug::StartsWith().
Referenced by ug::bridge::Registry::add_and_get_function(), ug::bridge::Registry::add_class_(), ug::bridge::ExportedClass< TClass >::add_method(), and ug::bridge::Registry::get_class_group().
UG_API std::string ug::bridge::ParameterToString | ( | const ParameterInfo & | par, |
int | i | ||
) |
Gets a description of the i-th parameter of a ParameterStack todo: perhaps this function would be better somewhere else like in parameter_stack.cpp.
References ug::bridge::ParameterInfo::class_name(), ug::bridge::ParameterInfo::is_vector(), and ug::bridge::ParameterInfo::type().
Referenced by ug::bridge::ExportedFunctionBase::check_consistency(), ug::bridge::PrintParametersIn(), and ug::bridge::PrintParametersOut().
void* ug::bridge::StaticVoidCast | ( | void * | DerivVoidPtr | ) |
static cast function for two classes