VirtualBoxImpl.h revision bdf9c5cdef552197f95ae3f6f2ff2b6c7caa8d98
/* $Id$ */
/** @file
*
* VirtualBox COM class implementation
*/
/*
* Copyright (C) 2006-2007 innotek GmbH
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef ____H_VIRTUALBOXIMPL
#define ____H_VIRTUALBOXIMPL
#include "VirtualBoxBase.h"
#include "VBox/com/EventQueue.h"
#include <list>
#include <vector>
#include <map>
#ifdef RT_OS_WINDOWS
#include "win32/resource.h"
#endif
#ifdef RT_OS_WINDOWS
#endif
struct VMClientWatcherData;
#ifdef RT_OS_WINDOWS
#else
#endif
{
VirtualBox();
~VirtualBox();
void FinalRelease();
/* public initializer/uninitializer for internal purposes only */
void uninit();
/* IVirtualBox properties */
/* IVirtualBox methods */
BSTR *aMachineIDs);
BSTR *aMachineIDs);
/* public methods only for internal purposes */
#ifdef RT_OS_WINDOWS
#endif
void updateClientWatcher();
{
}
/// @todo (dmik) remove and make findMachine() public instead
// after switching to VirtualBoxBaseNEXT
bool aSetError = false)
{
}
/// @todo (dmik) remove and make findHardDisk() public instead
// after switching to VirtualBoxBaseNEXT
{
}
/** Returns the VirtualBox home directory */
{
};
bool aValidate,
bool aCatchLoadErrors,
bool aAddDefaults);
/**
* Shortcut to loadSettingsTree (aTree, aFile, true, true, true).
*
* Used when the settings file is to be loaded for the first time for the
* given object in order to recreate it from the stored settings.
*/
{
}
/**
* Shortcut to loadSettingsTree (aTree, aFile, true, false, true).
*
* Used when the settings file is loaded again (after it has been fully
* checked and validated by #loadSettingsTree_FirstTime()) in order to
* look at settings that don't have any representation within object's
* data fields.
*/
{
}
/**
* Shortcut to loadSettingsTree (aTree, aFile, true, false, false).
*
* Used when the settings file is loaded again (after it has been fully
* checked and validated by #loadSettingsTree_FirstTime()) in order to
* update some settings and then save them back.
*/
{
}
/* for VirtualBoxSupportErrorInfoImpl */
/** @note This method is not thread safe */
/**
* Main VirtualBox data structure.
* @note |const| members are persistent during lifetime so can be accessed
* without locking.
*/
struct Data
{
Data();
struct CfgFile
{
};
// const data members not requiring locking
// const objects not requiring locking
};
/** Client watcher thread data structure */
struct ClientWatcherData
{
#if defined(RT_OS_WINDOWS)
: mUpdateReq (NULL)
#elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER)
#else
# error "Port me!"
#endif
, mThread (NIL_RTTHREAD) {}
// const objects not requiring locking
#if defined(RT_OS_WINDOWS)
const HANDLE mUpdateReq;
const RTSEMEVENT mUpdateReq;
#elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER)
const RTSEMEVENT mUpdateReq;
#else
# error "Port me!"
#endif
};
const RTTHREAD mAsyncEventThread;
EventQueue * const mAsyncEventQ;
/** Lock for calling EventQueue->post() */
#ifdef RT_OS_WINDOWS
#endif
};
////////////////////////////////////////////////////////////////////////////////
/**
* Abstract callback event class to asynchronously call VirtualBox callbacks
* on a dedicated event thread. Subclasses reimplement #handleCallback()
* to call appropriate IVirtualBoxCallback methods depending on the event
* to be dispatched.
*
* @note The VirtualBox instance passed to the constructor is strongly
* referenced, so that the VirtualBox singleton won't be released until the
* event gets handled by the event thread.
*/
{
{
}
void *handler();
/*
* Note that this is a weak ref -- the CallbackEvent handler thread
* is bound to the lifetime of the VirtualBox instance, so it's safe.
*/
};
#endif // ____H_VIRTUALBOXIMPL