Loading...
Searching...
No Matches
Object Functions

## Functions

auto | Qore::callObjectMethod (object obj, string method,...)
| Calls a method of an object, passing the remainder of the arguments to the function as arguments to the method.
nothing | Qore::callObjectMethod ()
| This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
auto | Qore::callObjectMethodArgs (object obj, string method, *softlist< auto > varg)
| Calls a method of an object, using the optional third argument as the argument list to the method.
nothing | Qore::callObjectMethodArgs ()
| This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
auto | Qore::call_object_method (object obj, string method,...)
| Calls a method of an object, passing the remainder of the arguments to the function as arguments to the method.
auto | Qore::call_object_method_args (object obj, string method, *softlist< auto > varg)
| Calls a method of an object, using the optional third argument as the argument list to the method.
auto | Qore::call_pseudo (any val, string meth,...)
| calls a pseudo-method on the given value
auto | Qore::call_pseudo_args (any val, string meth, *softlist< auto > argv)
| calls a pseudo-method on the given value with arguments given as a list
auto | Qore::call_static_method (string class_name, string method,...)
| Calls a static method of an object, passing the arguments to the function as arguments to the method.
auto | Qore::call_static_method_args (string class_name, string method, *softlist< auto > call_args)
| Calls a static method of an object, passing the arguments to the function as arguments to the method.
object | Qore::create_object (string class_name,...)
| creates an object from the class name (which can include a namespace path) and optionally any arguments for the constructor
object | Qore::create_object_args (string class_name, *softlist< auto > argv)
| creates an object from the class name (which can include a namespace path) and optionally any arguments for the constructor
list | Qore::getMethodList (object obj)
| Returns a list of strings of the names of the methods of the class of the object passed as a parameter.
nothing | Qore::getMethodList ()
| This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
list< string > | Qore::get_method_list (object obj)
| Returns a list of strings of the names of the methods of the class of the object passed as a parameter.

## Detailed Description

Object functions

## Function Documentation

## call_object_method()

auto Qore::call_object_method | ( | object | obj,
|  | string | method,
|  |  | ... )

Calls a method of an object, passing the remainder of the arguments to the function as arguments to the method.

Parameters

  obj | the object to use for the call
  method | the method to call
  ... | any additional arguments to the method

Returns
  the value returned by the method call

Example:
  auto result = call_object_method(obj, "method", arg1, arg2);

Exceptions

  METHOD-DOES-NOT-EXIST | The named method does not exist in this class
  ILLEGAL-EXPLICIT-METHOD-CALL | The named method may not be called explicitly
  METHOD-IS-PRIVATE | The named method is private and therefore can only be called within the class
  BASE-CLASS-IS-PRIVATE | The named method is a member of a privately inherited base class

Note
  the method called could cause additional exceptions to be thrown

Since
  Qore 0.8.12 as a replacement for deprecated camel-case callObjectMethod()

See also
  - call_object_method_args()
  - call_static_method()
  - call_static_method_args()

## call_object_method_args()

auto Qore::call_object_method_args | ( | object | obj,
|  | string | method,
|  | *softlist< auto > | varg )

Calls a method of an object, using the optional third argument as the argument list to the method.

Parameters

  obj | the object to use for the call
  method | the method to call
  varg | any additional arguments to the method

Returns
  the value returned by the method call

Example:
  auto result = call_object_method_args(obj, "method", arglist);

Exceptions

  METHOD-DOES-NOT-EXIST | The named method does not exist in this class
  ILLEGAL-EXPLICIT-METHOD-CALL | The named method may not be called explicitly
  METHOD-IS-PRIVATE | The named method is private and therefore can only be called within the class
  BASE-CLASS-IS-PRIVATE | The named method is a member of a privately inherited base class

Note
  the method called could cause additional exceptions to be thrown

Since
  Qore 0.8.12 as a replacement for deprecated camel-case callObjectMethodArgs()

See also
  - call_object_method()
  - call_static_method()
  - call_static_method_args()

## call_pseudo()

auto Qore::call_pseudo | ( | any | val,
|  | string | meth,
|  |  | ... )

