getClassMethods: Get descriptions for all methods in a C++ class

Description Usage Arguments Value Author(s) References See Also

Description

This method iterates over the nodes within the translation unit array that are referenced from the class definition node via the 'fncs' attribute in the node. It creates a basic description of the method, capturing the node identifiers for the parameters, return type, etc. To make use of these, they must be resolved at a later point. (See resolveType.)

Usage

1
2
getClassMethods(def, accessMode = c("public", "protected"), existingClasses = list(),
                dropArtificial = TRUE, dropOperators = TRUE, ...)

Arguments

def

the node in the translation unit that gives the definition for the class of interest.

accessMode

a vector identifying whether public, protected and/or private methods should be processed. If this is non-empty, the access attribute of a method node is compared to the elements in this list and if it matches it is included in the return. If this is empty, all method nodes are processed.

existingClasses

currently ignored. This is intended to be a repository or catalog of resolved type definitions to avoid them being re-processed.

dropArtificial

a logical value indicating whether to discard methods that are identified as "artificial", i.e. generated by the compiler rather than explicitly defined in the code.

dropOperators

(logical) include or omit any C++ operator methods such as operator() +.

...

additional arguments passed to nodeIterator and hence possibly onto the function that processes each visited node.

Value

A list with an element for each method declared within the class. The names of the methods are used as names for the list elements.

Each element describes the corresponding method and is of class NativeClassMethod, a simple S3-style class. Each such element has the following fields:

returnType

the index of the node in the translation unit the defines the type of the return value from the method.

parameters

a list of parameters (which may have names for the elements), each giving the index of the nodes defining the parameter.

index

the index of the node defining this method

name

a character vector giving the name of the method.

Author(s)

Duncan Temple Lang <duncan@wald.ucdavis.edu>

References

http://www.omegahat.org/RGCCTranslationUnit

See Also

readTU getClassNodes

resolveType


omegahat/RGCCTranslationUnit documentation built on May 24, 2019, 1:53 p.m.