Open Lighting Architecture  0.9.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
};

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

ola::client::Result::Result ( const std::string &  error)
inlineexplicit
Parameters
errorthe text description of the error. An empty string means the action succeeded.

Member Function Documentation

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

Returns the error message if the action failed.

Returns
the error message.
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: