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

VirtualBoxClassFactory Class Reference

Inheritance diagram for VirtualBoxClassFactory:

VirtualBoxBaseWithChildrenNEXT VirtualBoxSupportErrorInfoImpl< VirtualBox, IVirtualBox > VirtualBoxSupportTranslation< VirtualBox > VirtualBoxBaseNEXT VirtualBoxSupportErrorInfoImplBase VirtualBoxSupportTranslationBase VirtualBoxBase VirtualBoxBaseProto util::Lockable

List of all members.


Detailed Description

VirtualBox class factory that destroys the created instance right after the last reference to it is released by the client, and recreates it again when necessary (so VirtualBox acts like a singleton object).

Definition at line 314 of file server.cpp.


Public Types

typedef AutoCallerBase< false > AutoCaller
typedef AutoCallerBase< true > AutoLimitedCaller
typedef std::list< ComPtr
< IVirtualBoxCallback > > 
CallbackList
typedef std::vector< ComPtr
< IVirtualBoxCallback > > 
CallbackVector
typedef std::vector< ComPtr
< IInternalSessionControl > > 
InternalControlVector
typedef std::vector< ComObjPtr
< Machine > > 
MachineVector
typedef std::vector< ComObjPtr
< SessionMachine > > 
SessionMachineVector
enum  State {
  NotReady, Ready, InInit, InUninit,
  InitFailed, Limited, MayUninit, WillUninit
}

Public Member Functions

virtual HRESULT addCaller (State *aState=NULL, bool aLimited=false)
template<class C>
void addDependentChild (const ComObjPtr< C > &aChild)
template<class C>
void addDependentChild (C *aChild)
HRESULT addLimitedCaller (State *aState=NULL)
void addProcessToReap (RTPROCESS pid)
HRESULT addProgress (IProgress *aProgress)
int calculateFullPath (const char *aPath, Utf8Str &aResult)
void calculateRelativePath (const char *aPath, Utf8Str &aResult)
HRESULT cast (IHardDisk *aFrom, ComObjPtr< HardDisk > &aTo)
STDMETHOD() CreateAppliance (IAppliance **anAppliance)
STDMETHOD() CreateDHCPServer (IN_BSTR aName, IDHCPServer **aServer)
STDMETHOD() CreateHardDisk (IN_BSTR aFormat, IN_BSTR aLocation, IHardDisk **aHardDisk)
STDMETHOD() CreateLegacyMachine (IN_BSTR aName, IN_BSTR aOsTypeId, IN_BSTR aSettingsFile, IN_BSTR aId, IMachine **aMachine)
STDMETHOD() CreateMachine (IN_BSTR aName, IN_BSTR aOsTypeId, IN_BSTR aBaseFolder, IN_BSTR aId, IMachine **aMachine)
STDMETHOD() CreateSharedFolder (IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable)
HRESULT FinalConstruct ()
void FinalRelease ()
STDMETHOD() FindDHCPServerByNetworkName (IN_BSTR aName, IDHCPServer **aServer)
HRESULT findDVDImage (const Guid *aId, CBSTR aLocation, bool aSetError, ComObjPtr< DVDImage > *aImage=NULL)
STDMETHOD() FindDVDImage (IN_BSTR aLocation, IDVDImage **aDVDImage)
HRESULT findFloppyImage (const Guid *aId, CBSTR aLocation, bool aSetError, ComObjPtr< FloppyImage > *aImage=NULL)
STDMETHOD() FindFloppyImage (IN_BSTR aLocation, IFloppyImage **aFloppyImage)
HRESULT findHardDisk (const Guid *aId, CBSTR aLocation, bool aSetError, ComObjPtr< HardDisk > *aHardDisk=NULL)
STDMETHOD() FindHardDisk (IN_BSTR aLocation, IHardDisk **aHardDisk)
HRESULT findMachine (const Guid &aId, bool aSetError, ComObjPtr< Machine > *machine=NULL)
STDMETHOD() FindMachine (IN_BSTR aName, IMachine **aMachine)
STDMETHOD() GetDVDImage (IN_BSTR aId, IDVDImage **aDVDImage)
STDMETHOD() GetExtraData (IN_BSTR aKey, BSTR *aValue)
STDMETHOD() GetFloppyImage (IN_BSTR aId, IFloppyImage **aFloppyImage)
STDMETHOD() GetGuestOSType (IN_BSTR aId, IGuestOSType **aType)
STDMETHOD() GetHardDisk (IN_BSTR aId, IHardDisk **aHardDisk)
STDMETHOD() GetMachine (IN_BSTR aId, IMachine **aMachine)
STDMETHOD() GetNextExtraDataKey (IN_BSTR aKey, BSTR *aNextKey, BSTR *aNextValue)
void getOpenedMachines (SessionMachineVector &aMachines, InternalControlVector *aControls=NULL)
void getOpenedMachinesAndControls (SessionMachineVector &aMachines, InternalControlVector &aControls)
ComObjPtr< GuestOSType > getUnknownOSType ()
RWLockHandlehardDiskTreeLockHandle ()
const Utf8StrhomeDir ()
const ComObjPtr< Host > & host ()
HRESULT init ()
STDMETHOD() InterfaceSupportsErrorInfo (REFIID riid)
bool isLockedOnCurrentThread ()
bool isMachineIdValid (const Guid &aId)
bool isWriteLockOnCurrentThread ()
virtual RWLockHandlelockHandle () const
 NS_IMETHOD_ (nsrefcnt) Release()
