Kevin Rocard | ee7ceed | 2013-07-05 10:56:27 +0200 | [diff] [blame^] | 1 | /* |
Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 2 | * INTEL CONFIDENTIAL |
Kevin Rocard | ee7ceed | 2013-07-05 10:56:27 +0200 | [diff] [blame^] | 3 | * Copyright © 2011 Intel |
Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 4 | * Corporation All Rights Reserved. |
Kevin Rocard | ee7ceed | 2013-07-05 10:56:27 +0200 | [diff] [blame^] | 5 | * |
Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 6 | * The source code contained or described herein and all documents related to |
| 7 | * the source code ("Material") are owned by Intel Corporation or its suppliers |
| 8 | * or licensors. Title to the Material remains with Intel Corporation or its |
| 9 | * suppliers and licensors. The Material contains trade secrets and proprietary |
| 10 | * and confidential information of Intel or its suppliers and licensors. The |
| 11 | * Material is protected by worldwide copyright and trade secret laws and |
| 12 | * treaty provisions. No part of the Material may be used, copied, reproduced, |
| 13 | * modified, published, uploaded, posted, transmitted, distributed, or |
| 14 | * disclosed in any way without Intel’s prior express written permission. |
Kevin Rocard | ee7ceed | 2013-07-05 10:56:27 +0200 | [diff] [blame^] | 15 | * |
Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 16 | * No license under any patent, copyright, trade secret or other intellectual |
| 17 | * property right is granted to or conferred upon you by disclosure or delivery |
| 18 | * of the Materials, either expressly, by implication, inducement, estoppel or |
| 19 | * otherwise. Any license under such intellectual property rights must be |
| 20 | * express and approved by Intel in writing. |
Kevin Rocard | ee7ceed | 2013-07-05 10:56:27 +0200 | [diff] [blame^] | 21 | * |
Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 22 | * CREATED: 2011-06-01 |
| 23 | * UPDATED: 2011-07-27 |
Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 24 | */ |
| 25 | #pragma once |
| 26 | |
| 27 | #include "ConfigurableElement.h" |
Guillaume Denneulin | a4ec15d | 2012-02-17 14:38:14 +0100 | [diff] [blame] | 28 | #include "SubsystemPlugins.h" |
Patrick Benavoli | 9bed7ce | 2011-11-20 20:04:35 +0100 | [diff] [blame] | 29 | #include <list> |
Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 30 | |
| 31 | class CSubsystemLibrary; |
| 32 | |
| 33 | class CSystemClass : public CConfigurableElement |
| 34 | { |
| 35 | public: |
Patrick Benavoli | 95ac034 | 2011-11-07 20:32:51 +0100 | [diff] [blame] | 36 | CSystemClass(); |
Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 37 | virtual ~CSystemClass(); |
| 38 | |
Kevin Rocard | ee7ceed | 2013-07-05 10:56:27 +0200 | [diff] [blame^] | 39 | /** Load subsystem plugin and fill the corresponding libraries. |
| 40 | * |
| 41 | * @param[out] strError is filled with new line separated errors if the function returns false, |
| 42 | * undefined otherwise. |
| 43 | * @param[in] pSubsystemPlugins The plugins to load. |
| 44 | * @param[in] bVirtualSubsystemFallback If a subsystem can not be found, use the virtual one. |
| 45 | * |
| 46 | * @return true if the plugins succesfully started or that a fallback is available, |
| 47 | false otherwise. |
| 48 | */ |
| 49 | bool loadSubsystems(string& strError, const CSubsystemPlugins* pSubsystemPlugins, |
| 50 | bool bVirtualSubsystemFallback = false); |
Guillaume Denneulin | a4ec15d | 2012-02-17 14:38:14 +0100 | [diff] [blame] | 51 | // Subsystem factory |
Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 52 | const CSubsystemLibrary* getSubsystemLibrary() const; |
| 53 | |
Kevin Rocard | 2fbe6e8 | 2013-03-26 17:09:29 +0100 | [diff] [blame] | 54 | /** |
| 55 | * Look for subsystems that need to be resynchronized. |
| 56 | * Consume the need to be resynchronized |
| 57 | * and fill a syncer set with all syncers that need to be resynchronized |
| 58 | * |
| 59 | * @param[out] syncerSet The syncer set to fill |
| 60 | */ |
Guillaume Denneulin | f2fd15a | 2012-12-20 17:53:29 +0100 | [diff] [blame] | 61 | void checkForSubsystemsToResync(CSyncerSet& syncerSet); |
| 62 | |
Kevin Rocard | 2fbe6e8 | 2013-03-26 17:09:29 +0100 | [diff] [blame] | 63 | /** |
| 64 | * Reset subsystems need to resync flag. |
| 65 | */ |
| 66 | void cleanSubsystemsNeedToResync(); |
| 67 | |
Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 68 | // base |
| 69 | virtual bool init(string& strError); |
| 70 | virtual string getKind() const; |
| 71 | |
Georges-Henri Baron | 326a31d | 2012-06-28 12:05:09 +0200 | [diff] [blame] | 72 | // From IXmlSource |
| 73 | virtual void toXml(CXmlElement& xmlElement, CXmlSerializingContext& serializingContext) const; |
| 74 | |
Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 75 | private: |
JhinX Lee | 4ebc098 | 2012-07-12 17:50:07 +0200 | [diff] [blame] | 76 | CSystemClass(const CSystemClass&); |
| 77 | CSystemClass& operator=(const CSystemClass&); |
Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 78 | // base |
| 79 | virtual bool childrenAreDynamic() const; |
| 80 | |
Patrick Benavoli | 9bed7ce | 2011-11-20 20:04:35 +0100 | [diff] [blame] | 81 | // Plugin symbol computation |
| 82 | static string getPluginSymbol(const string& strPluginPath); |
| 83 | |
Kevin Rocard | ee7ceed | 2013-07-05 10:56:27 +0200 | [diff] [blame^] | 84 | /** Load subsystem plugin shared libraries. |
| 85 | * |
| 86 | * @param[in:out] lstrPluginFiles is the path list of the plugins shared libraries to load. |
| 87 | * Successfully loaded plugins are removed from the list. |
| 88 | * @param[out] lstrError is the list of error that occured during loadings. |
| 89 | * |
| 90 | * @return true if at least one plugin has been succesfully loaded, false otherwise. |
| 91 | */ |
| 92 | bool loadPlugins(list<string>& lstrPluginFiles, list<string>& lstrError); |
Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 93 | |
Guillaume Denneulin | a4ec15d | 2012-02-17 14:38:14 +0100 | [diff] [blame] | 94 | // Subsystem factory |
Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 95 | CSubsystemLibrary* _pSubsystemLibrary; |
| 96 | }; |
| 97 | |