2001-06-27 14:10:35 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
#ifndef FUNC_STATUS_H
|
|
|
|
#define FUNC_STATUS_H
|
|
|
|
|
|
|
|
/// The status of a function.
|
|
|
|
namespace func_status {
|
|
|
|
|
|
|
|
enum value_type {
|
|
|
|
/// No problem
|
|
|
|
OK = 0,
|
|
|
|
///
|
|
|
|
Unknown = 1,
|
|
|
|
/// Command cannot be executed
|
|
|
|
Disabled = 2,
|
|
|
|
///
|
|
|
|
ToggleOn = 4,
|
|
|
|
///
|
|
|
|
ToggleOff = 8
|
|
|
|
};
|
2001-12-21 13:55:24 +00:00
|
|
|
|
|
|
|
inline
|
|
|
|
void toggle(value_type & flag, bool b)
|
|
|
|
{
|
|
|
|
flag = static_cast<value_type>(flag | (b ? ToggleOn : ToggleOff));
|
|
|
|
}
|
2001-06-27 14:10:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
///
|
|
|
|
inline
|
|
|
|
void operator|=(func_status::value_type & fs, func_status::value_type f)
|
|
|
|
{
|
|
|
|
fs = static_cast<func_status::value_type>(fs | f);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|