VirtualBox

source: vbox/trunk/src/VBox/Main/include/CloudProviderManagerImpl.h@ 75663

Last change on this file since 75663 was 75663, checked in by vboxsync, 6 years ago

Main/ExtPackManager+CloudProviderManager+VirtualBox: Handle runtime install and uninstall of extension packs containing cloud providers. This is a safeguard against uninstalling active cloud providers (which would cause crashes), and makes the install more convcenient. At the same time it eliminated the need to have a special "detect all cloud providers" logic when VBoxSVC is started. It achieves perfect singleton property of the per-extpack CloudProviderManager and the related CloudProvider objects. Nothing is ever created twice (which would cause trouble with coordinating e.g. the profile file updates).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 KB
Line 
1/* $Id: CloudProviderManagerImpl.h 75663 2018-11-22 14:00:59Z vboxsync $ */
2/** @file
3 * VirtualBox COM class implementation
4 */
5
6/*
7 * Copyright (C) 2018 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
19#ifndef ____H_CLOUDPROVIDERMANAGERIMPL
20#define ____H_CLOUDPROVIDERMANAGERIMPL
21
22#include "CloudProviderManagerWrap.h"
23
24
25class ATL_NO_VTABLE CloudProviderManager
26 : public CloudProviderManagerWrap
27{
28public:
29 DECLARE_EMPTY_CTOR_DTOR(CloudProviderManager)
30
31 HRESULT FinalConstruct();
32 void FinalRelease();
33
34 HRESULT init();
35 void uninit();
36
37#ifdef VBOX_WITH_EXTPACK
38 // Safe helpers, take care of caller and lock themselves.
39 bool i_canRemoveExtPack(IExtPack *aExtPack);
40 void i_addExtPack(IExtPack *aExtPack);
41#endif
42
43private:
44 // wrapped ICloudProviderManager attributes and methods
45 HRESULT getProviders(std::vector<ComPtr<ICloudProvider> > &aProviders);
46 HRESULT getProviderById(const com::Guid &aProviderId,
47 ComPtr<ICloudProvider> &aProvider);
48 HRESULT getProviderByShortName(const com::Utf8Str &aProviderName,
49 ComPtr<ICloudProvider> &aProvider);
50 HRESULT getProviderByName(const com::Utf8Str &aProviderName,
51 ComPtr<ICloudProvider> &aProvider);
52
53private:
54#ifdef VBOX_WITH_EXTPACK
55 typedef std::map<com::Utf8Str, ComPtr<ICloudProviderManager> > ExtPackNameCloudProviderManagerMap;
56 ExtPackNameCloudProviderManagerMap m_mapCloudProviderManagers;
57 typedef std::vector<com::Utf8Str> ExtPackNameVec;
58 ExtPackNameVec m_astrExtPackNames;
59#endif
60
61 typedef std::vector<ComPtr<ICloudProvider> > CloudProviderVec;
62 CloudProviderVec m_apCloudProviders;
63};
64
65#endif // !____H_CLOUDPROVIDERMANAGERIMPL
66
67/* vi: set tabstop=4 shiftwidth=4 expandtab: */
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