aboutsummaryrefslogtreecommitdiffstats
path: root/parameter/XmlDomainImportContext.h
diff options
context:
space:
mode:
authorDavid Wagner <david.wagner@intel.com>2014-12-19 11:15:02 +0100
committerDavid Wagner <david.wagner@intel.com>2015-01-22 11:53:52 +0100
commit29fa61fc5bc02f72f99e66ad50e4de8cb6b8490b (patch)
tree5786f9d76eae3a29eb7f22a0727921979e53c8bb /parameter/XmlDomainImportContext.h
parentc39e7f4bbad04e92b53054b61b3f3deaa98ccd61 (diff)
downloadexternal_parameter-framework-29fa61fc5bc02f72f99e66ad50e4de8cb6b8490b.zip
external_parameter-framework-29fa61fc5bc02f72f99e66ad50e4de8cb6b8490b.tar.gz
external_parameter-framework-29fa61fc5bc02f72f99e66ad50e4de8cb6b8490b.tar.bz2
Extract and specialize domain import- and export-specific contexts
Import and Export of ConfigurableDomains have different context needs: e.g. the value representation is only used for export; auto-validation is only meaningful for import whereas the "with settings" context is common to both. We create two new classes, derived from XmlDomainSerializingContext and move most of its content to each class it belongs to. Change-Id: I56589cdb3a8ea417e11d2ed98ccd055d7cdead67 Signed-off-by: David Wagner <david.wagner@intel.com>
Diffstat (limited to 'parameter/XmlDomainImportContext.h')
-rw-r--r--parameter/XmlDomainImportContext.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/parameter/XmlDomainImportContext.h b/parameter/XmlDomainImportContext.h
new file mode 100644
index 0000000..ed48122
--- /dev/null
+++ b/parameter/XmlDomainImportContext.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2014, Intel Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation and/or
+ * other materials provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its contributors
+ * may be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#pragma once
+
+#include "XmlDomainSerializingContext.h"
+#include "SelectionCriteriaDefinition.h"
+
+#include <string>
+
+class CXmlDomainImportContext : public CXmlDomainSerializingContext
+{
+public:
+ CXmlDomainImportContext(std::string& strError, bool bWithSettings):
+ base(strError, bWithSettings), _bAutoValidationRequired(true) {}
+
+ // Criteria defintion
+ void setSelectionCriteriaDefinition(
+ const CSelectionCriteriaDefinition* pSelectionCriteriaDefinition)
+ {
+ _pSelectionCriteriaDefinition = pSelectionCriteriaDefinition;
+ }
+
+ const CSelectionCriteriaDefinition* getSelectionCriteriaDefinition() const
+ {
+ return _pSelectionCriteriaDefinition;
+ }
+
+ // Auto validation of configurations
+ void setAutoValidationRequired(bool bAutoValidationRequired)
+ {
+ _bAutoValidationRequired = bAutoValidationRequired;
+ }
+
+ bool autoValidationRequired() const
+ {
+ return _bAutoValidationRequired;
+ }
+
+private:
+ typedef CXmlDomainSerializingContext base;
+
+ // Criteria defintion
+ const CSelectionCriteriaDefinition* _pSelectionCriteriaDefinition;
+
+ // Auto validation of configurations
+ bool _bAutoValidationRequired;
+};
+