ROSE 0.11.145.192
Public Types | Public Member Functions | Public Attributes | Protected Types | List of all members
Rose::CodeGen::Factory< CRT, API > Class Template Reference

Description

template<typename CRT, typename API>
class Rose::CodeGen::Factory< CRT, API >

constructs expressions and types for the given API

Template Parameters
CRThttps://en.wikipedia.org/wiki/Curiously_recurring_template_pattern
APIa specialization of Rose::CodeGen::API

Definition at line 34 of file Factory.h.

Collaboration diagram for Rose::CodeGen::Factory< CRT, API >:
Collaboration graph
[legend]

Public Types

using factory_t = Factory< CRT, API >
 

Public Member Functions

 Factory (Driver &driver_)
 
template<Object otag, typename... Args>
declaration_t< otag > * instantiate (symbol_t< otag > *API::*obj, SgNamedType *parent, Args... args) const
 Return an instantiation.
 
template<Object otag, typename... Args>
reference_t< otag > * reference (symbol_t< otag > *API::*obj, SgNamedType *parent, Args... args) const
 Return an expression or type referencing the object.
 
template<Object otag, typename... Args>
SgExpressionaccess (symbol_t< otag > *API::*obj, SgExpression *parent, Args... args) const
 Build expression to access a member of the parent expression.
 
template<Object otag, typename... Args>
access_return_t< otag > * access (symbol_t< otag > *API::*obj, SgNamedType *parent, Args... args) const
 Build expression or type to access static member and subtype of the parent type.
 

Public Attributes

Driverdriver
 
API api
 

Protected Types

template<Object otag>
using access_return_t = std::conditional_t< otag==Object::a_class||otag==Object::a_typedef, SgType, SgExpression >
 Select return type for access based on Object type.
 

Member Typedef Documentation

◆ factory_t

template<typename CRT , typename API >
using Rose::CodeGen::Factory< CRT, API >::factory_t = Factory<CRT, API>

Definition at line 36 of file Factory.h.

◆ access_return_t

template<typename CRT , typename API >
template<Object otag>
using Rose::CodeGen::Factory< CRT, API >::access_return_t = std::conditional_t<otag == Object::a_class || otag == Object::a_typedef, SgType, SgExpression>
protected

Select return type for access based on Object type.

Template Parameters
otagmust be one of a_class/a_typedef or a_variable/a_function

Definition at line 144 of file Factory.h.

Constructor & Destructor Documentation

◆ Factory()

template<typename CRT , typename API >
Rose::CodeGen::Factory< CRT, API >::Factory ( Driver driver_)
inline

Definition at line 43 of file Factory.h.

Member Function Documentation

◆ instantiate()

template<typename CRT , typename API >
template<Object otag, typename... Args>
declaration_t< otag > * Rose::CodeGen::Factory< CRT, API >::instantiate ( symbol_t< otag > *API::*  obj,
SgNamedType parent,
Args...  args 
) const
inline

Return an instantiation.

Template Parameters
otagmust be one of a_class/a_typedef/a_variable/a_function
Argstypes of the nodes to use as template arguments (SgType/SgExpression for type/non-type respectively
Parameters
objmust points to a template symbol
argsnodes to use as template arguments
parentis used when called by reference which was called by one of the access methods
Returns
a template instantiation

Definition at line 61 of file Factory.h.

◆ reference()

template<typename CRT , typename API >
template<Object otag, typename... Args>
reference_t< otag > * Rose::CodeGen::Factory< CRT, API >::reference ( symbol_t< otag > *API::*  obj,
SgNamedType parent,
Args...  args 
) const
inline

Return an expression or type referencing the object.

Args are forwarded to instantiate as needed.

Template Parameters
otagmust be one of a_class/a_typedef/a_variable/a_function
Argstypes of template arguments (see instantiate)
Parameters
objpoints to a symbol
argstemplate arguments (see instantiate)
parentis used when called by one of the access methods
Returns
a reference expression

Definition at line 82 of file Factory.h.

◆ access() [1/2]

template<typename CRT , typename API >
template<Object otag, typename... Args>
SgExpression * Rose::CodeGen::Factory< CRT, API >::access ( symbol_t< otag > *API::*  obj,
SgExpression parent,
Args...  args 
) const
inline

Build expression to access a member of the parent expression.

Args are forwarded to instantiate as needed.

Template Parameters
otagmust be one of a_variable/a_function
Argstypes of template arguments (see instantiate)
Parameters
objpoints to a symbol
parent
argstemplate arguments (see instantiate)
Returns
either . or -> operator with parent as lhs and reference(obj, args...) as rhs

Definition at line 113 of file Factory.h.

◆ access() [2/2]

template<typename CRT , typename API >
template<Object otag, typename... Args>
access_return_t< otag > * Rose::CodeGen::Factory< CRT, API >::access ( symbol_t< otag > *API::*  obj,
SgNamedType parent,
Args...  args 
) const
inline

Build expression or type to access static member and subtype of the parent type.

Args are forwarded to instantiate as needed.

otag must be one of a_class/a_typedef or a_variable/a_function Args types of template arguments (see instantiate)

obj points to a symbol lhs args template arguments (see instantiate)

Definition at line 160 of file Factory.h.

Member Data Documentation

◆ driver

template<typename CRT , typename API >
Driver& Rose::CodeGen::Factory< CRT, API >::driver

Definition at line 39 of file Factory.h.

◆ api

template<typename CRT , typename API >
API Rose::CodeGen::Factory< CRT, API >::api

Definition at line 40 of file Factory.h.


The documentation for this class was generated from the following file: