blob: ab2c42fb8053a1b3251b469f82d76b844843df4e [file] [log] [blame]
Kevin Rocard93250d12012-07-19 17:48:30 +02001/*
Patrick Benavoli68a91282011-08-31 11:23:23 +02002 * INTEL CONFIDENTIAL
3 * Copyright © 2011 Intel
4 * Corporation All Rights Reserved.
5 *
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.
15 *
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.
21 *
Patrick Benavoli68a91282011-08-31 11:23:23 +020022 * CREATED: 2011-06-01
23 * UPDATED: 2011-07-27
Patrick Benavoli68a91282011-08-31 11:23:23 +020024 */
25#include "SelectionCriteriaDefinition.h"
26#include "SelectionCriterion.h"
27
28CSelectionCriteriaDefinition::CSelectionCriteriaDefinition()
29{
30}
31
32string CSelectionCriteriaDefinition::getKind() const
33{
34 return "SelectionCriteriaDefinition";
35}
36
37// Selection Criterion creation
38CSelectionCriterion* CSelectionCriteriaDefinition::createSelectionCriterion(const string& strName, const CSelectionCriterionType* pSelectionCriterionType)
39{
40 CSelectionCriterion* pSelectionCriterion = new CSelectionCriterion(strName, pSelectionCriterionType);
41
42 addChild(pSelectionCriterion);
43
44 return pSelectionCriterion;
45}
46
47// Selection Criterion access
48const CSelectionCriterion* CSelectionCriteriaDefinition::getSelectionCriterion(const string& strName) const
49{
50 return static_cast<const CSelectionCriterion*>(findChild(strName));
51}
52
Patrick Benavolib71ccf72011-09-13 14:15:52 +020053CSelectionCriterion* CSelectionCriteriaDefinition::getSelectionCriterion(const string& strName)
Patrick Benavoli68a91282011-08-31 11:23:23 +020054{
Patrick Benavolib71ccf72011-09-13 14:15:52 +020055 return static_cast<CSelectionCriterion*>(findChild(strName));
Patrick Benavoli68a91282011-08-31 11:23:23 +020056}
Patrick Benavoli6ba361d2011-08-31 11:23:24 +020057
58// List available criteria
59void CSelectionCriteriaDefinition::listSelectionCriteria(string& strResult, bool bWithTypeInfo) const
60{
61 // Propagate
62 uint32_t uiNbChildren = getNbChildren();
63 uint32_t uiChild;
64
65 for (uiChild = 0; uiChild < uiNbChildren; uiChild++) {
66
67 const CSelectionCriterion* pSelectionCriterion = static_cast<const CSelectionCriterion*>(getChild(uiChild));
68
69 strResult += pSelectionCriterion->getFormattedDescription(bWithTypeInfo) + "\n";
70 }
71}
72