Skip to content

Commit

Permalink
Merge pull request #54 from asam-ev/2024-05-22
Browse files Browse the repository at this point in the history
Clean up the repo and remove Xodr/XoscSchemaChecker
  • Loading branch information
andreaskern74 authored May 23, 2024
2 parents 7449de9 + bddd4ec commit e96e30b
Show file tree
Hide file tree
Showing 159 changed files with 9,666 additions and 7,018 deletions.
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BasedOnStyle: Microsoft
Language: Cpp
InsertNewlineAtEOF: true
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 17)

add_definitions( -DDEV_ESSENTIAL_DISABLE_MAKE_RESULT_CHECK_RESERVED_ZERO=1 -DDEV_ESSENTIAL_DISABLE_DEPRECATED_WARNINGS=1)

file(STRINGS version QC4OPENX_VERSION LIMIT_COUNT 1)
project(qc4openx VERSION ${QC4OPENX_VERSION})

Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ install(
xosc_examples
DESTINATION
examples
)
)
37 changes: 19 additions & 18 deletions examples/checker_bundle_example/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@

#include "main.h"

#include "common/result_format/cChecker.h"
#include "common/result_format/cCheckerBundle.h"
#include "common/result_format/cParameterContainer.h"
#include "common/result_format/cResultContainer.h"
#include "common/result_format/c_checker.h"
#include "common/result_format/c_checker_bundle.h"
#include "common/result_format/c_parameter_container.h"
#include "common/result_format/c_result_container.h"

#include "common/config_format/cConfiguration.h"
#include "common/config_format/cConfigurationCheckerBundle.h"
#include "common/config_format/c_configuration.h"
#include "common/config_format/c_configuration_checker_bundle.h"

// Main Programm
int main(int argc, char* argv[])
int main(int argc, char *argv[])
{
std::string strToolpath = argv[0];

Expand Down Expand Up @@ -70,11 +70,12 @@ int main(int argc, char* argv[])
inputParams.Overwrite(configuration.GetParams());

// We search for parameters applied to our configuration.
cConfigurationCheckerBundle* checkerBundleConfig = configuration.GetCheckerBundleByName(CHECKER_BUNDLE_NAME);
cConfigurationCheckerBundle *checkerBundleConfig = configuration.GetCheckerBundleByName(CHECKER_BUNDLE_NAME);
if (nullptr != checkerBundleConfig)
inputParams.Overwrite(checkerBundleConfig->GetParams());
else
std::cerr << "No configuration for module '" << CHECKER_BUNDLE_NAME << "' found. Start with default params." << std::endl;
std::cerr << "No configuration for module '" << CHECKER_BUNDLE_NAME << "' found. Start with default params."
<< std::endl;
}
else if (StringEndsWith(ToLower(strFilepath), "--defaultconfig"))
{
Expand All @@ -96,7 +97,7 @@ int main(int argc, char* argv[])
return 0;
}

void ShowHelp(const std::string& toolPath)
void ShowHelp(const std::string &toolPath)
{
std::string applicationName = toolPath;
std::string applicationNameWithoutExt = toolPath;
Expand All @@ -106,27 +107,27 @@ void ShowHelp(const std::string& toolPath)
std::cout << "\n\nUsage of " << applicationNameWithoutExt << ":" << std::endl;
std::cout << "\nRun the application with xodr file: \n" << applicationName << " sample.xodr" << std::endl;
std::cout << "\nRun the application with dbqa configuration: \n" << applicationName << " config.xml" << std::endl;
std::cout << "\nRun the application and write empty report as default configuration: \n" << applicationName << " --defaultconfig" << std::endl;
std::cout << "\nRun the application and write empty report as default configuration: \n"
<< applicationName << " --defaultconfig" << std::endl;
std::cout << "\n\n";
}

