VirtualBox

source: vbox/trunk/src/VBox/Main/include/SATAControllerImpl.h@ 12866

Last change on this file since 12866 was 8155, checked in by vboxsync, 17 years ago

The Big Sun Rebranding Header Change

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author Id
File size: 4.5 KB
Line 
1/* $Id: SATAControllerImpl.h 8155 2008-04-18 15:16:47Z vboxsync $ */
2
3/** @file
4 *
5 * VBox SATAController COM Class declaration.
6 */
7
8/*
9 * Copyright (C) 2008 Sun Microsystems, Inc.
10 *
11 * This file is part of VirtualBox Open Source Edition (OSE), as
12 * available from http://www.virtualbox.org. This file is free software;
13 * you can redistribute it and/or modify it under the terms of the GNU
14 * General Public License (GPL) as published by the Free Software
15 * Foundation, in version 2 as it comes in the "COPYING" file of the
16 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
17 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
18 *
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
20 * Clara, CA 95054 USA or visit http://www.sun.com if you need
21 * additional information or have any questions.
22 */
23
24#ifndef ____H_SATACONTROLLERIMPL
25#define ____H_SATACONTROLLERIMPL
26
27#include "VirtualBoxBase.h"
28
29#include <list>
30
31class Machine;
32
33class ATL_NO_VTABLE SATAController :
34 public VirtualBoxBaseWithChildrenNEXT,
35 public VirtualBoxSupportErrorInfoImpl <SATAController, ISATAController>,
36 public VirtualBoxSupportTranslation <SATAController>,
37 public ISATAController
38{
39private:
40
41 struct Data
42 {
43 /* Constructor. */
44 Data() : mEnabled (FALSE),
45 mPortCount (30),
46 mPortIde0Master (0),
47 mPortIde0Slave (1),
48 mPortIde1Master (2),
49 mPortIde1Slave (3) { }
50
51 bool operator== (const Data &that) const
52 {
53 return this == &that || ((mEnabled == that.mEnabled) &&
54 (mPortCount == mPortCount) &&
55 (mPortIde0Master == that.mPortIde0Master) &&
56 (mPortIde0Slave == that.mPortIde0Slave) &&
57 (mPortIde1Master == that.mPortIde1Master) &&
58 (mPortIde1Slave == that.mPortIde1Slave));
59 }
60
61 /** Enabled indicator. */
62 BOOL mEnabled;
63 /** Number of usable ports. */
64 ULONG mPortCount;
65 /** Port which acts as primary master for ide emulation. */
66 ULONG mPortIde0Master;
67 /** Port which acts as primary slave for ide emulation. */
68 ULONG mPortIde0Slave;
69 /** Port which acts as secondary master for ide emulation. */
70 ULONG mPortIde1Master;
71 /** Port which acts as secondary slave for ide emulation. */
72 ULONG mPortIde1Slave;
73 };
74
75public:
76
77 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (SATAController)
78
79 DECLARE_NOT_AGGREGATABLE (SATAController)
80
81 DECLARE_PROTECT_FINAL_CONSTRUCT()
82
83 BEGIN_COM_MAP(SATAController)
84 COM_INTERFACE_ENTRY (ISupportErrorInfo)
85 COM_INTERFACE_ENTRY (ISATAController)
86 END_COM_MAP()
87
88 NS_DECL_ISUPPORTS
89
90 DECLARE_EMPTY_CTOR_DTOR (SATAController)
91
92 HRESULT FinalConstruct();
93 void FinalRelease();
94
95 // public initializer/uninitializer for internal purposes only
96 HRESULT init (Machine *aParent);
97 HRESULT init (Machine *aParent, SATAController *aThat);
98 HRESULT initCopy (Machine *aParent, SATAController *aThat);
99 void uninit();
100
101 // ISATAController properties
102 STDMETHOD(COMGETTER(Enabled)) (BOOL *aEnabled);
103 STDMETHOD(COMSETTER(Enabled)) (BOOL aEnabled);
104 STDMETHOD(COMGETTER(PortCount)) (ULONG *aPortCount);
105 STDMETHOD(COMSETTER(PortCount)) (ULONG aPortCount);
106
107 // ISATAController methods
108 STDMETHOD(GetIDEEmulationPort) (LONG DevicePosition, LONG *aPortNumber);
109 STDMETHOD(SetIDEEmulationPort) (LONG DevicePosition, LONG aPortNumber);
110
111 // public methods only for internal purposes
112
113 HRESULT loadSettings (const settings::Key &aMachineNode);
114 HRESULT saveSettings (settings::Key &aMachineNode);
115
116 bool isModified();
117 bool isReallyModified();
118 bool rollback();
119 void commit();
120 void copyFrom (SATAController *aThat);
121
122 HRESULT onMachineRegistered (BOOL aRegistered);
123
124 // public methods for internal purposes only
125 // (ensure there is a caller and a read lock before calling them!)
126
127 /** @note this doesn't require a read lock since mParent is constant. */
128 const ComObjPtr <Machine, ComWeakRef> &parent() { return mParent; };
129
130 const Backupable<Data> &data() { return mData; }
131
132 // for VirtualBoxSupportErrorInfoImpl
133 static const wchar_t *getComponentName() { return L"SATAController"; }
134
135private:
136
137 void printList();
138
139 /** Parent object. */
140 const ComObjPtr<Machine, ComWeakRef> mParent;
141 /** Peer object. */
142 const ComObjPtr <SATAController> mPeer;
143 /** Data. */
144 Backupable <Data> mData;
145
146};
147
148#endif //!____H_SATACONTROLLERIMPL
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette