|
HDK
|
#include "pxr/pxr.h"#include "pxr/base/tf/api.h"#include "pxr/external/boost/python/dict.hpp"#include "pxr/external/boost/python/tuple.hpp"#include <string>#include <vector>
Include dependency graph for pyArg.h:Go to the source code of this file.
Classes | |
| class | TfPyArg |
Typedefs | |
| typedef std::vector< TfPyArg > | TfPyArgs |
Functions | |
| TF_API std::pair < pxr_boost::python::tuple, pxr_boost::python::dict > | TfPyProcessOptionalArgs (const pxr_boost::python::tuple &args, const pxr_boost::python::dict &kwargs, const TfPyArgs &expectedArgs, bool allowExtraArgs=false) |
| TF_API std::string | TfPyCreateFunctionDocString (const std::string &functionName, const TfPyArgs &requiredArguments=TfPyArgs(), const TfPyArgs &optionalArguments=TfPyArgs(), const std::string &description=std::string()) |
| TF_API std::string TfPyCreateFunctionDocString | ( | const std::string & | functionName, |
| const TfPyArgs & | requiredArguments = TfPyArgs(), |
||
| const TfPyArgs & | optionalArguments = TfPyArgs(), |
||
| const std::string & | description = std::string() |
||
| ) |
Create a doc string for a function with the given functionName, requiredArguments and optionalArguments. An extra description may also be supplied.
| TF_API std::pair<pxr_boost::python::tuple, pxr_boost::python::dict> TfPyProcessOptionalArgs | ( | const pxr_boost::python::tuple & | args, |
| const pxr_boost::python::dict & | kwargs, | ||
| const TfPyArgs & | expectedArgs, | ||
| bool | allowExtraArgs = false |
||
| ) |
Helper function for processing optional arguments given as a tuple of positional arguments and a dictionary of keyword arguments.
This function will match the given positional arguments in args with the ordered list of allowed arguments in optionalArgs. Arguments that are matched up in this way will be stored as (name, value) pairs and merged with kwargs in the returned dictionary.
If allowExtraArgs is false, any unrecognized keyword or positional arguments will cause a Python TypeError to be emitted. Otherwise, unmatched arguments will be added to the returned tuple or dict.