Skip to content

Commit

Permalink
Deprecated h headers (#294)
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
  • Loading branch information
ahcorde authored Jul 9, 2024
1 parent b6f5c53 commit 93dc7e3
Show file tree
Hide file tree
Showing 45 changed files with 1,399 additions and 886 deletions.
9 changes: 3 additions & 6 deletions qt_gui_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ set(qt_gui_cpp_SRCS
)

set(qt_gui_cpp_HDRS
include/qt_gui_cpp/plugin.h
include/qt_gui_cpp/plugin_bridge.h
include/qt_gui_cpp/plugin_context.h
include/qt_gui_cpp/plugin.hpp
include/qt_gui_cpp/plugin_bridge.hpp
include/qt_gui_cpp/plugin_context.hpp
)

qt5_wrap_cpp(qt_gui_cpp_MOCS ${qt_gui_cpp_HDRS})
Expand Down Expand Up @@ -83,9 +83,6 @@ install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)

# TODO(brawner) add ament_lint_auto tests here. Much of the c++ code needs to
# be updated for ROS2 style

if(BUILD_TESTING)
find_package(ament_cmake_pytest REQUIRED)

Expand Down
52 changes: 5 additions & 47 deletions qt_gui_cpp/include/qt_gui_cpp/composite_plugin_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,52 +33,10 @@
#ifndef qt_gui_cpp__CompositePluginProvider_H
#define qt_gui_cpp__CompositePluginProvider_H

#include "plugin_descriptor.h"
#include "plugin_provider.h"

#include <QList>
#include <QMap>
#include <QSet>
#include <QString>

namespace qt_gui_cpp
{

class CompositePluginProvider
: public PluginProvider
{

public:

CompositePluginProvider(const QList<PluginProvider*>& plugin_providers = QList<PluginProvider*>());

virtual ~CompositePluginProvider();

/**
* @note The ownership of the plugin providers is transferred to the callee.
*/
virtual void set_plugin_providers(const QList<PluginProvider*>& plugin_providers);

virtual QList<PluginDescriptor*> discover_descriptors(QObject* discovery_data);

virtual void* load(const QString& plugin_id, PluginContext* plugin_context);

virtual Plugin* load_plugin(const QString& plugin_id, PluginContext* plugin_context);

virtual void unload(void* plugin_instance);

virtual void shutdown();

private:

QList<PluginProvider*> plugin_providers_;

QMap<PluginProvider*, QSet<QString> > discovered_plugins_;

QMap<void*, PluginProvider*> running_plugins_;

};

} // namespace
// *INDENT-OFF* (prevent uncrustify from adding indention below)
#warning Including header <qt_gui_cpp/composite_plugin_provider.h> is deprecated, \
include <qt_gui_cpp/composite_plugin_provider.hpp> instead.
// *INDENT-ON*
#include "./composite_plugin_provider.hpp"

#endif // qt_gui_cpp__CompositePluginProvider_H
84 changes: 84 additions & 0 deletions qt_gui_cpp/include/qt_gui_cpp/composite_plugin_provider.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
* Copyright (c) 2011, Dirk Thomas, TU Darmstadt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of the TU Darmstadt nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef qt_gui_cpp__CompositePluginProvider_HPP
#define qt_gui_cpp__CompositePluginProvider_HPP

#include "plugin_descriptor.hpp"
#include "plugin_provider.hpp"

#include <QList>
#include <QMap>
#include <QSet>
#include <QString>

namespace qt_gui_cpp
{

class CompositePluginProvider
: public PluginProvider
{

public:

CompositePluginProvider(const QList<PluginProvider*>& plugin_providers = QList<PluginProvider*>());

virtual ~CompositePluginProvider();

/**
* @note The ownership of the plugin providers is transferred to the callee.
*/
virtual void set_plugin_providers(const QList<PluginProvider*>& plugin_providers);

virtual QList<PluginDescriptor*> discover_descriptors(QObject* discovery_data);

virtual void* load(const QString& plugin_id, PluginContext* plugin_context);

virtual Plugin* load_plugin(const QString& plugin_id, PluginContext* plugin_context);

virtual void unload(void* plugin_instance);

virtual void shutdown();

private:

QList<PluginProvider*> plugin_providers_;

QMap<PluginProvider*, QSet<QString> > discovered_plugins_;

QMap<void*, PluginProvider*> running_plugins_;

};

} // namespace

#endif // qt_gui_cpp__CompositePluginProvider_HPP
31 changes: 5 additions & 26 deletions qt_gui_cpp/include/qt_gui_cpp/generic_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,11 @@
#ifndef qt_gui_cpp__GenericProxy_H
#define qt_gui_cpp__GenericProxy_H

#include <QObject>
// *INDENT-OFF* (prevent uncrustify from adding indention below)
#warning Including header <qt_gui_cpp/generic_proxy.h> is deprecated, \
include <qt_gui_cpp/generic_proxy.hpp> instead.
// *INDENT-ON*

