Qore reflection Module  0.9.1
Qore::Reflection::ConstructorMethod Class Reference

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

Inheritance diagram for Qore::Reflection::ConstructorMethod:
Qore::Reflection::AbstractMethod Qore::Reflection::AbstractReflectionFunction

Public Member Methods

auto call (...)
 calls the constructor with the given arguments More...
 
auto callArgs (*softlist< auto > argv)
 calls the construcrtor with the given arguments as a list More...
 
 constructor (Class cls)
 Creates the object from the class. More...
 
 constructor (string class_name)
 Creates the object from the class name or namespace path. More...
 
- Public Member Methods inherited from Qore::Reflection::AbstractMethod
 constructor ()
 Throws an exception if called directly; this class can only be instantiated by builtin subclasses. More...
 
AbstractClass getClass ()
 Returns the class for the method. More...
 
string getMethodTypeName ()
 returns the type of method as a string; one of "normal", "static", "constructor", "destructor", "copy" More...
 
AbstractMethodVariant getVariant (...)
 Returns the given direct child method variant declared in this method or throws an exception if the method variant is not defined. More...
 
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. More...
 
list< AbstractMethodVariantgetVariants ()
 returns the variants implemented by the method More...
 
bool isStatic ()
 returns True if the method is a static method More...
 
- Public Member Methods inherited from Qore::Reflection::AbstractReflectionFunction
 constructor ()
 Throws an exception if called directly; this class can only be instantiated by builtin subclasses. More...
 
string getName ()
 returns the function or method name More...
 
bool isBuiltin ()
 returns True if the function or method is a builtin function or method More...
 
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. More...
 
bool isInjected ()
 returns True if the function or method has been injected as a dependency injection More...
 
bool isMethod ()
 returns True if the object is a method but not a pseudo-method More...
 
bool isPseudoMethod ()
 returns True if the object is a pseudo-method More...
 
bool isUser ()
 returns True if the function or method is a user function or method More...
 
int numVariants ()
 returns the number of variants implemented by the function or method More...
 

Detailed Description

This class provides information about Qore constructor methods.

Restrictions:
Qore::PO_NO_REFLECTION
See also
ConstructorMethodVariant
Since
Qore 0.9.0

Member Function Documentation

◆ call()

auto Qore::Reflection::ConstructorMethod::call (   ...)

calls the constructor with the given arguments

Example:
auto v = m.call(arg1, arg2);
Parameters
...optional arguments to the method
Returns
the object created by the constructor
Exceptions
PROGRAM-ERRORthrown if the Program object holding the class and method has been destroyed
CREATE-OBJECT-ERRORclass implements features restricted by current parse options / sandboxing restrictions
See also
callArgs()

◆ callArgs()

auto Qore::Reflection::ConstructorMethod::callArgs ( *softlist< auto >  argv)

calls the construcrtor with the given arguments as a list

Example:
auto v = m.callArgs(argv);
Parameters
argvoptional arguments to the method
Returns
the object created by the constructor
Exceptions
PROGRAM-ERRORthrown if the Program object holding the class and method has been destroyed
CREATE-OBJECT-ERRORclass implements features restricted by current parse options / sandboxing restrictions
See also
call()

◆ constructor() [1/2]

Qore::Reflection::ConstructorMethod::constructor ( Class  cls)

Creates the object from the class.

Example:
ConstructorMethod m(cls);
Parameters
clsthe class for the method
Exceptions
UNKOWN-METHODcannot find a constructor method for the given class

◆ constructor() [2/2]

Qore::Reflection::ConstructorMethod::constructor ( string  class_name)

Creates the object from the class name or namespace path.

Example:
ConstructorMethod m(class_name);
Parameters
class_namethe class name or namespace path for the method
Exceptions
UNKNOWN-CLASScannot find a class with the given name or path
UNKOWN-METHODcannot find a constructor method for the given class

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