Open Lighting Architecture: ola::client::Result Class Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
Public Member Functions | List of all members
ola::client::Result Class Reference

## Detailed Description

Indicates the result of a OLA API call.

Result objects are the first argument passed to an API callback function. They indicate if the action succeeded.

Example
  void ActionCallback(const Result &result, ...) {
  if (!result.Success()) {
  LOG(WARN) << result.Error();
  return;
  }
  // handle data
  };
  ola::client::Result::Error
  const std::string & Error() const
  Returns the error message if the action failed.
  Definition Result.h:73
  ola::client::Result::Result
  Result(const std::string &error)
  Definition Result.h:58
  ola::client::Result::Success
  bool Success() const
  Indicates the status of the action. If the action failed Error() can be used to fetch the error messa...
  Definition Result.h:67

## Public Member Functions
| Result (const std::string &error)
bool | Success () const
| Indicates the status of the action. If the action failed Error() can be used to fetch the error message.
const std::string & | Error () const
| Returns the error message if the action failed.

## Constructor & Destructor Documentation

## ◆ Result()

ola::client::Result::Result | ( | const std::string & | error | ) |
| inlineexplicit

Parameters

  error | the text description of the error. An empty string means the action succeeded.

## Member Function Documentation

## ◆ Error()

const std::string & ola::client::Result::Error | ( |  | ) | const
| inline

Returns the error message if the action failed.

Returns
  the error message.

## ◆ Success()

bool ola::client::Result::Success | ( |  | ) | const
| inline

Indicates the status of the action. If the action failed Error() can be used to fetch the error message.

Returns
  true if the action succeeded, false otherwise.

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

- include/ola/client/Result.h