IC8 Python API:RLPy RStatus
Description
This class facilitates error handling for each API. It encapsulates the status code as a return value for each API function. Developers can query, set, or output status codes through this class. The RStatus codes and their instructions are listed below: {| class="wikitable" !Constant !Value |- |RStatus.Success |The operation was successful. |- |RStatus.Failure |The operation failed. |- |RStatus.InsufficientMemory |The operation failed due to insufficient memory. |- |RStatus.LicenseFailure |Application is not licensed for the attempted operation. |- |RStatus.IncompatibleVersion |The applied operation is not compatible with the current version. |- |RStatus.InvalidParameter |An invalid parameter was provided. |- |RStatus.UnknownParameter |The operation was called with an unrecognized argument. |- |RStatus.NotImplemented |This operation has not been implemented. |- |RStatus.Deprecated |This operation has been deprecated. |- |RStatus.NotFound |Not currently used. |- |RStatus.EndOfFile |Not currently used. |}
Constructor & Destructor
__init__ (self, *args)
Initializes a new status instance.
Parameters
- args
Member Functions
Clear (self)
Clear the current error status. Success status code is returned upon calling this function. See also: IsError( self )
Sample code
Demonstrates calls to `RLPy.RStatus.Clear`, `RLPy.RStatus.GetStatusCode`, `RLPy.RStatus.IsError`, `RLPy.RStatus.__eq__`, and `RLPy.RStatus.__ne__` using the example's inputs.
import RLPy
def run_script():
success = RLPy.RStatus(RLPy.RStatus.Success)
failure = RLPy.RStatus(RLPy.RStatus.Failure)
error_before = failure.IsError()
status_code = success.GetStatusCode()
failure.Clear()
error_after_clear = failure.IsError()
equal = success == RLPy.RStatus(RLPy.RStatus.Success)
not_equal = success != RLPy.RStatus(RLPy.RStatus.Failure)
return (error_before, status_code, error_after_clear, equal, not_equal)
GetStatusCode (self)
Get the current status code. Refer to the status code table above.
Sample code
Demonstrates calls to `RLPy.RStatus.Clear`, `RLPy.RStatus.GetStatusCode`, `RLPy.RStatus.IsError`, `RLPy.RStatus.__eq__`, and `RLPy.RStatus.__ne__` using the example's inputs.
import RLPy
def run_script():
success = RLPy.RStatus(RLPy.RStatus.Success)
failure = RLPy.RStatus(RLPy.RStatus.Failure)
error_before = failure.IsError()
status_code = success.GetStatusCode()
failure.Clear()
error_after_clear = failure.IsError()
equal = success == RLPy.RStatus(RLPy.RStatus.Success)
not_equal = success != RLPy.RStatus(RLPy.RStatus.Failure)
return (error_before, status_code, error_after_clear, equal, not_equal)
IsError (self)
Check whether the current status is an error.
Sample code
Demonstrates calls to `RLPy.RStatus.Clear`, `RLPy.RStatus.GetStatusCode`, `RLPy.RStatus.IsError`, `RLPy.RStatus.__eq__`, and `RLPy.RStatus.__ne__` using the example's inputs.
import RLPy
def run_script():
success = RLPy.RStatus(RLPy.RStatus.Success)
failure = RLPy.RStatus(RLPy.RStatus.Failure)
error_before = failure.IsError()
status_code = success.GetStatusCode()
failure.Clear()
error_after_clear = failure.IsError()
equal = success == RLPy.RStatus(RLPy.RStatus.Success)
not_equal = success != RLPy.RStatus(RLPy.RStatus.Failure)
return (error_before, status_code, error_after_clear, equal, not_equal)
__eq__ (self, *args)
Reports whether this value equals another value.
Parameters
- args
Sample code
Demonstrates calls to `RLPy.RStatus.Clear`, `RLPy.RStatus.GetStatusCode`, `RLPy.RStatus.IsError`, `RLPy.RStatus.__eq__`, and `RLPy.RStatus.__ne__` using the example's inputs.
import RLPy
def run_script():
success = RLPy.RStatus(RLPy.RStatus.Success)
failure = RLPy.RStatus(RLPy.RStatus.Failure)
error_before = failure.IsError()
status_code = success.GetStatusCode()
failure.Clear()
error_after_clear = failure.IsError()
equal = success == RLPy.RStatus(RLPy.RStatus.Success)
not_equal = success != RLPy.RStatus(RLPy.RStatus.Failure)
return (error_before, status_code, error_after_clear, equal, not_equal)
__ne__ (self, *args)
Reports whether this value differs from another value.
Parameters
- args
Sample code
Demonstrates calls to `RLPy.RStatus.Clear`, `RLPy.RStatus.GetStatusCode`, `RLPy.RStatus.IsError`, `RLPy.RStatus.__eq__`, and `RLPy.RStatus.__ne__` using the example's inputs.
import RLPy
def run_script():
success = RLPy.RStatus(RLPy.RStatus.Success)
failure = RLPy.RStatus(RLPy.RStatus.Failure)
error_before = failure.IsError()
status_code = success.GetStatusCode()
failure.Clear()
error_after_clear = failure.IsError()
equal = success == RLPy.RStatus(RLPy.RStatus.Success)
not_equal = success != RLPy.RStatus(RLPy.RStatus.Failure)
return (error_before, status_code, error_after_clear, equal, not_equal)
Properties
thisown
Indicates whether this SWIG proxy owns the underlying C++ object.