Classes | Functions | Variables
gtwrap.template_instantiator.helpers Namespace Reference

Classes

class  InstantiationHelper
 

Functions

def instantiate_args_list (Sequence[parser.Argument] args_list, Sequence[parser.template.Typename] template_typenames, Sequence instantiations, parser.Typename cpp_typename)
 
def instantiate_name (str original_name, Sequence[parser.Typename] instantiations)
 
def instantiate_return_type (parser.ReturnType return_type, Sequence[parser.template.Typename] template_typenames, Sequence[parser.Typename] instantiations, parser.Typename cpp_typename, 'InstantiatedClass' instantiated_class=None)
 
parser.Type instantiate_type (parser.Type ctype, Sequence[str] template_typenames, Sequence[parser.Typename] instantiations, parser.Typename cpp_typename, 'InstantiatedClass' instantiated_class=None)
 
def is_scoped_template (Sequence[str] template_typenames, str str_arg_typename)
 

Variables

 ClassMembers
 
 InstantiatedMembers
 

Detailed Description

Various helpers for instantiation.

Function Documentation

◆ instantiate_args_list()

def gtwrap.template_instantiator.helpers.instantiate_args_list ( Sequence[parser.Argument]  args_list,
Sequence[parser.template.Typename]  template_typenames,
Sequence  instantiations,
parser.Typename  cpp_typename 
)
Instantiate template typenames in an argument list.
Type with name `This` will be replaced by @p `cpp_typename`.

@param[in] args_list A list of `parser.Argument` to instantiate.
@param[in] template_typenames List of template typenames to instantiate,
    e.g. ['T', 'U', 'V'].
@param[in] instantiations List of specific types to instantiate, each
    associated with each template typename. Each type is a parser.Typename,
    including its name and full namespaces.
@param[in] cpp_typename Full-namespace cpp class name of this instantiation
    to replace for arguments of type named `This`.
@return A new list of parser.Argument which types are replaced with their
    instantiations.

Definition at line 144 of file helpers.py.

◆ instantiate_name()

def gtwrap.template_instantiator.helpers.instantiate_name ( str  original_name,
Sequence[parser.Typename]  instantiations 
)
Concatenate instantiated types with `original_name` to form a new
instantiated name.

NOTE: To avoid conflicts, we should include the instantiation's
namespaces, but that is too verbose.

Definition at line 196 of file helpers.py.

◆ instantiate_return_type()

def gtwrap.template_instantiator.helpers.instantiate_return_type ( parser.ReturnType  return_type,
Sequence[parser.template.Typename]  template_typenames,
Sequence[parser.Typename]  instantiations,
parser.Typename  cpp_typename,
'InstantiatedClass'   instantiated_class = None 
)
Instantiate the return type.

Definition at line 173 of file helpers.py.

◆ instantiate_type()

parser.Type gtwrap.template_instantiator.helpers.instantiate_type ( parser.Type  ctype,
Sequence[str template_typenames,
Sequence[parser.Typename]  instantiations,
parser.Typename  cpp_typename,
'InstantiatedClass'   instantiated_class = None 
)
Instantiate template typename for `ctype`.

Args:
    ctype: The original argument type.
    template_typenames: List of strings representing the templates.
    instantiations: List of the instantiations of the templates in `template_typenames`.
    cpp_typename: Full-namespace cpp class name of this instantiation
        to replace for arguments of type named `This`.
    instiated_class: The instantiated class which, if provided,
        will be used for instantiating `This`.

Returns:
    If `ctype`'s name is in the `template_typenames`, return the
    corresponding type to replace in `instantiations`.
    If ctype name is `This`, return the new typename `cpp_typename`.
    Otherwise, return the original ctype.

Definition at line 31 of file helpers.py.

◆ is_scoped_template()

def gtwrap.template_instantiator.helpers.is_scoped_template ( Sequence[str template_typenames,
str  str_arg_typename 
)
Check if the template given by `str_arg_typename` is a scoped template e.g. T::Value,
and if so, return what template from `template_typenames` and
the corresponding index matches the scoped template correctly.

Definition at line 17 of file helpers.py.

Variable Documentation

◆ ClassMembers

gtwrap.template_instantiator.helpers.ClassMembers

Definition at line 9 of file helpers.py.

◆ InstantiatedMembers

gtwrap.template_instantiator.helpers.InstantiatedMembers

Definition at line 12 of file helpers.py.



gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:16:45