Loading...
Searching...
No Matches
Qore::Reflection::AbstractReflectionFunction Class Reference

The abstract base class for Qore functions and class methods. More...

`#include <QC_AbstractReflectionFunction.dox.h>`

Inheritance diagram for Qore::Reflection::AbstractReflectionFunction:

## Public Member Functions

| constructor ()
| Throws an exception if called directly; this class can only be instantiated by builtin subclasses.
list< string > | getCodeFlagList ()
| returns a list of strings of code flags common to all variants for this function
int | getCodeFlags ()
| returns a bitfield of code flags common to all variants for this function
int | getDomain ()
| returns the functional domain common to all variants for this function (for builtin functions only) as a bitfield of Functional Domain Constants
list< string > | getDomainStringList ()
| returns a list of functional domain strings common to all variants for this function (for builtin functions only); an empty list is returned for user functions
*string | getModuleName ()
| Returns the module name providing the function or method or NOTHING if the function or method was not provided by a module.
string | getName ()
| returns the function or method name
bool | isBuiltin ()
| returns True if the function or method is a builtin function or method
bool | isEqual (AbstractReflectionFunction func)
| Returns True if the function or method object passed as an argument is equal to the current object; False if not.
bool | isInjected ()
| returns True if the function or method has been injected as a dependency injection
bool | isMethod ()
| returns True if the object is a method but not a pseudo-method
bool | isPseudoMethod ()
| returns True if the object is a pseudo-method
bool | isUser ()
| returns True if the function or method is a user function or method
int | numVariants ()
| returns the number of variants implemented by the function or method

## Detailed Description

The abstract base class for Qore functions and class methods.

Restrictions:
  Qore::PO_NO_REFLECTION

This class cannot be instantiated directly and also cannot be directly inherited by user-defined classes.

Since
  Qore 0.9.0

## Member Function Documentation

## constructor()

Qore::Reflection::AbstractReflectionFunction::constructor | ( |  | ) |

Throws an exception if called directly; this class can only be instantiated by builtin subclasses.

Exceptions

  ABSTRACTREFLECTIONFUNCTION-CONSTRUCTOR-ERROR | this exception is thrown if this class is constructed directly (also if directly inherited by user classes)

## getCodeFlagList()

list< string > Qore::Reflection::AbstractReflectionFunction::getCodeFlagList | ( |  | ) |

returns a list of strings of code flags common to all variants for this function

Code Flags:
  RET_VALUE_ONLY

Example:
  list<string> l = f.getCodeFlagList();

Returns
  list of strings of code flags common to all variants for this function; possible values are:
  - `"NOOP"`: the variant has the CF_NOOP flag set
  - `"USES_EXTRA_ARGS"`: the variant has the CF_USES_EXTRA_ARGS flag set
  - `"CONSTANT"`: the variant has the CF_CONSTANT flag set
  - `"DEPRECATED"`: the variant has the CF_DEPRECATED flag set
  - `"RET_VALUE_ONLY"`: the variant has the CF_RET_VALUE_ONLY flag set
  - `"RUNTIME_NOOP"`: the variant has the CF_RUNTIME_NOOP flag set

Exceptions

  PROGRAM-ERROR | thrown if the Program object holding the function or method has been destroyed

See also
  getCodeFlags()

Since
  Qore 0.9.5

## getCodeFlags()

int Qore::Reflection::AbstractReflectionFunction::getCodeFlags | ( |  | ) |

returns a bitfield of code flags common to all variants for this function

Code Flags:
  CONSTANT

Example:
  int i = f.getCodeFlags();

Returns
  a bitfield of code flags common to all variants for this function

Exceptions

  PROGRAM-ERROR | thrown if the Program object holding the function or method has been destroyed

See also
  getCodeFlagList()

Since
  Qore 0.9.5

## getDomain()

int Qore::Reflection::AbstractReflectionFunction::getDomain | ( |  | ) |

returns the functional domain common to all variants for this function (for builtin functions only) as a bitfield of Functional Domain Constants

Code Flags:
  RET_VALUE_ONLY

Example:
  int i = f.getDomain();

Returns
  the functional domain common to all variants for this function (for builtin functions only) as a bitfield of Functional Domain Constants

Exceptions

  PROGRAM-ERROR | thrown if the Program object holding the function or method has been destroyed

Note
  user functions always return 0 here; a value is only returned by builtin functions

Since
  Qore 0.9.5

## getDomainStringList()

