Logo Search packages:      
Sourcecode: virtualbox-ose version File versions

Machine::AutoStateDependency< taDepType > Class Template Reference

#include <MachineImpl.h>

List of all members.

Detailed Description

template<StateDependency taDepType = AnyStateDep>
class Machine::AutoStateDependency< taDepType >

Helper class that safely manages the machine state dependency by calling Machine::addStateDependency() on construction and Machine::releaseStateDependency() on destruction. Intended for Machine children. The usage pattern is:

      AutoCaller autoCaller (this);
      CheckComRCReturnRC (autoCaller.rc());

      Machine::AutoStateDependency <MutableStateDep> adep (mParent);
      CheckComRCReturnRC (stateDep.rc());
      // code that depends on the particular machine state

Note that it is more convenient to use the following individual shortcut classes instead of using this template directly: AutoAnyStateDependency, AutoMutableStateDependency and AutoMutableOrSavedStateDependency. The usage pattern is exactly the same as above except that there is no need to specify the template argument because it is already done by the shortcut class.

taDepType Dependecy type to manage.

Definition at line 337 of file MachineImpl.h.

Public Member Functions

void add ()
 AutoStateDependency (Machine *aThat)
bool isOk () const
BOOL machineRegistered () const
MachineState_T machineState () const
HRESULT rc () const
void release ()

Protected Attributes

MachineState_T mMachineState
BOOL mRegistered
Machine * mThat

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

Generated by  Doxygen 1.6.0   Back to index