BIOSSettingsImpl.cpp revision 4a4d0b7611a832602800898d4ec5da6d588b535a
/** @file
*
* VirtualBox COM class implementation
*/
/*
* Copyright (C) 2006-2013 Oracle Corporation
*
* 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.
*/
#include "BIOSSettingsImpl.h"
#include "MachineImpl.h"
#include "GuestOSTypeImpl.h"
#include <VBox/settings.h>
#include "AutoStateDep.h"
#include "AutoCaller.h"
#include "Logging.h"
////////////////////////////////////////////////////////////////////////////////
//
// BIOSSettings private data definition
//
////////////////////////////////////////////////////////////////////////////////
struct BIOSSettings::Data
{
Data()
{ }
// use the XML settings structure in the members for simplicity
};
// constructor / destructor
/////////////////////////////////////////////////////////////////////////////
{
return BaseFinalConstruct();
}
void BIOSSettings::FinalRelease()
{
uninit ();
}
// public initializer/uninitializer for internal purposes only
/////////////////////////////////////////////////////////////////////////////
/**
* Initializes the audio adapter object.
*
* @returns COM result indicator
*/
{
/* Enclose the state transition NotReady->InInit->Ready */
AutoInitSpan autoInitSpan(this);
m = new Data();
/* share the parent weakly */
return S_OK;
}
/**
* Initializes the audio adapter object given another audio adapter object
* (a kind of copy constructor). This object shares data with
* the object passed as an argument.
*
* @note This object must be destroyed before the original object
* it shares data with is destroyed.
*/
{
/* Enclose the state transition NotReady->InInit->Ready */
AutoInitSpan autoInitSpan(this);
m = new Data();
return S_OK;
}
/**
* Initializes the guest object given another guest object
* (a kind of copy constructor). This object makes a private copy of data
* of the original object passed as an argument.
*/
{
/* Enclose the state transition NotReady->InInit->Ready */
AutoInitSpan autoInitSpan(this);
m = new Data();
// mPeer is left null
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 BIOSSettings::uninit()
{
/* Enclose the state transition Ready->InUninit->NotReady */
AutoUninitSpan autoUninitSpan(this);
if (autoUninitSpan.uninitDone())
return;
delete m;
m = NULL;
}
// IBIOSSettings properties
/////////////////////////////////////////////////////////////////////////////
{
return S_OK;
}
{
/* the machine needs to be mutable */
return S_OK;
}
{
return S_OK;
}
{
/* the machine needs to be mutable */
return S_OK;
}
{
if (!displayTime)
return E_POINTER;
return S_OK;
}
{
/* the machine needs to be mutable */
return S_OK;
}
{
return S_OK;
}
{
/* the machine needs to be mutable */
return S_OK;
}
{
return S_OK;
}
{
/* the machine needs to be mutable */
return S_OK;
}
{
return S_OK;
}
{
/* the machine needs to be mutable */
return S_OK;
}
{
return S_OK;
}
{
/* the machine needs to be mutable */
return S_OK;
}
{
return S_OK;
}
{
/* the machine needs to be mutable */
return S_OK;
}
{
return S_OK;
}
{
/* the machine needs to be mutable */
return S_OK;
}
{
aNonVolatileStorageFile = "";
return S_OK;
}
// IBIOSSettings methods
/////////////////////////////////////////////////////////////////////////////
// public methods only for internal purposes
/////////////////////////////////////////////////////////////////////////////
/**
* Loads settings from the given machine node.
* May be called once right after this object creation.
*
* @param aMachineNode <Machine> node.
*
* @note Locks this object for writing.
*/
{
AutoCaller autoCaller(this);
// simply copy
return S_OK;
}
/**
* Saves settings to the given machine node.
*
* @param aMachineNode <Machine> node.
*
* @note Locks this object for reading.
*/
{
AutoCaller autoCaller(this);
return S_OK;
}
void BIOSSettings::i_rollback()
{
}
void BIOSSettings::i_commit()
{
/* sanity */
AutoCaller autoCaller(this);
/* sanity too */
/* lock both for writing since we modify both (mPeer is "master" so locked
* first) */
if (m->bd.isBackedUp())
{
if (m->pPeer)
{
/* attach new data to the peer and reshare it */
}
}
}
{
/* sanity */
AutoCaller autoCaller(this);
/* sanity too */
/* peer is not modified, lock it for reading (aThat is "master" so locked
* first) */
/* this will back up current data */
}
{
/* sanity */
AutoCaller autoCaller(this);
/* Initialize default BIOS settings here */
}
/* vi: set tabstop=4 shiftwidth=4 expandtab: */