calls a pseudo-method on the given value

Parameters

  val | the value to call the pseudo-method on
  meth | the string method name of the pseudo-method to call
  ... | any other arguments to the method

Returns
  the return value of the pseudo-method

See also
  <value> for the class hierarchy of pseudo-classes

Note
  this function can be used for security to ensure that a given pseudo-method of the <object> class is called, as by default if a method of the same name is implemented by the object's class, the class method will be called instead.

Since
  Qore 0.8.5

## call_pseudo_args()

auto Qore::call_pseudo_args | ( | any | val,
|  | string | meth,
|  | *softlist< auto > | argv )

calls a pseudo-method on the given value with arguments given as a list

Parameters

  val | the value to call the pseudo-method on
  meth | the string method name of the pseudo-method to call
  argv | any other arguments to the method

Returns
  the return value of the pseudo-method

See also
  <value> for the class hierarchy of pseudo-classes

Note
  this function can be used for security to ensure that a given pseudo-method of the <object> class is called, as by default if a method of the same name is implemented by the object's class, the class method will be called instead.

Since
  Qore 0.8.8

## call_static_method()

auto Qore::call_static_method | ( | string | class_name,
|  | string | method,
|  |  | ... )

Calls a static method of an object, passing the arguments to the function as arguments to the method.

Example:
  auto result = call_static_method("Namespace::Class::method", arg1, arg2);

Parameters

  class_name | the with an optional namespace prefix
  method | the static method to call
  ... | any additional arguments to the method

Returns
  the value returned by the method call

Exceptions

  METHOD-DOES-NOT-EXIST | The named method does not exist in this class
  ILLEGAL-EXPLICIT-METHOD-CALL | The named method may not be called explicitly
  METHOD-IS-PRIVATE | The named method is private and therefore can only be called within the class
  BASE-CLASS-IS-PRIVATE | The named method is a member of a privately inherited base class

Note
  the method called could cause additional exceptions to be thrown

See also
  - call_static_method_args()
  - call_object_method()
  - call_object_method_args()
  - Program::callStaticMethod()
  - Program::callStaticMethodArgs()

## call_static_method_args()

auto Qore::call_static_method_args | ( | string | class_name,
|  | string | method,
|  | *softlist< auto > | call_args )

Calls a static method of an object, passing the arguments to the function as arguments to the method.

Example:
  auto result = call_static_method_args("Namespace::Class::method", (arg1, arg2));

Parameters

  class_name | the with an optional namespace prefix
  method | the static method to call
  call_args | any additional arguments to the method

Returns
  the value returned by the method call

Exceptions

  METHOD-DOES-NOT-EXIST | The named method does not exist in this class
  ILLEGAL-EXPLICIT-METHOD-CALL | The named method may not be called explicitly
  METHOD-IS-PRIVATE | The named method is private and therefore can only be called within the class
  BASE-CLASS-IS-PRIVATE | The named method is a member of a privately inherited base class

Note
  the method called could cause additional exceptions to be thrown

See also
  - call_static_method()
  - call_object_method()
  - call_object_method_args()
  - Program::callStaticMethod()
  - Program::callStaticMethodArgs()

## callObjectMethod() [1/2]

nothing Qore::callObjectMethod | ( |  | ) |

This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.

Code Flags:
  RUNTIME_NOOP, DEPRECATED

## callObjectMethod() [2/2]

auto Qore::callObjectMethod | ( | object | obj,
|  | string | method,
|  |  | ... )

Calls a method of an object, passing the remainder of the arguments to the function as arguments to the method.

Code Flags:
  DEPRECATED

Parameters

  obj | the object to use for the call
  method | the method to call
  ... | any additional arguments to the method

Returns
  the value returned by the method call

Example:
  auto result = callObjectMethod(obj, "method", arg1, arg2);

Exceptions

  METHOD-DOES-NOT-EXIST | The named method does not exist in this class
  ILLEGAL-EXPLICIT-METHOD-CALL | The named method may not be called explicitly
  METHOD-IS-PRIVATE | The named method is private and therefore can only be called within the class
  BASE-CLASS-IS-PRIVATE | The named method is a member of a privately inherited base class

