Call Class Referenceabstract

#include <Pt/Lua/Call.h>

Synchronous native call from Lua. More...

Inherited by ConstructorCall, MethodCall, PropertyGetCall, and PropertySetCall.

Public Member Functions

virtual ~Call ()
 Destroys the call.
virtual Pt::Any call ()=0
 Performs the invocation and returns the result.
virtual Pt::Reflex::Type * rtype () const =0
 Returns the Reflex result type, or a null pointer.
bool hasError () const
 Returns true when the invocation stored an error.
const std::string & errorMessage () const
 Returns the stored error text.

Protected Member Functions

void setError (const std::string &msg)
 Stores msg as the error of this call.

Detailed Description

Call is the work a Script runs when Lua invokes a reflected method, property, or constructor. The script owns the call and deletes it after call() returns. Application code does not construct a Call; the binding closures do.

call() performs the invocation and returns the result as Any. A thrown std::exception is stored as an error: hasError() is true and errorMessage() holds the text. rtype() is the Reflex result type, or a null pointer when the call has no result to push.