scenarioitem.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package ArmarXCore::core
19  * @author Cedric Seehausen (usdnr at kit dot edu)
20  * @date 2016
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
25 
26 #pragma once
27 
28 #include "treeitem.h"
30 #include <QVector>
31 #include <QVariant>
32 
33 /**
34 * @class ScenarioItem
35 * @brief TreeItem representing data contained in a Scenario or an Application.
36 */
37 
38 class ScenarioItem : public TreeItem
39 {
40 public:
41  /**
42  * Constructor that sets the data contained in this item.
43  * @param rootData data
44  */
45  ScenarioItem(QList<QVariant> rootData);
46 
47  /**
48  * Constructor that sets the scenario-data contained in this item.
49  * @param scenario Scenario to read out the data
50  */
52 
53  /**
54  * Constructor that sets the application-data contained in this item.
55  * @param application Application to read out the data
56  */
58 
59  ScenarioItem(std::string name, std::vector<ScenarioManager::Data_Structure::ApplicationInstancePtr> applications);
60  std::string getPackageName();
61 
62  /**
63  * Clears the item_data and parses the Scenario or Application for new data.
64  */
65  void update();
66 
67  /**
68  * If this item represents a Scenario, it is returned.
69  * @return the Scenario represented by this item
70  */
72 
73  /**
74  * If this item represents an Application, it is returned.
75  * @return the Application represented by this item
76  */
79 
80 private:
83 
84  std::string packageName;
86 };
87 
88 Q_DECLARE_METATYPE(ScenarioItem*)
ScenarioItem
TreeItem representing data contained in a Scenario or an Application.
Definition: scenarioitem.h:38
ScenarioItem::ScenarioItem
ScenarioItem(QList< QVariant > rootData)
Constructor that sets the data contained in this item.
Definition: scenarioitem.cpp:35
ScenarioManager::Data_Structure::ApplicationInstancePtr
std::shared_ptr< ApplicationInstance > ApplicationInstancePtr
Definition: ApplicationInstance.h:33
ScenarioManager::Data_Structure::ScenarioPtr
std::shared_ptr< Scenario > ScenarioPtr
Definition: Scenario.h:36
ScenarioItem::getPackageName
std::string getPackageName()
Definition: scenarioitem.cpp:180
Scenario.h
TreeItem
Definition: treeitem.h:46
ScenarioManager::Data_Structure::ApplicationInstanceVectorPtr
std::shared_ptr< std::vector< ApplicationInstancePtr > > ApplicationInstanceVectorPtr
Definition: ApplicationInstance.h:35
treeitem.h
ScenarioItem::getApplicationInstances
ScenarioManager::Data_Structure::ApplicationInstanceVectorPtr getApplicationInstances()
Definition: scenarioitem.cpp:195
ScenarioItem::update
void update()
Clears the item_data and parses the Scenario or Application for new data.
Definition: scenarioitem.cpp:71
ScenarioItem::getScenario
ScenarioManager::Data_Structure::ScenarioPtr getScenario()
If this item represents a Scenario, it is returned.
Definition: scenarioitem.cpp:185
ScenarioItem::getApplicationInstance
ScenarioManager::Data_Structure::ApplicationInstancePtr getApplicationInstance()
If this item represents an Application, it is returned.
Definition: scenarioitem.cpp:190