![]() |
VR-Forces Developer's Guide
|
Thread-safe status object for VR-Vantage background operations.
Represents a named background operation with an associated icon and descriptive message. State and message may be updated from any thread; reads are also safe from any thread. The name and icon are immutable after construction.
Public Member Functions | |
| DtBackgroundStatus (const std::string &name, const std::string &iconName, const std::string &title, DtStatusBarAlignment alignment=DtStatusBarAlignment::Center) | |
| const std::string & | name () const |
| const std::string & | iconName () const |
| const std::string & | title () const |
| DtStatusBarAlignment | alignment () const |
| void | setActive (bool active, const std::string &message) |
| bool | isActive () const |
| std::string | message () const |
Non-copyable / Non-movable | |
DtBackgroundStatus contains a std::mutex which is not copyable. Copies of a status object would be independent and would not be seen by DtBackgroundStatusManager. | |
| DtBackgroundStatus (const DtBackgroundStatus &)=delete | |
| DtBackgroundStatus & | operator= (const DtBackgroundStatus &)=delete |
| DtBackgroundStatus (DtBackgroundStatus &&)=delete | |
| DtBackgroundStatus & | operator= (DtBackgroundStatus &&)=delete |
Protected Attributes | |
| std::string | myName |
| std::string | myIconName |
| std::string | myTitle |
| std::atomic< bool > | myActive |
| std::mutex | myMessageMutex |
| std::string | myMessage |
Private Attributes | |
| DtStatusBarAlignment | myAlignment |
| makVrv::DtBackgroundStatus::DtBackgroundStatus | ( | const std::string & | name, |
| const std::string & | iconName, | ||
| const std::string & | title, | ||
| DtStatusBarAlignment | alignment = DtStatusBarAlignment::Center |
||
| ) |
Constructor.
| name | Unique logical name for this status (e.g., "sensorfx"). |
| iconName | SVG icon file name used by the status bar widget. |
| title | Human-readable display title shown in the status tooltip header (e.g., "SensorFX", "GPU Throttle"). Immutable after construction. |
| alignment | Zone of the status bar where this status icon is displayed. Defaults to DtStatusBarAlignment::Center. |
|
delete |
|
delete |
|
delete |
|
delete |
| const std::string& makVrv::DtBackgroundStatus::name | ( | ) | const |
Returns the logical name. Immutable after construction.
| const std::string& makVrv::DtBackgroundStatus::iconName | ( | ) | const |
Returns the icon file name. Immutable after construction.
| const std::string& makVrv::DtBackgroundStatus::title | ( | ) | const |
Returns the display title shown in the tooltip header. Immutable after construction.
| DtStatusBarAlignment makVrv::DtBackgroundStatus::alignment | ( | ) | const |
Returns the alignment of this status icon within the status bar. Immutable after construction.
| void makVrv::DtBackgroundStatus::setActive | ( | bool | active, |
| const std::string & | message | ||
| ) |
Thread-safe update of active state and message.
| active | True if this status is currently active. |
| message | Human-readable description of the current operation. |
| bool makVrv::DtBackgroundStatus::isActive | ( | ) | const |
Returns whether this status is currently active.
| std::string makVrv::DtBackgroundStatus::message | ( | ) | const |
Returns a copy of the current message string.
|
protected |
Logical name; immutable after construction.
|
protected |
Icon file name; immutable after construction.
|
protected |
Human-readable display title; immutable after construction.
|
protected |
Atomic active flag for lockless reads.
|
mutableprotected |
Mutex protecting myMessage.
|
protected |
Human-readable status message; guarded by myMessageMutex.
|
private |
Alignment of this status icon within the status bar. Immutable after construction.