Application.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 Dennis Weigelt
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 <filesystem>
29#include <memory>
30#include <string>
31
34
36{
37 using PropertyEnabledMap = std::map<std::string, bool>;
38
39 /**
40 * @class Application
41 * @ingroup data_structure
42 * @brief Class containing data about an application
43 * Provides methods to get and set the date contained in the application. It doesn't manage the application
44 * therefore changes in this class won't synchronize to the actual configuration files.
45 */
47 {
48
49 private:
50 std::string name; /// pretty name of the app
51 std::string executableName; /// name of the executable
52 std::filesystem::path executablePath; /// directory where the app resides
53 std::string packageName;
54 bool found;
55
56 protected:
60
61 public:
62 /**
63 * Constructor that sets the name and the path to the executable of the application.
64 * @param name name of the application
65 * @param executablePath path to the binary executable of the application
66 */
67 Application(std::string name, std::string executablePath, std::string packageName);
68
69 /**
70 * Copy constructor
71 * @param name name of the application
72 * @param executablePath path to the binary executable of the application
73 */
75
76 /**
77 * @return the name of this application
78 */
79 std::string getName();
80
81 /**
82 * @return the name of executable of this application
83 */
84 std::string getExecutableName();
85
86 /**
87 * @return the absolute path to the executable of this application
88 */
89 std::string getExecutableAbsPath();
90
91 /**
92 * @return the path to the executable file of this application
93 */
94 std::string getPathToExecutable();
95
96 std::string getPackageName();
97
98 bool isDefaultPropertyEnabled(std::string name);
99 void setDefaultPropertyEnabled(std::string name, bool enabled);
100
101 bool isDefaultProperty(std::string name);
102 void setIsDefaultProperty(std::string name, bool defaultValue);
103
104 /**
105 * @return the properties of this application
106 **/
108
109 /**
110 * Sets the properties of this application. These properties (along with the
111 * default config) define the behaviour of the application on start.
112 * @param properties new properties
113 */
115
116 bool getFound();
117
118 void updateFound();
119 };
120
121 using ApplicationPtr = std::shared_ptr<Application>;
122 using ApplicationVectorPtr = std::shared_ptr<std::vector<ApplicationPtr>>;
123} // namespace ScenarioManager::Data_Structure
void setProperties(armarx::PropertyDefinitionsPtr properties)
Sets the properties of this application.
void setDefaultPropertyEnabled(std::string name, bool enabled)
armarx::PropertyDefinitionsPtr properties
Definition Application.h:57
Application(std::string name, std::string executablePath, std::string packageName)
Constructor that sets the name and the path to the executable of the application.
void setIsDefaultProperty(std::string name, bool defaultValue)
armarx::PropertyDefinitionsPtr getProperties()
std::shared_ptr< Application > ApplicationPtr
std::map< std::string, bool > PropertyEnabledMap
Definition Application.h:37
std::shared_ptr< std::vector< ApplicationPtr > > ApplicationVectorPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.