Note
  the method called could cause additional exceptions to be thrown

Deprecated
  use call_object_method(); camel-case function names were deprecated in Qore 0.8.12

## callObjectMethodArgs() [1/2]

nothing Qore::callObjectMethodArgs | ( |  | ) |

This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.

Code Flags:
  RUNTIME_NOOP, DEPRECATED

## callObjectMethodArgs() [2/2]

auto Qore::callObjectMethodArgs | ( | object | obj,
|  | string | method,
|  | *softlist< auto > | varg )

Calls a method of an object, using the optional third argument as the argument list to the method.

Code Flags:
  DEPRECATED

Parameters

  obj | the object to use for the call
  method | the method to call
  varg | any additional arguments to the method

Returns
  the value returned by the method call

Exceptions

  METHOD-DOES-NOT-EXIST | The named method does not exist in this class
  ILLEGAL-EXPLICIT-METHOD-CALL | The named method may not be called explicitly
  METHOD-IS-PRIVATE | The named method is private and therefore can only be called within the class
  BASE-CLASS-IS-PRIVATE | The named method is a member of a privately inherited base class

Note
  the method called could cause additional exceptions to be thrown

Deprecated
  use call_object_method_args(); camel-case function names were deprecated in Qore 0.8.12

## create_object()

object Qore::create_object | ( | string | class_name,
|  |  | ... )

creates an object from the class name (which can include a namespace path) and optionally any arguments for the constructor

Example
  object obj = create_object(class_name, arg1, arg2);

Parameters

  class_name | the name of the class to instantiate (can be prefixed with a namespace path)
  ... | any other arguments to the constructor

Returns
  the object created

Exceptions

  CREATE-OBJECT-ERROR | unknown class, class implements features restricted by current parse options / sandboxing restrictions
  CONSTRUCTOR-IS-PRIVATE | attempt to instantiate an object with a private constructor from outside the class

Note
  see the class documentation for the class to be instantiated for a list of additional exceptions that can be thrown

See also
  create_object_args()

Since
  Qore 0.8.12

## create_object_args()

object Qore::create_object_args | ( | string | class_name,
|  | *softlist< auto > | argv )

creates an object from the class name (which can include a namespace path) and optionally any arguments for the constructor

Example
  object obj = create_object_args(class_name, arg_list);

Parameters

  class_name | the name of the class to instantiate (can be prefixed with a namespace path)
  argv | any other arguments to the constructor

Returns
  the object created

Exceptions

  CREATE-OBJECT-ERROR | unknown class, class implements features restricted by current parse options / sandboxing restrictions
  CONSTRUCTOR-IS-PRIVATE | attempt to instantiate an object with a private constructor from outside the class

Note
  see the class documentation for the class to be instantiated for a list of additional exceptions that can be thrown

See also
  create_object()

Since
  Qore 0.8.12

## get_method_list()

list< string > Qore::get_method_list | ( | object | obj | ) |

Returns a list of strings of the names of the methods of the class of the object passed as a parameter.

Code Flags:
  CONSTANT

Parameters

  obj | an object of the class to get the method list from

Returns
  a list of strings of the names of the methods of the class of the object passed as a parameter; returns all methods in the class, both private and public but does not return inherited methods

Example:
  list<string> l = get_method_list(obj);

Since
  Qore 0.8.12 as a replacement for deprecated camel-case getMethodList()

## getMethodList() [1/2]

nothing Qore::getMethodList | ( |  | ) |

This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.

Code Flags:
  RUNTIME_NOOP, DEPRECATED

## getMethodList() [2/2]

list Qore::getMethodList | ( | object | obj | ) |

Returns a list of strings of the names of the methods of the class of the object passed as a parameter.

Code Flags:
  CONSTANT, DEPRECATED

Parameters

  obj | an object of the class to get the method list from

Returns
  a list of strings of the names of the methods of the class of the object passed as a parameter; returns all methods in the class, both private and public but does not return inherited methods

Deprecated
  use get_method_list(); camel-case function names were deprecated in Qore 0.8.12