VirtualBox

source: vbox/trunk/src/VBox/Main/include/HardDiskAttachmentImpl.h@ 8971

Last change on this file since 8971 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 Author Date Id Revision
File size: 2.9 KB
Line 
1/** @file
2 *
3 * VirtualBox COM class implementation
4 */
5
6/*
7 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18 * Clara, CA 95054 USA or visit http://www.sun.com if you need
19 * additional information or have any questions.
20 */
21
22#ifndef ____H_HARDDISKATTACHMENTIMPL
23#define ____H_HARDDISKATTACHMENTIMPL
24
25#include "VirtualBoxBase.h"
26#include "Collection.h"
27
28#include "HardDiskImpl.h"
29
30class ATL_NO_VTABLE HardDiskAttachment :
31 public VirtualBoxSupportErrorInfoImpl <HardDiskAttachment, IHardDiskAttachment>,
32 public VirtualBoxSupportTranslation <HardDiskAttachment>,
33 public VirtualBoxBase,
34 public IHardDiskAttachment
35{
36public:
37
38 DECLARE_EMPTY_CTOR_DTOR (HardDiskAttachment)
39
40 DECLARE_NOT_AGGREGATABLE(HardDiskAttachment)
41
42 DECLARE_PROTECT_FINAL_CONSTRUCT()
43
44 BEGIN_COM_MAP(HardDiskAttachment)
45 COM_INTERFACE_ENTRY(ISupportErrorInfo)
46 COM_INTERFACE_ENTRY(IHardDiskAttachment)
47 END_COM_MAP()
48
49 NS_DECL_ISUPPORTS
50
51 HRESULT FinalConstruct();
52 void FinalRelease();
53
54 // public initializer/uninitializer for internal purposes only
55 HRESULT init (HardDisk *aHD, StorageBus_T aBus, LONG aChannel, LONG aDevice, BOOL aDirty);
56
57 // IHardDiskAttachment properties
58 STDMETHOD(COMGETTER(HardDisk)) (IHardDisk **aHardDisk);
59 STDMETHOD(COMGETTER(Bus)) (StorageBus_T *aBus);
60 STDMETHOD(COMGETTER(Channel)) (LONG *aChannel);
61 STDMETHOD(COMGETTER(Device)) (LONG *aDevice);
62
63 // public methods for internal purposes only
64 // (ensure there is a caller and a read or write lock before calling them!)
65
66 BOOL isDirty() const { return mDirty; }
67 void setDirty (BOOL aDirty) { mDirty = aDirty; }
68
69 const ComObjPtr <HardDisk> &hardDisk() const { return mHardDisk; }
70 StorageBus_T bus() const { return mBus; }
71 LONG channel() const { return mChannel; }
72 LONG device() const { return mDevice; }
73
74 void updateHardDisk (const ComObjPtr <HardDisk> &aHardDisk, BOOL aDirty)
75 {
76 mHardDisk = aHardDisk;
77 mDirty = aDirty;
78 }
79
80 // for VirtualBoxSupportErrorInfoImpl
81 static const wchar_t *getComponentName() { return L"HardDiskAttachment"; }
82
83private:
84
85 BOOL mDirty;
86 ComObjPtr <HardDisk> mHardDisk;
87 StorageBus_T mBus;
88 LONG mChannel;
89 LONG mDevice;
90};
91
92COM_DECL_READONLY_ENUM_AND_COLLECTION (HardDiskAttachment)
93
94#endif // ____H_HARDDISKATTACHMENTIMPL
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