From 07a306aa81c435ac049f50aee41f05c319b37892 Mon Sep 17 00:00:00 2001 From: LAGNEAU Romain Date: Wed, 4 Dec 2024 10:58:36 +0100 Subject: [PATCH 1/4] [CORE] Moved include in the CPP, using forward declaration instead --- modules/core/include/visp3/core/vpXmlParser.h | 14 +++++++++++--- modules/core/src/tools/xml/vpXmlParser.cpp | 6 ++++++ modules/core/test/tools/xml/testXmlParser.cpp | 2 ++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/modules/core/include/visp3/core/vpXmlParser.h b/modules/core/include/visp3/core/vpXmlParser.h index adce5cad4f..7485b1ab48 100644 --- a/modules/core/include/visp3/core/vpXmlParser.h +++ b/modules/core/include/visp3/core/vpXmlParser.h @@ -45,8 +45,6 @@ #include -#include - #include #include #include @@ -54,6 +52,14 @@ #include #include +struct _xmlDoc; +typedef _xmlDoc xmlDoc; +typedef xmlDoc *xmlDocPtr; + +struct _xmlNode; +typedef _xmlNode xmlNode; +typedef xmlNode *xmlNodePtr; + BEGIN_VISP_NAMESPACE /*! \class vpXmlParser @@ -93,6 +99,8 @@ BEGIN_VISP_NAMESPACE A class to parse this document is declared as follows: \code + #include + class vpDataParser: public vpXmlParser { private: @@ -307,7 +315,7 @@ class VISP_EXPORT vpXmlParser static function vpXmlParser::cleanup() that calls xmlCleanupParser() that could be called just before exit(). */ - static void cleanup() { xmlCleanupParser(); } + static void cleanup(); //@} }; END_VISP_NAMESPACE diff --git a/modules/core/src/tools/xml/vpXmlParser.cpp b/modules/core/src/tools/xml/vpXmlParser.cpp index 140b5f83fe..87e62771ed 100644 --- a/modules/core/src/tools/xml/vpXmlParser.cpp +++ b/modules/core/src/tools/xml/vpXmlParser.cpp @@ -482,6 +482,12 @@ void vpXmlParser::save(const std::string &filename, bool append) xmlSaveFormatFile(filename.c_str(), doc, 1); xmlFreeDoc(doc); } + +void vpXmlParser::cleanup() +{ + xmlCleanupParser(); +} + END_VISP_NAMESPACE #elif !defined(VISP_BUILD_SHARED_LIBS) // Work around to avoid warning: libvisp_core.a(vpXmlParser.cpp.o) has no symbols diff --git a/modules/core/test/tools/xml/testXmlParser.cpp b/modules/core/test/tools/xml/testXmlParser.cpp index 98c41d3905..96192c96f6 100644 --- a/modules/core/test/tools/xml/testXmlParser.cpp +++ b/modules/core/test/tools/xml/testXmlParser.cpp @@ -58,6 +58,8 @@ #include #include +#include + #include #ifndef DOXYGEN_SHOULD_SKIP_THIS From 523313c2a94f68367ae53a07691bd08ee1d79ac0 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Thu, 5 Dec 2024 15:48:35 +0100 Subject: [PATCH 2/4] Fix typos --- modules/core/include/visp3/core/vpXmlParser.h | 15 +++++++-------- modules/core/src/tools/xml/vpXmlParser.cpp | 8 ++++---- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/modules/core/include/visp3/core/vpXmlParser.h b/modules/core/include/visp3/core/vpXmlParser.h index 7485b1ab48..a346013ab3 100644 --- a/modules/core/include/visp3/core/vpXmlParser.h +++ b/modules/core/include/visp3/core/vpXmlParser.h @@ -1,6 +1,6 @@ /* * ViSP, open source Visual Servoing Platform software. - * Copyright (C) 2005 - 2023 by Inria. All rights reserved. + * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,8 +36,8 @@ \brief Tools to simplify the creation of xml parser based on the libXML2 */ -#ifndef vpXmlParser_HH -#define vpXmlParser_HH +#ifndef VP_XML_PARSER_H +#define VP_XML_PARSER_H #include @@ -113,7 +113,7 @@ BEGIN_VISP_NAMESPACE range, step, size_filter - }dataToParse + } dataToParse vpDataParser(){ nodeMap["config"] = config; @@ -125,8 +125,7 @@ BEGIN_VISP_NAMESPACE virtual void writeMainClass(xmlNodePtr node); virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node); - // additionals methods specific to the data to parse - // such as: accessors + // additional methods specific to the data to parse such as: accessors } \endcode @@ -192,7 +191,7 @@ class VISP_EXPORT vpXmlParser As the content of the function depends on the structure of the file to read, data name, data types and data values, it has to be reimplemented - for every type of filenam + for every type of filename. \param doc : a pointer representing the document \param node : the root node of the document @@ -272,7 +271,7 @@ class VISP_EXPORT vpXmlParser dataToParse["size_filter"] = 3; \endcode - Or, you can use keyzord instead of number as key but it implies to declare + Or, you can use keyword instead of number as key but it implies to declare in the child class an enumeration type of the name. For example: \code diff --git a/modules/core/src/tools/xml/vpXmlParser.cpp b/modules/core/src/tools/xml/vpXmlParser.cpp index 87e62771ed..d75a23eed1 100644 --- a/modules/core/src/tools/xml/vpXmlParser.cpp +++ b/modules/core/src/tools/xml/vpXmlParser.cpp @@ -1,7 +1,7 @@ /**************************************************************************** * * ViSP, open source Visual Servoing Platform software. - * Copyright (C) 2005 - 2023 by Inria. All rights reserved. + * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,15 +30,15 @@ * * Description: * Tool to automatize the creation of xml parser based on the libXML2. - * -*****************************************************************************/ + */ #include -#include #ifdef VISP_HAVE_XML2 #include + +#include #include #include From fc4fbfba78323496777d570b49cdc17569d4ac5f Mon Sep 17 00:00:00 2001 From: LAGNEAU Romain Date: Tue, 10 Dec 2024 17:10:03 +0100 Subject: [PATCH 3/4] [CORE] Made libxml includes and libs private --- modules/core/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt index 3b2063d25d..4afd178d31 100644 --- a/modules/core/CMakeLists.txt +++ b/modules/core/CMakeLists.txt @@ -240,8 +240,8 @@ endif() # Misc: xml, pthread, zlib if(USE_XML2) - list(APPEND opt_incs ${XML2_INCLUDE_DIRS}) - list(APPEND opt_libs ${XML2_LIBRARIES}) + include_directories(${XML2_INCLUDE_DIRS}) + list(APPEND opt_libs_private ${XML2_LIBRARIES}) endif() if(USE_THREADS) From 35f1f3613c5efdbc4a27ca68c7e55ffd244ee738 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Wed, 11 Dec 2024 09:44:11 +0100 Subject: [PATCH 4/4] Minor to trigger a new build on ci --- modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp b/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp index d78b35b3c2..4e6a8e3730 100644 --- a/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp +++ b/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2023 by Inria. All rights reserved. * @@ -30,8 +29,7 @@ * * Description: * Interface to mavlink compatible controller using mavsdk 3rd party - * - *****************************************************************************/ + */ #include