StateGroupGenerator.cpp
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
19  * @author
20  * @date
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 #include "StateGroupGenerator.h"
25 
26 #include <fstream>
27 #include <time.h>
28 #include <algorithm>
29 
30 #include <boost/format.hpp>
31 #include <SimoxUtility/algorithm/string/string_tools.h>
32 
37 
40 
42 
43 using namespace armarx;
44 
45 Ice::StringSeq StatechartGroupGenerator::findStatechartGroupFiles(const std::string& statechartsPath)
46 {
47  Ice::StringSeq groups;
48 
49  for (std::filesystem::recursive_directory_iterator end, dir(statechartsPath); dir != end; ++dir)
50  {
51  // search for all statechart group xml files
52  if (dir->path().extension() == ".scgxml" && dir->path().string().find("deprecated") == std::string::npos)
53  {
54  groups.push_back(dir->path().string());
55  ARMARX_DEBUG << dir->path().string();
56  }
57  }
58  return groups;
59 }
60 
61 bool StatechartGroupGenerator::generateStateFile(const std::string& statechartGroupXmlFilePath, const std::string& statePath, const std::string& packagePath, const std::optional<std::string>& packageIncludePath)
62 {
64  reader->readXml(std::filesystem::path(statechartGroupXmlFilePath));
65  //ARMARX_INFO_S << reader->getPackageName();
66  CMakePackageFinder finder(reader->getPackageName(), packagePath, false, false);
67  ARMARX_CHECK_EXPRESSION(finder.packageFound()) << reader->getPackageName() << " at " << packagePath;
68  std::filesystem::path buildDir = finder.getBuildDir();
69 
70  VariantInfoPtr variantInfo = VariantInfo::ReadInfoFilesRecursive(reader->getPackageName(), packagePath, false);
71 
72  std::filesystem::path boostStatePath(statePath);
73  return generateStateFile(boostStatePath.filename().replace_extension().string(),
74  RapidXmlReader::FromFile(statePath),
75  buildDir,
76  reader->getPackageName(),
77  reader->getGroupName(),
78  reader->getProxies(),
79  reader->contextGenerationEnabled(),
80  variantInfo,
81  false,
82  packageIncludePath.value_or(reader->getPackageName()));
83 }
84 
85 std::string packageToIncludePath(const std::string& packageName)
86 {
87  const auto splits = simox::alg::split(packageName, "_");
88  return simox::alg::join(splits, "/");
89 }
90 
91 bool StatechartGroupGenerator::generateStateFile(const std::string& stateName, RapidXmlReaderPtr reader, std::filesystem::path buildDir, const std::string& packageName, const std::string& groupName, const std::vector<std::string>& proxies, bool contextGenerationEnabled, const VariantInfoPtr& variantInfo, bool forceRewrite, const std::optional<std::string>& packageIncludePath)
92 {
93  std::filesystem::path outputPath = buildDir / "source" / packageIncludePath.value_or(packageName) / "statecharts" / groupName / (stateName + ".generated.h");
94 
95  std::filesystem::path dir = outputPath;
96  dir.remove_filename();
97  std::filesystem::create_directories(dir);
98  // ARMARX_INFO_S << "generating into " << outputPath.string();
99 
100  std::vector<std::string> namespaces({"armarx", groupName});
101  std::string cpp = XmlStateBaseClassGenerator::GenerateCpp(namespaces,
102  reader,
103  proxies,
104  contextGenerationEnabled,
105  groupName,
106  variantInfo);
107 
108  time_t rawtime;
109  struct tm* timeinfo;
110  char buffer [80];
111  time(&rawtime);
112  timeinfo = localtime(&rawtime);
113  strftime(buffer, 80, "%Y-%m-%d %H:%M:%S%n", timeinfo);
114  writeFileContents(outputPath.string() + ".touch", std::string(buffer));
115 
116  if(cpp.empty())
117  {
118  ARMARX_WARNING << "Could not generate state file!";
119  return false;
120  }
121 
122  if (forceRewrite)
123  {
124  writeFileContents(outputPath.string(), cpp);
125  return true;
126  }
127 
128  writeFileContentsIfChanged(outputPath.string(), cpp);
129  return true;
130 
131  //ARMARX_INFO_S << "written " << cpp.length() << " bytes to " << outputPath.string();
132 }
133 
134 bool StatechartGroupGenerator::generateStatechartContextFile(const std::string& statechartGroupXmlFilePath, const std::string& packagePath, const std::optional<std::string>& packageIncludePath)
135 {
137  reader->readXml(std::filesystem::path(statechartGroupXmlFilePath));
138 
139  if (!reader->contextGenerationEnabled())
140  {
141  throw LocalException("Will not generate context for ") << statechartGroupXmlFilePath << ". Context generation is not enabled for this group.";
142  }
143 
144  VariantInfoPtr variantInfo = VariantInfo::ReadInfoFilesRecursive(reader->getPackageName(), packagePath, false);
145 
146  CMakePackageFinder finder(reader->getPackageName(), packagePath, false, false);
147  ARMARX_CHECK_EXPRESSION(finder.packageFound()) << reader->getPackageName() << " at " << packagePath;
148  std::filesystem::path buildDir = finder.getBuildDir();
149 
150  return generateStatechartContextFile(buildDir,
151  reader->getPackageName(),
152  reader->getGroupName(),
153  reader->getProxies(),
154  variantInfo,
155  getVariantTypesOfStatesWithNoCpp(reader, variantInfo),
156  false,
157  packageIncludePath);
158 }
159 
160 
161 
162 bool StatechartGroupGenerator::generateStatechartContextFile(std::filesystem::path buildDir, const std::string& packageName, const std::string& groupName, const std::vector<std::string>& proxies, const VariantInfoPtr& variantInfo, const std::set<std::string>& usedVariantTypes, bool forceRewrite, const std::optional<std::string>& packageIncludePath)
163 {
164  std::filesystem::path outputPath = buildDir / "source" / packageIncludePath.value_or(packageName) / "statecharts" / groupName;
165  std::filesystem::path baseClassPath = outputPath / (groupName + "StatechartContextBase.generated.h");
166  outputPath /= (groupName + "StatechartContext.generated.h");
167 
168  std::filesystem::path dir = outputPath;
169 
170  dir.remove_filename();
171  std::filesystem::create_directories(dir);
172 
173  // ARMARX_INFO_S << "generating into " << outputPath.string();
174  std::vector<std::string> namespaces({"armarx", groupName});
175  std::string cpp, cppBase;
176  std::tie(cpp, cppBase) = XmlContextBaseClassGenerator::GenerateCpp(namespaces,
177  proxies,
178  groupName,
179  variantInfo,
180  usedVariantTypes);
181 
182  time_t rawtime;
183  struct tm* timeinfo;
184  char buffer [80];
185  time(&rawtime);
186  timeinfo = localtime(&rawtime);
187  strftime(buffer, 80, "%Y-%m-%d %H:%M:%S%n", timeinfo);
188  writeFileContents(outputPath.string() + ".touch", std::string(buffer));
189  writeFileContents(baseClassPath.string() + ".touch", std::string(buffer));
190 
191  ARMARX_DEBUG << "Filename: " << outputPath.string();
192  ARMARX_DEBUG << "Content: \n" << cpp;
193 
194  if(cpp.empty())
195  {
196  ARMARX_WARNING << "Failed to generate statechart context file!";
197  return false;
198  }
199 
200  if (forceRewrite)
201  {
202  writeFileContents(outputPath.string(), cpp);
203  writeFileContents(baseClassPath.string(), cppBase);
204  return true;
205  }
206 
207  bool result = writeFileContentsIfChanged(outputPath.string(), cpp);
208  writeFileContentsIfChanged(baseClassPath.string(), cppBase) || result;
209 
210  return true;
211 
212  //ARMARX_INFO_S << "written " << cpp.length() << " bytes to " << outputPath.string();
213 }
214 
215 bool StatechartGroupGenerator::generateStatechartGroupCMakeSourceListFile(StatechartGroupXmlReaderPtr reader, const std::filesystem::path& buildDir, VariantInfoPtr variantInfo, bool forceRewrite, const std::optional<std::string>& packageIncludePath, const bool nextGenBehavior)
216 {
217  ARMARX_DEBUG << "Generating cmake file for " << reader->getGroupName();
218 
219  ARMARX_CHECK_EXPRESSION(std::filesystem::exists(buildDir)) << buildDir.string();
220  auto groupName = reader->getGroupName();
221 
222  auto packageName = reader->getPackageName();
223 
224  std::filesystem::path outputPath = buildDir / "source" / packageIncludePath.value_or(packageName) / "statecharts" / groupName;
225  std::filesystem::path generatedFileName = outputPath / (groupName + "Files.generated.cmake");
226  std::filesystem::path dir = outputPath;
227  dir.remove_filename();
228  std::filesystem::create_directories(dir);
229 
230 
231  Ice::StringSeq xmlFiles, headerFiles, sourceFiles;
232  xmlFiles = reader->getStateFilepaths();
233 
234 
235  Ice::StringSeq libs;
236  // add libs required for all statecharts:
237  libs.push_back("ArmarXCore");
238  libs.push_back("ArmarXCoreStatechart");
239  libs.push_back("ArmarXCoreObservers");
240 
241  for (std::string& xmlFile : xmlFiles)
242  {
243  auto stateNode = RapidXmlReader::FromFile(xmlFile);
244  auto types = XmlStateBaseClassGenerator::GetUsedInnerNonBasicVariantTypes(stateNode->getRoot("State"), variantInfo);
245  // ARMARX_INFO << "types: " << (Ice::StringSeq(types.begin(), types.end()));
246 
247  for (std::string& lib : variantInfo->findLibNames(Ice::StringSeq(types.begin(), types.end())))
248  {
249  auto libName = lib;
250  if (!Contains(libs, libName))
251  {
252  libs.push_back(libName);
253  }
254  }
255  }
256 
257  auto proxies = reader->getProxies();
258 
259  for (VariantInfo::LibEntryPtr lib : variantInfo->getLibs())
260  {
261  auto libName = lib->getName();
262  for (VariantInfo::ProxyEntryPtr proxy : lib->getProxies())
263  {
264  std::string proxyMemberName = proxy->getMemberName();
265 
266  std::string proxyId = boost::str(boost::format("%s.%s") % libName % proxyMemberName);
267  if (std::find(proxies.begin(), proxies.end(), proxyId) != proxies.end())
268  {
269  if (!Contains(libs, libName))
270  {
271  libs.push_back(libName);
272  }
273 
274  for (auto& additionalLibName : proxy->getLibraries())
275  {
276  if (!Contains(libs, additionalLibName))
277  {
278  libs.push_back(additionalLibName);
279  }
280  }
281  }
282  }
283  }
284 
285  // ARMARX_INFO << VAROUT(libs);
286 
287 
288  std::filesystem::path groupFilePath(reader->getGroupDefinitionFilePath());
289  std::filesystem::path groupDir = groupFilePath.parent_path();
290 
291  for (std::string& xmlFile : xmlFiles)
292  {
293 
294  auto headerFilePath = std::filesystem::path(xmlFile).replace_extension("h");
295  // ARMARX_INFO << "Checking " << headerFilePath;
296  if (std::filesystem::exists(headerFilePath))
297  {
298  headerFiles.push_back("./" + ArmarXDataPath::relativeTo(groupDir.string(), headerFilePath.string()));
299  }
300  auto sourceFilePath = std::filesystem::path(xmlFile).replace_extension("cpp");
301  if (std::filesystem::exists(sourceFilePath))
302  {
303  sourceFiles.push_back("./" + ArmarXDataPath::relativeTo(groupDir.string(), sourceFilePath.string()));
304  }
305  xmlFile = "./" + ArmarXDataPath::relativeTo(groupDir.string(), xmlFile);
306  }
307 
308  const std::string cmakeFileContent = [&]() -> std::string {
309  if(nextGenBehavior)
310  {
311  return CMakeSourceListGenerator::GenerateCMakeFileNextGen(groupName, xmlFiles, sourceFiles, headerFiles, libs);
312  }
313 
314  return CMakeSourceListGenerator::GenerateCMakeFile(groupName, xmlFiles, sourceFiles, headerFiles, libs);
315  } ();
316 
317  time_t rawtime;
318  struct tm* timeinfo;
319  char buffer [80];
320  time(&rawtime);
321  timeinfo = localtime(&rawtime);
322  strftime(buffer, 80, "%Y-%m-%d %H:%M:%S%n", timeinfo);
323 
324  ARMARX_DEBUG << "Writing file " << outputPath;
325 
326  writeFileContents(outputPath.string() + ".touch", std::string(buffer));
327  // writeFileContents(baseClassPath.string() + ".touch", std::string(buffer));
328 
329  if(std::string(buffer).empty())
330  {
331  ARMARX_WARNING << "Failed to generate statechart context file!";
332  return false;
333  }
334 
335  if (forceRewrite)
336  {
337  writeFileContents(outputPath.string(), cmakeFileContent);
338  return true;
339  }
340 
341  writeFileContentsIfChanged(generatedFileName.string(), cmakeFileContent) ;
342 
343  return true;
344 }
345 
346 bool StatechartGroupGenerator::generateStatechartGroupCMakeSourceListFile(const std::string& statechartGroupXmlFilePath, const std::filesystem::path& buildDir, bool forceRewrite, const std::optional<std::string>& packageIncludePath, const bool nextGenBehavior)
347 {
348 
350  reader->readXml(std::filesystem::path(statechartGroupXmlFilePath));
351 
352  VariantInfoPtr variantInfo = VariantInfo::ReadInfoFilesRecursive(reader->getPackageName(), buildDir.string(), false);
353  return generateStatechartGroupCMakeSourceListFile(reader, buildDir, variantInfo, forceRewrite, packageIncludePath, nextGenBehavior);
354 }
355 
356 bool StatechartGroupGenerator::generateStatechartGroupCMakeSourceListFiles(const std::string& packageName, const std::string& statechartsDir, const std::filesystem::path& buildDir, bool forceRewrite, const std::string& dataDir, const std::map<std::string, std::string>& dependencies, const std::optional<std::string>& packageIncludePath, const bool nextGenBehavior)
357 {
358  bool written = false;
359  VariantInfoPtr variantInfo = readVariantInfoWithPaths(packageName, buildDir.string(), dataDir, dependencies);
360  auto groupFiles = findStatechartGroupFiles(statechartsDir);
361  for (auto& group : groupFiles)
362  {
364  reader->readXml(std::filesystem::path(group));
365 
366  written |= generateStatechartGroupCMakeSourceListFile(reader, buildDir, variantInfo, forceRewrite, packageIncludePath, nextGenBehavior);
367 
368  }
369  return written;
370 }
371 
372 VariantInfoPtr StatechartGroupGenerator::readVariantInfoWithPaths(const std::string& packageName, const std::string& buildDir, const std::string& dataDir, const std::map<std::string, std::string>& dependencies)
373 {
374  VariantInfoPtr variantInfo(new VariantInfo());
375  std::filesystem::path variantInfoFile(dataDir);
376  variantInfoFile /= packageName;
377  variantInfoFile /= "VariantInfo-" + packageName + ".xml";
378 
379  if (!variantInfo->isPackageLoaded(packageName) && std::filesystem::exists(variantInfoFile))
380  {
381  RapidXmlReaderPtr xmlReader = RapidXmlReader::FromFile(variantInfoFile.string());
382  variantInfo->readVariantInfo(xmlReader, buildDir, packageName);
383  ARMARX_DEBUG_S << "Read " << variantInfoFile.string();
384  }
385  for (auto& dep : dependencies)
386  {
387  variantInfo = VariantInfo::ReadInfoFilesRecursive(dep.first, dep.second, false, variantInfo);
388  }
389  return variantInfo;
390 }
391 
392 bool StatechartGroupGenerator::generateStatechartGroupCMakeSourceListFile(const std::string& packageName, const std::string& statechartGroupXmlFilePath, const std::filesystem::path& buildDir, bool forceRewrite, const std::string& dataDir, const std::map<std::string, std::string>& dependencies, const std::optional<std::string>& packageIncludePath, const bool nextGenBehavior)
393 {
394  auto variantInfo = readVariantInfoWithPaths(packageName, buildDir.string(), dataDir, dependencies);
395 
397  reader->readXml(std::filesystem::path(statechartGroupXmlFilePath));
398 
399  return generateStatechartGroupCMakeSourceListFile(reader, buildDir, variantInfo, forceRewrite, packageIncludePath, nextGenBehavior);
400 }
401 
402 bool StatechartGroupGenerator::writeFileContentsIfChanged(const std::string& path, const std::string& contents)
403 {
404  bool exists = std::filesystem::exists(std::filesystem::path(path));
405  auto oldContent = exists ? RapidXmlReader::ReadFileContents(path) : "";
406  if (exists && oldContent == contents)
407  {
408  return false;
409  }
410  ARMARX_DEBUG << "Writing " << path << std::endl;
411  writeFileContents(path, contents);
412  // if (!oldContent.empty())
413  // {
414  // writeFileContents(path + ".old", oldContent);
415  // }
416  return true;
417 }
418 
419 void StatechartGroupGenerator::writeFileContents(const std::string& path, const std::string& contents)
420 {
421  std::filesystem::create_directories(std::filesystem::path(path).parent_path());
422  std::ofstream file;
423  file.open(path.c_str());
424 
425  if (!file.is_open())
426  {
428  }
429  ARMARX_CHECK_EXPRESSION(!contents.empty()) << path;
430  ARMARX_DEBUG << "Writing to " << path;
431  file << contents;
432  file.flush();
433  file.close();
434 }
435 
436 std::set<std::string> StatechartGroupGenerator::getVariantTypesOfStatesWithNoCpp(StatechartGroupXmlReaderPtr groupReader, const VariantInfoPtr& variantInfo)
437 {
438  std::set<std::string> variantTypes;
439  std::set<std::string> alreadyLinkedTypes;
440  for (auto& statefile : groupReader->getStateFilepaths())
441  {
442  std::set<std::string>* currentTypeSet = &variantTypes;
443  RapidXmlReaderPtr stateReader = RapidXmlReader::FromFile(statefile);
444  auto headerFilePath = std::filesystem::path(statefile);
445  headerFilePath.replace_extension(std::filesystem::path("h"));
446  if (std::filesystem::exists(headerFilePath))
447  {
448  currentTypeSet = &alreadyLinkedTypes;
449  }
450  RapidXmlReaderNode stateNode = stateReader->getRoot("State");
451  std::set<std::string> types = XmlStateBaseClassGenerator::GetUsedInnerNonBasicVariantTypes(stateNode, variantInfo);
452  currentTypeSet->insert(types.begin(), types.end());
453  }
454  std::set<std::string> results;
455  std::set_difference(variantTypes.begin(), variantTypes.end(),
456  alreadyLinkedTypes.begin(), alreadyLinkedTypes.end(),
457  std::inserter(results, results.end()));
458  return results;
459 }
460 
461 std::set<std::string> StatechartGroupGenerator::getVariantTypesOfStates(StatechartGroupXmlReaderPtr groupReader, const VariantInfoPtr& variantInfo)
462 {
463  std::set<std::string> variantTypes;
464 
465  for (auto& statefile : groupReader->getStateFilepaths())
466  {
467  RapidXmlReaderPtr stateReader = RapidXmlReader::FromFile(statefile);
468  ARMARX_INFO << "Getting Variant types for " << statefile;
469  RapidXmlReaderNode stateNode = stateReader->getRoot("State");
470  std::set<std::string> types = XmlStateBaseClassGenerator::GetUsedInnerNonBasicVariantTypes(stateNode, variantInfo);
471  ARMARX_INFO << "Found variant types: " << Ice::StringSeq(types.begin(), types.end());
472  variantTypes.insert(types.begin(), types.end());
473  }
474 
475  return variantTypes;
476 }
armarx::RapidXmlReaderPtr
std::shared_ptr< RapidXmlReader > RapidXmlReaderPtr
Definition: RapidXmlReader.h:66
armarx::RapidXmlReader::FromFile
static RapidXmlReaderPtr FromFile(const std::string &path)
Definition: RapidXmlReader.h:497
armarx::ArmarXDataPath::relativeTo
static std::string relativeTo(const std::string &from, const std::string &to)
Transform an absolute filepath into a relative path of the other absolute filepath.
Definition: ArmarXDataPath.cpp:410
algorithm.h
armarx::StatechartGroupGenerator::generateStatechartContextFile
static bool generateStatechartContextFile(const std::string &statechartGroupXmlFilePath, const std::string &packagePath, const std::optional< std::string > &packageIncludePath=std::nullopt)
Definition: StateGroupGenerator.cpp:134
str
std::string str(const T &t)
Definition: UserAssistedSegmenterGuiWidgetController.cpp:42
armarx::RapidXmlReader::ReadFileContents
static std::string ReadFileContents(const std::string &path)
Definition: RapidXmlReader.h:462
armarx::CMakePackageFinder::packageFound
bool packageFound() const
Returns whether or not this package was found with cmake.
Definition: CMakePackageFinder.cpp:485
XmlStateBaseClassGenerator.h
armarx::CMakeSourceListGenerator::GenerateCMakeFileNextGen
static std::string GenerateCMakeFileNextGen(const std::string &groupName, const std::vector< std::string > &stateXMLFiles, std::vector< std::string > const &stateSourceFiles, std::vector< std::string > const &stateHeaderFiles, const std::vector< std::string > &libs)
Definition: CMakeSourceListGenerator.cpp:48
FileIOException.h
packageToIncludePath
std::string packageToIncludePath(const std::string &packageName)
Definition: StateGroupGenerator.cpp:85
armarx::StatechartGroupGenerator::generateStateFile
static bool generateStateFile(const std::string &statechartGroupXmlFilePath, const std::string &statePath, const std::string &packagePath, const std::optional< std::string > &packageIncludePath=std::nullopt)
Definition: StateGroupGenerator.cpp:61
cpp
IceStorm Admin cpp
Definition: CMakeLists.txt:87
armarx::StatechartGroupGenerator::writeFileContentsIfChanged
static bool writeFileContentsIfChanged(const std::string &path, const std::string &contents)
Definition: StateGroupGenerator.cpp:402
armarx::Contains
bool Contains(const ContainerType &container, const ElementType &searchElement)
Definition: algorithm.h:295
armarx::StatechartGroupGenerator::writeFileContents
static void writeFileContents(const std::string &path, const std::string &contents)
Definition: StateGroupGenerator.cpp:419
armarx::CMakePackageFinder
The CMakePackageFinder class provides an interface to the CMake Package finder capabilities.
Definition: CMakePackageFinder.h:53
armarx::StatechartProfilePtr
std::shared_ptr< class StatechartProfile > StatechartProfilePtr
Definition: StatechartContext.h:52
armarx::StatechartGroupGenerator::generateStatechartGroupCMakeSourceListFiles
static bool generateStatechartGroupCMakeSourceListFiles(const std::string &packageName, const std::string &statechartGroupXmlFilePath, const std::filesystem::path &buildDir, bool forceRewrite, const std::string &dataDir, const std::map< std::string, std::string > &dependencies, const std::optional< std::string > &packageIncludePath=std::nullopt, bool nextGenBehavior=false)
Definition: StateGroupGenerator.cpp:356
armarx::XmlContextBaseClassGenerator::GenerateCpp
static std::tuple< std::string, std::string > GenerateCpp(std::vector< std::string > namespaces, std::vector< std::string > proxies, std::string groupName, VariantInfoPtr variantInfo, const std::set< std::string > &usedVariantTypes)
Definition: XmlContextBaseClassGenerator.cpp:46
armarx::XmlStateBaseClassGenerator::GetUsedInnerNonBasicVariantTypes
static std::set< std::string > GetUsedInnerNonBasicVariantTypes(RapidXmlReaderNode stateNode, VariantInfoPtr variantInfo)
Definition: XmlStateBaseClassGenerator.cpp:55
cxxopts::empty
bool empty(const std::string &s)
Definition: cxxopts.hpp:255
armarx::StatechartGroupXmlReaderPtr
std::shared_ptr< StatechartGroupXmlReader > StatechartGroupXmlReaderPtr
Definition: GroupXmlReader.h:89
armarx::exceptions::local::FileOpenException
Definition: FileIOException.h:58
armarx::CMakeSourceListGenerator::GenerateCMakeFile
static std::string GenerateCMakeFile(const std::string &groupName, const std::vector< std::string > &stateXMLFiles, std::vector< std::string > const &stateSourceFiles, std::vector< std::string > const &stateHeaderFiles, const std::vector< std::string > &libs)
Definition: CMakeSourceListGenerator.cpp:11
ARMARX_DEBUG_S
#define ARMARX_DEBUG_S
Definition: Logging.h:198
armarx::VariantInfo::ReadInfoFilesRecursive
static VariantInfoPtr ReadInfoFilesRecursive(const std::string &rootPackageName, const std::string &rootPackagePath, bool showErrors, VariantInfoPtr variantInfo=VariantInfoPtr())
Definition: VariantInfo.cpp:347
ARMARX_DEBUG
#define ARMARX_DEBUG
Definition: Logging.h:177
armarx::VariantInfo::ProxyEntryPtr
std::shared_ptr< ProxyEntry > ProxyEntryPtr
Definition: VariantInfo.h:71
armarx::RapidXmlReaderNode
Definition: RapidXmlReader.h:68
CMakeSourceListGenerator.h
armarx::StatechartGroupXmlReader
Definition: GroupXmlReader.h:38
armarx::StatechartGroupGenerator::findStatechartGroupFiles
static Ice::StringSeq findStatechartGroupFiles(const std::string &statechartsPath)
Definition: StateGroupGenerator.cpp:45
ExpressionException.h
armarx::StatechartGroupGenerator::generateStatechartGroupCMakeSourceListFile
static bool generateStatechartGroupCMakeSourceListFile(const std::string &statechartGroupXmlFilePath, const std::filesystem::path &buildDir, bool forceRewrite, const std::optional< std::string > &packageIncludePath=std::nullopt, bool nextGenBehavior=false)
Definition: StateGroupGenerator.cpp:346
ARMARX_CHECK_EXPRESSION
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
Definition: ExpressionException.h:73
StateGroupGenerator.h
XmlContextBaseClassGenerator.h
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::VariantInfoPtr
std::shared_ptr< VariantInfo > VariantInfoPtr
Definition: VariantInfo.h:39
armarx::CMakePackageFinder::getBuildDir
std::string getBuildDir() const
Definition: CMakePackageFinder.h:136
armarx::VariantInfo
Definition: VariantInfo.h:44
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:186
armarx::VariantInfo::LibEntryPtr
std::shared_ptr< LibEntry > LibEntryPtr
Definition: VariantInfo.h:172
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::split
std::vector< std::string > split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)
Definition: StringHelpers.cpp:36
armarx::XmlStateBaseClassGenerator::GenerateCpp
static std::string GenerateCpp(std::vector< std::string > namespaces, RapidXmlReaderPtr reader, const std::vector< std::string > &proxies, bool contextGenerationEnabled, std::string groupName, VariantInfoPtr variantInfo)
Definition: XmlStateBaseClassGenerator.cpp:45