GuestOSTypeImpl.cpp revision 1ac48a5af9c50b32d21da365eb31f2ccb0af4db7
/** @file
*
* VirtualBox COM class implementation
*/
/*
* Copyright (C) 2006-2007 Sun Microsystems, Inc.
*
* 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.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#include "GuestOSTypeImpl.h"
#include "Logging.h"
#include <iprt/cpputils.h>
// constructor / destructor
/////////////////////////////////////////////////////////////////////////////
, mIs64Bit (false)
, mRecommendedIOAPIC (false)
, mRecommendedVirtEx (false)
, mHDDSize (0), mMonitorCount (0)
{
}
{
}
{
return S_OK;
}
void GuestOSType::FinalRelease()
{
uninit();
}
// public initializer/uninitializer for internal purposes only
/////////////////////////////////////////////////////////////////////////////
/**
* Initializes the guest OS type object.
*
* @returns COM result indicator
* @param aFamilyId os family short name string
* @param aFamilyDescription os family name string
* @param aId os short name string
* @param aDescription os name string
* @param aOSType global OS type ID
* @param aIs64Bit returns true if the given OS is 64-bit
* @param aRAMSize recommended RAM size in megabytes
* @param aVRAMSize recommended video memory size in megabytes
* @param aHDDSize recommended HDD size in megabytes
*/
const char *aId, const char *aDescription,
bool aRecommendedIOAPIC, bool aRecommendedVirtEx,
{
LogFlowThisFunc (("aFamilyId='%s', aFamilyDescription='%s', "
"aId='%s', aDescription='%s', "
"aType=%d, aIs64Bit=%d, "
"aRecommendedIOAPIC=%d, aRecommendedVirtEx=%d, "
"aRAMSize=%d, aVRAMSize=%d, aHDDSize=%d, "
"aNetworkAdapterType=%d\n",
/* Enclose the state transition NotReady->InInit->Ready */
AutoInitSpan autoInitSpan (this);
/* Confirm a successful initialization when it's the case */
return S_OK;
}
/**
* Uninitializes the instance and sets the ready flag to FALSE.
* Called either from FinalRelease() or by the parent when it gets destroyed.
*/
void GuestOSType::uninit()
{
/* Enclose the state transition Ready->InUninit->NotReady */
AutoUninitSpan autoUninitSpan (this);
if (autoUninitSpan.uninitDone())
return;
}
// IGuestOSType properties
/////////////////////////////////////////////////////////////////////////////
{
if (!aFamilyId)
return E_POINTER;
AutoCaller autoCaller (this);
/* mFamilyID is constant during life time, no need to lock */
return S_OK;
}
{
if (!aFamilyDescription)
return E_POINTER;
AutoCaller autoCaller (this);
/* mFamilyDescription is constant during life time, no need to lock */
return S_OK;
}
{
if (!aId)
return E_POINTER;
AutoCaller autoCaller (this);
/* mID is constant during life time, no need to lock */
return S_OK;
}
{
if (!aDescription)
return E_POINTER;
AutoCaller autoCaller (this);
/* mDescription is constant during life time, no need to lock */
return S_OK;
}
{
if (!aIs64Bit)
return E_POINTER;
AutoCaller autoCaller (this);
/* mIs64Bit is constant during life time, no need to lock */
return S_OK;
}
{
if (!aRecommendedIOAPIC)
return E_POINTER;
AutoCaller autoCaller (this);
/* mRecommendedIOAPIC is constant during life time, no need to lock */
return S_OK;
}
{
if (!aRecommendedVirtEx)
return E_POINTER;
AutoCaller autoCaller (this);
/* mRecommendedVirtEx is constant during life time, no need to lock */
return S_OK;
}
{
if (!aRAMSize)
return E_POINTER;
AutoCaller autoCaller (this);
/* mRAMSize is constant during life time, no need to lock */
return S_OK;
}
{
if (!aVRAMSize)
return E_POINTER;
AutoCaller autoCaller (this);
/* mVRAMSize is constant during life time, no need to lock */
return S_OK;
}
{
if (!aHDDSize)
return E_POINTER;
AutoCaller autoCaller (this);
/* mHDDSize is constant during life time, no need to lock */
return S_OK;
}
{
if (!aNetworkAdapterType)
return E_POINTER;
AutoCaller autoCaller (this);
/* mNetworkAdapterType is constant during life time, no need to lock */
return S_OK;
}