zorba::Function

#include <zorba/function.h>

Inherited from: zorba::SmartObject

The Function class represents a function that is callable from XQuery code, and it gives access to the various properties that are specified in the declaration of the function within a Prolog. Instances of Function are returned by the StaticContext::findFunctions() method. To be mopre precise, StaticContext::findFunctions() returns smart pointers to Function objects. These smart pointers must be destroyed before the StaticContext object they were obtained from is destroyed.Note: Builtin functions are not declared in the Prolog, but the same kind of properties exist for them as well. So, the Function class works for builtin functions as well.

Public Functions

void

addReference() const

void

free()

void

getAnnotations(std::vector< Annotation_t > &annotations) const =0

size_t

getArity() const =0

String

getLocalName() const =0

Item

getQName() const =0

long

getRefCount() const

String

getURI() const =0

bool

isBuiltin() const =0

bool

isDeterministic() const =0

bool

isExternal() const =0

bool

isPrivate() const =0

bool

isSequential() const =0

bool

isUpdating() const =0

bool

isVariadic() const =0

bool

isXQuery() const =0

void

removeReference()

~Function()

Destructor.

Protected Attributes

unsigned int

theRefCount

Public Functions

addReference

void addReference() const

free

void free()

getAnnotations

void getAnnotations(std::vector< Annotation_t > &annotations) const =0

getArity

size_t getArity() const =0

Returns

The arity of the function. If the function is variadic (which is possible only for builtin functions), the result of this method is non-deterministic.

getLocalName

String getLocalName() const =0

Returns

The local name of the function QName

getQName

Item getQName() const =0

Returns

The expanded QName of the function

getRefCount

long getRefCount() const

getURI

String getURI() const =0

Returns

The namespace URI of the function QName

isBuiltin

bool isBuiltin() const =0

Returns

True if the function is a builtin one (not declared in any prolog); false otherwise

isDeterministic

bool isDeterministic() const =0

Returns

True if the function is deterministic; false otherwise.

isExternal

bool isExternal() const =0

Returns

True if the function is an external one; false otherwise

isPrivate

bool isPrivate() const =0

Returns

True if the function is private; false otherwise.

isSequential

bool isSequential() const =0

Returns

True if the function is sequential; false otherwise.

isUpdating

bool isUpdating() const =0

Returns

True if the function is updating; false otherwise.

isVariadic

bool isVariadic() const =0

Returns

True if the function is variadic; false otherwise

isXQuery

bool isXQuery() const =0

Returns

True if the function implementation is written in XQuery (or equivalently, it is a non-external function with a Prolog declaration); false otherwise

removeReference

void removeReference()

~Function

 ~Function()

Destructor.

Protected Attributes

theRefCount

unsigned int theRefCount