BOOL onExtraDataCanChange (const Guid &aId, IN_BSTR aKey, IN_BSTR aValue, Bstr &aError)
void onExtraDataChange (const Guid &aId, IN_BSTR aKey, IN_BSTR aValue)
void onGuestPropertyChange (const Guid &aMachineId, IN_BSTR aName, IN_BSTR aValue, IN_BSTR aFlags)
void onMachineDataChange (const Guid &aId)
void onMachineRegistered (const Guid &aId, BOOL aRegistered)
void onMachineStateChange (const Guid &aId, MachineState_T aState)
void onSessionStateChange (const Guid &aId, SessionState_T aState)
void onSnapshotChange (const Guid &aMachineId, const Guid &aSnapshotId)
void onSnapshotDiscarded (const Guid &aMachineId, const Guid &aSnapshotId)
void onSnapshotTaken (const Guid &aMachineId, const Guid &aSnapshotId)
STDMETHOD() OpenDVDImage (IN_BSTR aLocation, IN_BSTR aId, IDVDImage **aDVDImage)
STDMETHOD() OpenExistingSession (ISession *aSession, IN_BSTR aMachineId)
STDMETHOD() OpenFloppyImage (IN_BSTR aLocation, IN_BSTR aId, IFloppyImage **aFloppyImage)
STDMETHOD() OpenHardDisk (IN_BSTR aLocation, AccessMode_T accessMode, BOOL aSetImageId, IN_BSTR aImageId, BOOL aSetParentId, IN_BSTR aParentId, IHardDisk **aHardDisk)
STDMETHOD() OpenMachine (IN_BSTR aSettingsFile, IMachine **aMachine)
STDMETHOD() OpenRemoteSession (ISession *aSession, IN_BSTR aMachineId, IN_BSTR aType, IN_BSTR aEnvironment, IProgress **aProgress)
STDMETHOD() OpenSession (ISession *aSession, IN_BSTR aMachineId)
HRESULT postEvent (Event *event)
STDMETHOD() RegisterCallback (IVirtualBoxCallback *aCallback)
HRESULT registerDVDImage (DVDImage *aImage, bool aSaveRegistry=true)
HRESULT registerFloppyImage (FloppyImage *aImage, bool aSaveRegistry=true)
HRESULT registerHardDisk (HardDisk *aHardDisk, bool aSaveRegistry=true)
STDMETHOD() RegisterMachine (IMachine *aMachine)
virtual void releaseCaller ()
template<class C>
void removeDependentChild (const ComObjPtr< C > &aChild)
template<class C>
void removeDependentChild (C *aChild)
STDMETHOD() RemoveDHCPServer (IDHCPServer *aServer)
HRESULT removeProgress (IN_GUID aId)
STDMETHOD() RemoveSharedFolder (IN_BSTR aName)
LockOps * rlock ()
HRESULT saveSettings ()
STDMETHOD() SaveSettings ()
STDMETHOD() SaveSettingsWithBackup (BSTR *aBakFileName)
STDMETHOD() SetExtraData (IN_BSTR aKey, IN_BSTR aValue)
const BstrsettingsFileName ()
 STDMETHOD (COMGETTER(DHCPServers))(ComSafeArrayOut(IDHCPServer *
 STDMETHOD (COMGETTER(PerformanceCollector))(IPerformanceCollector **aPerformanceCollector)
 STDMETHOD (COMGETTER(SharedFolders))(ComSafeArrayOut(ISharedFolder *
 STDMETHOD (COMGETTER(GuestOSTypes))(ComSafeArrayOut(IGuestOSType *
 STDMETHOD (COMGETTER(ProgressOperations))(ComSafeArrayOut(IProgress *
 STDMETHOD (COMGETTER(FloppyImages))(ComSafeArrayOut(IFloppyImage *
 STDMETHOD (COMGETTER(DVDImages))(ComSafeArrayOut(IDVDImage *
 STDMETHOD (COMGETTER(HardDisks))(ComSafeArrayOut(IHardDisk *
 STDMETHOD (COMGETTER(Machines))(ComSafeArrayOut(IMachine *
 STDMETHOD (COMGETTER(SystemProperties))(ISystemProperties **aSystemProperties)
 STDMETHOD (COMGETTER(Host))(IHost **aHost)
 STDMETHOD (COMGETTER(SettingsFormatVersion))(BSTR *aSettingsFormatVersion)
 STDMETHOD (COMGETTER(SettingsFileVersion))(BSTR *aSettingsFileVersion)
 STDMETHOD (COMGETTER(SettingsFilePath))(BSTR *aSettingsFilePath)
 STDMETHOD (COMGETTER(HomeFolder))(BSTR *aHomeFolder)
 STDMETHOD (COMGETTER(PackageType))(BSTR *aPackageType)
 STDMETHOD (COMGETTER(Revision))(ULONG *aRevision)
 STDMETHOD (COMGETTER(Version))(BSTR *aVersion)
const ComObjPtr
< SystemProperties > & 
systemProperties ()
void uninit ()
STDMETHOD() UnregisterCallback (IVirtualBoxCallback *aCallback)
HRESULT unregisterDVDImage (DVDImage *aImage, bool aSaveRegistry=true)
HRESULT unregisterFloppyImage (FloppyImage *aImage, bool aSaveRegistry=true)
HRESULT unregisterHardDisk (HardDisk *aHardDisk, bool aSaveRegistry=true)
STDMETHOD() UnregisterMachine (IN_BSTR aId, IMachine **aMachine)
void updateClientWatcher ()
HRESULT updateSettings (const char *aOldPath, const char *aNewPath)
STDMETHOD() WaitForPropertyChange (IN_BSTR aWhat, ULONG aTimeout, BSTR *aChanged, BSTR *aValues)
LockOps * wlock ()

Static Public Member Functions

static HRESULT backupSettingsFile (const Bstr &aFileName, const Utf8Str &aOldFormat, Bstr &aBakFileName)
static HRESULT ensureFilePathExists (const char *aFileName)
static NS_IMETHODIMP FactoryConstructor ()
static NS_IMETHODIMP FactoryDestructor ()
static const wchar_t * getComponentName ()
static nsresult GetInstance (VirtualBox **inst)
static HRESULT handleUnexpectedExceptions (RT_SRC_POS_DECL)
static HRESULT loadSettingsTree (settings::XmlTreeBackend &aTree, xml::File &aFile, bool aValidate, bool aCatchLoadErrors, bool aAddDefaults, Utf8Str *aFormatVersion=NULL)
static HRESULT loadSettingsTree_Again (settings::XmlTreeBackend &aTree, xml::File &aFile)
static HRESULT loadSettingsTree_FirstTime (settings::XmlTreeBackend &aTree, xml::File &aFile, Utf8Str &aFormatVersion)
static HRESULT loadSettingsTree_ForUpdate (settings::XmlTreeBackend &aTree, xml::File &aFile)
static HRESULT saveSettingsTree (settings::TreeBackend &aTree, xml::File &aFile, Utf8Str &aFormatVersion)
static void ShutdownTimer (RTTIMERLR hTimerLR, void *pvUser, uint64_t)
static const char * tr (const char *aSourceText, const char *aComment=NULL)
static const char * translate (const char *context, const char *sourceText, const char *comment=0)
static const char * translate (const char *context, const char *sourceText, const char *comment=0)

Public Attributes

 aDHCPServers
 aDVDImages
 aFloppyImages
 aGuestOSTypes
 aHardDisks
 aMachines
 aOperations
 aSharedFolders
struct IVirtualBox_vtbl * vtbl

Protected Member Functions

VirtualBoxBaseNEXTgetDependentChild (const ComPtr< IUnknown > &aUnk)
WriteLockHandlestateLockHandle ()
void uninitDependentChildren ()

Static Protected Member Functions

static const char * className ()
static bool cutClassNameFrom__PRETTY_FUNCTION__ (char *aPrettyFunctionName)
static HRESULT setError (HRESULT aResultCode, const GUID &aIID, const Bstr &aComponent, const char *aText, va_list aArgs, bool aLogIt=true)
static HRESULT setError (HRESULT aResultCode, const GUID &aIID, const Bstr &aComponent, const Bstr &aText, bool aLogIt=true)
static HRESULT setError (HRESULT aResultCode, const GUID &aIID, const char *aText,...)
static HRESULT setError (HRESULT aResultCode, const char *aText,...)
static HRESULT setError (HRESULT aResultCode, const GUID &aIID, const wchar_t *aComponent, const char *aText,...)
static HRESULT setErrorBstr (HRESULT aResultCode, const Bstr &aText)
static HRESULT setErrorNoLog (HRESULT aResultCode, const char *aText,...)
static HRESULT setErrorV (HRESULT aResultCode, const char *aText, va_list aArgs)
static HRESULT setWarning (HRESULT aResultCode, const GUID &aIID, const Bstr &aComponent, const char *aText, va_list aArgs)
static HRESULT setWarning (HRESULT aResultCode, const GUID &aIID, const Bstr &aComponent, const Bstr &aText)
static HRESULT setWarning (HRESULT aResultCode, const GUID &aIID, const char *aText,...)
static HRESULT setWarning (HRESULT aResultCode, const char *aText,...)
static HRESULT setWarning (HRESULT aResultCode, const GUID &aIID, const wchar_t *aComponent, const char *aText,...)
static HRESULT setWarningBstr (HRESULT aResultCode, const Bstr &aText)
static HRESULT setWarningV (HRESULT aResultCode, const char *aText, va_list aArgs)

Static Private Attributes

static VirtualBoxClassFactorysInstance = NULL
static RTCRITSECT sLock = {0}
static RTTIMERLR sTimer = NIL_RTTIMERLR

Friends

class CallbackEvent

Classes

class  MaybeQuitEvent

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

Generated by  Doxygen 1.6.0   Back to index