list< string > Qore::Reflection::AbstractReflectionFunction::getDomainStringList | ( |  | ) |

returns a list of functional domain strings common to all variants for this function (for builtin functions only); an empty list is returned for user functions

Code Flags:
  RET_VALUE_ONLY

Example:
  list<string> l = f.getDomainStringList();

Returns
  a list of functional domain strings common to all variants for this function (for builtin functions only)

Exceptions

  PROGRAM-ERROR | thrown if the Program object holding the function or method has been destroyed

Note
  user functions always return an empty list here

Since
  Qore 0.9.5

## getModuleName()

*string Qore::Reflection::AbstractReflectionFunction::getModuleName | ( |  | ) |

Returns the module name providing the function or method or NOTHING if the function or method was not provided by a module.

Code Flags:
  RET_VALUE_ONLY

Example:
  *string str = f.getModuleName();

Returns
  the module name providing the function or method or NOTHING if the function or method was not provided by a module

Since
  Qore 0.9.5

## getName()

string Qore::Reflection::AbstractReflectionFunction::getName | ( |  | ) |

returns the function or method name

Code Flags:
  RET_VALUE_ONLY

Example:
  string name = f.getName();

Returns
  the function or method name

Exceptions

  PROGRAM-ERROR | thrown if the Program object holding the function or method has been destroyed

## isBuiltin()

bool Qore::Reflection::AbstractReflectionFunction::isBuiltin | ( |  | ) |

returns True if the function or method is a builtin function or method

Code Flags:
  RET_VALUE_ONLY

Example:
  bool b = f.isBuiltin();

Returns
  True if the function or method is a builtin function or method

Exceptions

  PROGRAM-ERROR | thrown if the Program object holding the function or method has been destroyed

Note
  complementary to isUser()

## isEqual()

bool Qore::Reflection::AbstractReflectionFunction::isEqual | ( | AbstractReflectionFunction | func | ) |

Returns True if the function or method object passed as an argument is equal to the current object; False if not.

Code Flags:
  CONSTANT

Example:
  bool b = f1.isEqual(f2);

Parameters

  func | the function or method object to check with the current object for equality

Returns
  True if the object passed as an argument is equal to the current object; False if not

Note
  if this method is called on user functions or methods created from the same source code but in different Program containers, it will return False

## isInjected()

bool Qore::Reflection::AbstractReflectionFunction::isInjected | ( |  | ) |

returns True if the function or method has been injected as a dependency injection

Code Flags:
  RET_VALUE_ONLY

Example:
  bool b = f.isInjected();

Returns
  True if the function or method has been injected as a dependency injection

Exceptions

  PROGRAM-ERROR | thrown if the Program object holding the function or method has been destroyed

## isMethod()

bool Qore::Reflection::AbstractReflectionFunction::isMethod | ( |  | ) |

returns True if the object is a method but not a pseudo-method

Code Flags:
  RET_VALUE_ONLY

Example:
  bool b = f.isMethod();

Returns
  True if the object is a method but not a pseudo-method

Exceptions

  PROGRAM-ERROR | thrown if the Program object holding the function or method has been destroyed

## isPseudoMethod()

bool Qore::Reflection::AbstractReflectionFunction::isPseudoMethod | ( |  | ) |

returns True if the object is a pseudo-method

Code Flags:
  RET_VALUE_ONLY

Example:
  bool b = f.isPseudoMethod();

Returns
  True if the object is a pseudo-method

Exceptions

  PROGRAM-ERROR | thrown if the Program object holding the function or method has been destroyed

## isUser()

bool Qore::Reflection::AbstractReflectionFunction::isUser | ( |  | ) |

returns True if the function or method is a user function or method

Code Flags:
  RET_VALUE_ONLY

Example:
  bool b = f.isUser();

Returns
  True if the function or method is a user function or method

Exceptions

  PROGRAM-ERROR | thrown if the Program object holding the function or method has been destroyed

Note
  complementary to isBuiltin()

## numVariants()

int Qore::Reflection::AbstractReflectionFunction::numVariants | ( |  | ) |

returns the number of variants implemented by the function or method

Code Flags:
  RET_VALUE_ONLY

Example:
  int n = f.numVariants();

Returns
  the number of variants implemented by the function or method

Exceptions

  PROGRAM-ERROR | thrown if the Program object holding the function or method has been destroyed

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

- modules/reflection/src/QC_AbstractReflectionFunction.dox.h