namespace qt_gui_cpp
{

class GenericProxy
{

public:

GenericProxy(QObject* obj = 0);

QObject* proxiedObject();

void setProxiedObject(QObject* obj);

bool invokeMethod(const char* member, QGenericArgument val0 = QGenericArgument(), QGenericArgument val1 = QGenericArgument(), QGenericArgument val2 = QGenericArgument(), QGenericArgument val3 = QGenericArgument(), QGenericArgument val4 = QGenericArgument(), QGenericArgument val5 = QGenericArgument(), QGenericArgument val6 = QGenericArgument(), QGenericArgument val7 = QGenericArgument(), QGenericArgument val8 = QGenericArgument(), QGenericArgument val9 = QGenericArgument());

bool invokeMethodWithReturn(const char* member, QGenericReturnArgument ret = QGenericReturnArgument(0, 0), QGenericArgument val0 = QGenericArgument(), QGenericArgument val1 = QGenericArgument(), QGenericArgument val2 = QGenericArgument(), QGenericArgument val3 = QGenericArgument(), QGenericArgument val4 = QGenericArgument(), QGenericArgument val5 = QGenericArgument(), QGenericArgument val6 = QGenericArgument(), QGenericArgument val7 = QGenericArgument(), QGenericArgument val8 = QGenericArgument(), QGenericArgument val9 = QGenericArgument());

private:

QObject* object_;

};

} // namespace
#include "./generic_proxy.hpp"

#endif // qt_gui_cpp__GenericProxy_H
64 changes: 64 additions & 0 deletions qt_gui_cpp/include/qt_gui_cpp/generic_proxy.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright (c) 2011, Dirk Thomas, TU Darmstadt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of the TU Darmstadt nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef qt_gui_cpp__GenericProxy_HPP
#define qt_gui_cpp__GenericProxy_HPP

#include <QObject>

namespace qt_gui_cpp
{

class GenericProxy
{

public:

GenericProxy(QObject* obj = 0);

QObject* proxiedObject();

void setProxiedObject(QObject* obj);

bool invokeMethod(const char* member, QGenericArgument val0 = QGenericArgument(), QGenericArgument val1 = QGenericArgument(), QGenericArgument val2 = QGenericArgument(), QGenericArgument val3 = QGenericArgument(), QGenericArgument val4 = QGenericArgument(), QGenericArgument val5 = QGenericArgument(), QGenericArgument val6 = QGenericArgument(), QGenericArgument val7 = QGenericArgument(), QGenericArgument val8 = QGenericArgument(), QGenericArgument val9 = QGenericArgument());

bool invokeMethodWithReturn(const char* member, QGenericReturnArgument ret = QGenericReturnArgument(0, 0), QGenericArgument val0 = QGenericArgument(), QGenericArgument val1 = QGenericArgument(), QGenericArgument val2 = QGenericArgument(), QGenericArgument val3 = QGenericArgument(), QGenericArgument val4 = QGenericArgument(), QGenericArgument val5 = QGenericArgument(), QGenericArgument val6 = QGenericArgument(), QGenericArgument val7 = QGenericArgument(), QGenericArgument val8 = QGenericArgument(), QGenericArgument val9 = QGenericArgument());

private:

QObject* object_;

};

} // namespace

#endif // qt_gui_cpp__GenericProxy_HPP
80 changes: 5 additions & 75 deletions qt_gui_cpp/include/qt_gui_cpp/plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,81 +33,11 @@
#ifndef qt_gui_cpp__Plugin_H
#define qt_gui_cpp__Plugin_H

#include "plugin_bridge.h"
#include "plugin_context.h"
#include "settings.h"
// *INDENT-OFF* (prevent uncrustify from adding indention below)
#warning Including header <qt_gui_cpp/plugin.h> is deprecated, \
include <qt_gui_cpp/plugin.hpp> instead.
// *INDENT-ON*

#include <QObject>

namespace qt_gui_cpp
{

/**
* The base class for C++ plugins.
*/
class Plugin
: public QObject
{

Q_OBJECT

public:

/**
* Construct the plugin.
* All initialization should be performed in initPlugin().
*/
Plugin()
: QObject()
{}

/**
* Instantiate the plugin.
* @param the plugin context
*/
virtual void initPlugin(PluginContext& /*context*/)
{}

/**
* Shutdown and clean up the plugin before unloading.
*/
virtual void shutdownPlugin()
{}

/**
* Save the intrinsic state of the plugin to the plugin-specific or instance-specific settings.
* @param the plugin-specific settings
* @param the instance-specific settings
*/
virtual void saveSettings(Settings& /*plugin_settings*/, Settings& /*instance_settings*/) const
{}

/**
* Restore the intrinsic state of the plugin from the plugin-specific or instance-specific settings.
* @param the plugin-specific settings
* @param the instance-specific settings
*/
virtual void restoreSettings(const Settings& /*plugin_settings*/, const Settings& /*instance_settings*/)
{}

/**
* Indicate if the plugin has configuration dialog which could be triggered by an icon in the title bar of the dock widgets.
* @return true if the plugin implements triggerConfiguration()
*/
virtual bool hasConfiguration() const
{
return false;
}

/**
* Trigger a configuration dialog.
* If this method is reimplemented hasConfiguration() should also be reimplemented and return true.
*/
virtual void triggerConfiguration()
{}

};

} // namespace
#include "./plugin.hpp"

#endif // qt_gui_cpp__Plugin_H
Loading

0 comments on commit 93dc7e3

Please sign in to comment.