1 | /** @file
|
---|
2 | *
|
---|
3 | * VirtualBox COM class implementation
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2009 Oracle Corporation
|
---|
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 |
|
---|
18 | #ifndef ____H_BANDWIDTHGROUPIMPL
|
---|
19 | #define ____H_BANDWIDTHGROUPIMPL
|
---|
20 |
|
---|
21 | #include "VirtualBoxBase.h"
|
---|
22 | #include "BandwidthControlImpl.h"
|
---|
23 |
|
---|
24 | class ATL_NO_VTABLE BandwidthGroup :
|
---|
25 | public VirtualBoxBase,
|
---|
26 | VBOX_SCRIPTABLE_IMPL(IBandwidthGroup)
|
---|
27 | {
|
---|
28 | public:
|
---|
29 | VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(BandwidthGroup, IBandwidthGroup)
|
---|
30 |
|
---|
31 | DECLARE_NOT_AGGREGATABLE(BandwidthGroup)
|
---|
32 |
|
---|
33 | DECLARE_PROTECT_FINAL_CONSTRUCT()
|
---|
34 |
|
---|
35 | BEGIN_COM_MAP(BandwidthGroup)
|
---|
36 | COM_INTERFACE_ENTRY(ISupportErrorInfo)
|
---|
37 | COM_INTERFACE_ENTRY(IBandwidthGroup)
|
---|
38 | COM_INTERFACE_ENTRY(IDispatch)
|
---|
39 | END_COM_MAP()
|
---|
40 |
|
---|
41 | BandwidthGroup() { };
|
---|
42 | ~BandwidthGroup() { };
|
---|
43 |
|
---|
44 | // public initializer/uninitializer for internal purposes only
|
---|
45 | HRESULT init(BandwidthControl *aParent,
|
---|
46 | const Utf8Str &aName,
|
---|
47 | BandwidthGroupType_T aType,
|
---|
48 | ULONG aMaxMbPerSec);
|
---|
49 | HRESULT init(BandwidthControl *aParent, BandwidthGroup *aThat, bool aReshare = false);
|
---|
50 | HRESULT initCopy(BandwidthControl *aParent, BandwidthGroup *aThat);
|
---|
51 | void uninit();
|
---|
52 |
|
---|
53 | HRESULT FinalConstruct();
|
---|
54 | void FinalRelease();
|
---|
55 |
|
---|
56 | STDMETHOD(COMGETTER(Name))(BSTR *aName);
|
---|
57 | STDMETHOD(COMGETTER(Type))(BandwidthGroupType_T *aType);
|
---|
58 | STDMETHOD(COMGETTER(Reference))(ULONG *aReferences);
|
---|
59 | STDMETHOD(COMGETTER(MaxMbPerSec))(ULONG *aMaxMbPerSec);
|
---|
60 | STDMETHOD(COMSETTER(MaxMbPerSec))(ULONG aMaxMbPerSec);
|
---|
61 |
|
---|
62 | // public methods only for internal purposes
|
---|
63 | void rollback();
|
---|
64 | void commit();
|
---|
65 | void unshare();
|
---|
66 |
|
---|
67 | const Utf8Str &getName() const;
|
---|
68 | BandwidthGroupType_T getType() const;
|
---|
69 | ULONG getMaxMbPerSec() const;
|
---|
70 | ULONG getReferences() const;
|
---|
71 |
|
---|
72 | void reference();
|
---|
73 | void release();
|
---|
74 |
|
---|
75 | ComObjPtr<BandwidthGroup> getPeer();
|
---|
76 |
|
---|
77 | private:
|
---|
78 | struct Data;
|
---|
79 | Data *m;
|
---|
80 | };
|
---|
81 |
|
---|
82 | #endif // ____H_BANDWIDTHGROUPIMPL
|
---|
83 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|