| Qore reflection Module 1.14.0

Loading...
Searching...
No Matches
Public Member Functions | List of all members
Qore::Reflection::CopyMethod Class Reference

This class provides information about Qore copy methods. More...

`#include <QC_CopyMethod.dox.h>`

Inheritance diagram for Qore::Reflection::CopyMethod:

## Public Member Functions
object | call (object obj)
| calls the copy method on given object and returns the new object
| constructor (Class cls)
| Creates the object from the class if the class implements a copy method.
| constructor (string class_name)
| Creates the object from the class name or namespace path if the class implements a copy method.
Public Member Functions inherited from Qore::Reflection::AbstractMethod
| constructor ()
| Throws an exception if called directly; this class can only be instantiated by builtin subclasses.
AbstractClass | getClass ()
| Returns the class for the method.
string | getMethodTypeName ()
| returns the type of method as a string; one of `"normal"`, `"static"`, `"constructor"`, `"destructor"`, `"copy"`
AbstractMethodVariant | getVariant (...)
| Returns the given direct child method variant declared in this method or throws an exception if the method variant is not defined.
AbstractMethodVariant | getVariantArgs (softlist< Type > argv)
| Returns the given direct child method variant declared in this method or throws an exception if the method variant is not defined.
list< AbstractMethodVariant > | getVariants ()
| returns the variants implemented by the method
bool | isStatic ()
| returns True if the method is a static method
Public Member Functions inherited from Qore::Reflection::AbstractReflectionFunction
| 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

This class provides information about Qore copy methods.

Restrictions:
  Qore::PO_NO_REFLECTION

See also
  CopyMethodVariant

Since
  Qore 0.9.0

## Member Function Documentation

## ◆ call()

object Qore::Reflection::CopyMethod::call | ( | object | obj | ) |

calls the copy method on given object and returns the new object

Example:
  object obj2 = m.call(obj1);

Parameters

  obj | the object to copy

Exceptions

  PROGRAM-ERROR | thrown if the Program object holding the class and method has been destroyed
  METHOD-ERROR | the object was not instantiated from the class implementing this method

## ◆ constructor() [1/2]

Qore::Reflection::CopyMethod::constructor | ( | Class | cls | ) |

Creates the object from the class if the class implements a copy method.

Example:
  CopyMethod m(cls);

Parameters

  cls | the class for the method

Exceptions

  UNKOWN-METHOD | cannot find a copy method for the class

## ◆ constructor() [2/2]

Qore::Reflection::CopyMethod::constructor | ( | string | class_name | ) |

Creates the object from the class name or namespace path if the class implements a copy method.

Example:
  CopyMethod m("Thread::Mutex");

Parameters

  class_name | the class name or namespace path for the class

Exceptions

  UNKNOWN-CLASS | cannot find a class with the given name or path
  UNKOWN-METHOD | cannot find a copy method for the class

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

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