void RunChecks(const cParameterContainer& inputParams)
void RunChecks(const cParameterContainer &inputParams)
{
// Now we define a result container which contains our results.
cResultContainer pResultContainer;

// Lets go on with the checker bundle. A bundle contains 0 or more checks.
cCheckerBundle* pExampleCheckerBundle = new cCheckerBundle(CHECKER_BUNDLE_NAME);
cCheckerBundle *pExampleCheckerBundle = new cCheckerBundle(CHECKER_BUNDLE_NAME);

// Add the checkerBundle to our results. You can do it later as well.
pResultContainer.AddCheckerBundle(pExampleCheckerBundle);

// Create a checker with a factory in the checker bundle
cChecker* pExampeChecker = pExampleCheckerBundle->CreateChecker("exampleChecker", "This is a description");
cChecker *pExampeChecker = pExampleCheckerBundle->CreateChecker("exampleChecker", "This is a description");

// Lets add now an issue
pExampeChecker->AddIssue(new cIssue("This is an information from the demo usecase",
INFO_LVL));
pExampeChecker->AddIssue(new cIssue("This is an information from the demo usecase", INFO_LVL));

// Lets add a summary for the checker bundle
unsigned int issueCount = pExampleCheckerBundle->GetIssueCount();
Expand All @@ -146,7 +147,7 @@ void RunChecks(const cParameterContainer& inputParams)
void WriteEmptyReport()
{
cResultContainer emptyReport;
cCheckerBundle* pCheckerBundle = new cCheckerBundle(CHECKER_BUNDLE_NAME);
cCheckerBundle *pCheckerBundle = new cCheckerBundle(CHECKER_BUNDLE_NAME);

emptyReport.AddCheckerBundle(pCheckerBundle);

Expand All @@ -164,4 +165,4 @@ void WriteEmptyReport()
emptyReport.WriteResults(ssReportFile.str());

std::cout << "Finished." << std::endl;
}
}
36 changes: 18 additions & 18 deletions examples/checker_bundle_example/src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,27 @@
class cParameterContainer;

/**
* Main function for application
*
* @param [in] argc Number of arguments in shell
* @param [in] argv Pointer to arguments
*
* @return The standard return value
*/
int main(int argc, char* argv[]);
* Main function for application
*
* @param [in] argc Number of arguments in shell
* @param [in] argv Pointer to arguments
*
* @return The standard return value
*/
int main(int argc, char *argv[]);

/**
* Shows the help for the application
* @param [in] applicationName The name of the application
*/
void ShowHelp(const std::string& applicationName);
* Shows the help for the application
* @param [in] applicationName The name of the application
*/
void ShowHelp(const std::string &applicationName);

/**
* Runs the checks
*/
void RunChecks(const cParameterContainer& inputParams);
* Runs the checks
*/
void RunChecks(const cParameterContainer &inputParams);

/*
* Writes an empty Report
*/
void WriteEmptyReport();
* Writes an empty Report
*/
void WriteEmptyReport();
4 changes: 2 additions & 2 deletions examples/checker_bundle_example/src/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#ifndef _STD_AFX_
#define _STD_AFX_

#include <sstream>
#include <fstream>
#include <memory>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <sstream>

#endif // _STD_INCLUDES_HEADER_FEP_XODR_MANIPULATION_
29 changes: 14 additions & 15 deletions examples/viewer_example/viewer_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
* with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

#include "viewer/iConnector.h"
#include "common/result_format/cIssue.h"
#include "common/result_format/cLocationsContainer.h"
#include <stdio.h>
#include "common/result_format/c_issue.h"
#include "common/result_format/c_locations_container.h"
#include "viewer/i_connector.h"
#include <cstring>
#include <stdio.h>

const char* lasterrormsg = "";
const char *lasterrormsg = "";

bool StartViewer()
{
std::cout << "START VIEWER EXAMPLE" << std::endl;
return true;
}

bool Initialize(const char* xoscPath, const char* xodrPath)
bool Initialize(const char *xoscPath, const char *xodrPath)
{
if (std::strcmp(xoscPath, "")==0 && std::strcmp(xodrPath,"")==0)
if (std::strcmp(xoscPath, "") == 0 && std::strcmp(xodrPath, "") == 0)
{
lasterrormsg = "ERROR: No valid xosc or xodr file found.";
return false;
Expand All @@ -32,23 +32,23 @@ bool Initialize(const char* xoscPath, const char* xodrPath)
return true;
}

bool AddIssue(void* issueToAdd)
bool AddIssue(void *issueToAdd)
{
auto issue = static_cast<cIssue*>(issueToAdd);
auto issue = static_cast<cIssue *>(issueToAdd);
std::cout << "ADD ISSUE: " << issue->GetDescription() << std::endl;
return true;
}

bool ShowIssue(void * itemToShow, void* locationToShow)
bool ShowIssue(void *itemToShow, void *locationToShow)
{
auto issue = static_cast<cIssue*>(itemToShow);
auto location = static_cast<cLocationsContainer*>(locationToShow);
auto issue = static_cast<cIssue *>(itemToShow);
auto location = static_cast<cLocationsContainer *>(locationToShow);
std::cout << "SHOW ISSUE: " << issue->GetDescription() << std::endl;
std::cout << "LOCATION: " << location->GetDescription() << std::endl;
return true;
}

const char* GetName()
const char *GetName()
{
return "Viewer Example";
}
Expand All @@ -59,8 +59,7 @@ bool CloseViewer()
return true;
}

const char* GetLastErrorMessage()
const char *GetLastErrorMessage()
{
return lasterrormsg;
}

107 changes: 0 additions & 107 deletions include/common/config_format/cConfiguration.h

This file was deleted.

Loading

0 comments on commit e96e30b

Please sign in to comment.