Skip to content

Commit

Permalink
added documentation and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
aerydna authored and aruzzenenti committed Jan 7, 2019
1 parent 2097ba2 commit 392c864
Show file tree
Hide file tree
Showing 16 changed files with 109 additions and 57 deletions.
1 change: 1 addition & 0 deletions cmake/template/yarp_plugin_RFModule.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* This software may be modified and distributed under the terms of the
* BSD-3-Clause license. See the accompanying LICENSE file for details.
*/

#include <yarp/conf/api.h>
#include <yarp/os/RFModuleFactory.h>
#include <yarp/os/SharedLibraryClass.h>
Expand Down
11 changes: 5 additions & 6 deletions example/RFModulePlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
################################################################################
# #
# Copyright (C) 2017 Fondazione Istituto Italiano di Tecnologia (IIT) #
# All Rights Reserved. #
# #
################################################################################
# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
# All rights reserved.
#
# This software may be modified and distributed under the terms of the
# BSD-3-Clause license. See the accompanying LICENSE file for details.

cmake_minimum_required(VERSION 3.5)
project(myModules)
Expand Down
8 changes: 7 additions & 1 deletion example/RFModulePlugin/moduleLoader/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
# All rights reserved.
#
# This software may be modified and distributed under the terms of the
# BSD-3-Clause license. See the accompanying LICENSE file for details.

set(SRC main.cpp)
add_executable(moduleLoader ${SRC})
target_link_libraries(moduleLoader YARP::YARP_OS
YARP::YARP_init)
YARP::YARP_init)
10 changes: 9 additions & 1 deletion example/RFModulePlugin/moduleLoader/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
* Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
* All rights reserved.
*
* This software may be modified and distributed under the terms of the
* BSD-3-Clause license. See the accompanying LICENSE file for details.
*/

#include <yarp/os/RFPlugin.h>
#include <yarp/os/Time.h>
#include <memory>
Expand Down Expand Up @@ -28,4 +36,4 @@ int main()
}

return 0;
}
}
14 changes: 6 additions & 8 deletions example/RFModulePlugin/testmoduleBar/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
################################################################################
# #
# Copyright (C) 2018 Fondazione Istituto Italiano di Tecnologia (IIT) #
# All Rights Reserved. #
# #
################################################################################
# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
# All rights reserved.
#
# This software may be modified and distributed under the terms of the
# BSD-3-Clause license. See the accompanying LICENSE file for details.

include_directories(${CMAKE_CURRENT_SOURCE_DIR})

set(SRC module.cpp)
set(HDRS module.h)

yarp_prepare_plugin(myModuleBar
Expand All @@ -16,7 +14,7 @@ yarp_prepare_plugin(myModuleBar
INCLUDE module.h)

if(ENABLE_myModules_myModuleBar)
yarp_add_plugin(module_Bar ${SRC} ${HDRS})
yarp_add_plugin(module_Bar ${HDRS})
target_link_libraries(module_Bar YARP::YARP_OS)
endif()

Expand Down
8 changes: 8 additions & 0 deletions example/RFModulePlugin/testmoduleBar/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
* Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
* All rights reserved.
*
* This software may be modified and distributed under the terms of the
* BSD-3-Clause license. See the accompanying LICENSE file for details.
*/

#include <module.h>
#include <yarp/os/Network.h>
int main(int argc, char** argv)
Expand Down
Empty file.
13 changes: 7 additions & 6 deletions example/RFModulePlugin/testmoduleBar/module.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/******************************************************************************
* *
* Copyright (C) 2018 Fondazione Istituto Italiano di Tecnologia (IIT) *
* All Rights Reserved. *
* *
******************************************************************************/
/*
* Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
* All rights reserved.
*
* This software may be modified and distributed under the terms of the
* BSD-3-Clause license. See the accompanying LICENSE file for details.
*/


#include <yarp/os/RFModule.h>
Expand Down
14 changes: 6 additions & 8 deletions example/RFModulePlugin/testmoduleFoo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
################################################################################
# #
# Copyright (C) 2018 Fondazione Istituto Italiano di Tecnologia (IIT) #
# All Rights Reserved. #
# #
################################################################################
# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
# All rights reserved.
#
# This software may be modified and distributed under the terms of the
# BSD-3-Clause license. See the accompanying LICENSE file for details.

include_directories(${CMAKE_CURRENT_SOURCE_DIR})

set(SRC module.cpp)
set(HDRS module.h)

yarp_prepare_plugin(myModuleFoo
Expand All @@ -16,7 +14,7 @@ yarp_prepare_plugin(myModuleFoo
INCLUDE module.h)

if(ENABLE_myModules_myModuleFoo)
yarp_add_plugin(module_Foo ${SRC} ${HDRS})
yarp_add_plugin(module_Foo ${HDRS})
target_link_libraries(module_Foo YARP::YARP_OS)
endif()

Expand Down
8 changes: 8 additions & 0 deletions example/RFModulePlugin/testmoduleFoo/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
* Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
* All rights reserved.
*
* This software may be modified and distributed under the terms of the
* BSD-3-Clause license. See the accompanying LICENSE file for details.
*/

#include <module.h>
#include <yarp/os/Network.h>
int main(int argc, char** argv)
Expand Down
Empty file.
14 changes: 7 additions & 7 deletions example/RFModulePlugin/testmoduleFoo/module.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/******************************************************************************
* *
* Copyright (C) 2018 Fondazione Istituto Italiano di Tecnologia (IIT) *
* All Rights Reserved. *
* *
******************************************************************************/

/*
* Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
* All rights reserved.
*
* This software may be modified and distributed under the terms of the
* BSD-3-Clause license. See the accompanying LICENSE file for details.
*/

#include <yarp/os/RFModule.h>
#include <yarp/os/Time.h>
Expand Down
28 changes: 25 additions & 3 deletions src/libYARP_OS/include/yarp/os/RFPlugin.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
* Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
* All rights reserved.
*
* This software may be modified and distributed under the terms of the
* BSD-3-Clause license. See the accompanying LICENSE file for details.
*/

#include <yarp/os/api.h>
#include <string>
Expand All @@ -17,17 +24,32 @@ class YARP_OS_API RFPlugin
RFPlugin();

virtual ~RFPlugin();


/**
* opens the plugin
* @param command a string containing the equivalent command line
* @return true if opened succesfully
*/
virtual bool open(const std::string& command);

/**
* closes the plugin
*/
virtual void close();

/**
* check if the plugin is running
*/
virtual bool isRunning();

/**
* get the command line used to open the plugin
*/
virtual std::string getCmd();

virtual std::string getAlias();

/**
* get the thread id
*/
virtual int getThreadKey();
};

Expand Down
13 changes: 7 additions & 6 deletions src/libYARP_OS/include/yarp/os/impl/RFModuleFactory.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/*
* Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
* All rights reserved.
*
* This software may be modified and distributed under the terms of the
* BSD-3-Clause license. See the accompanying LICENSE file for details.
*/
* Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
* All rights reserved.
*
* This software may be modified and distributed under the terms of the
* BSD-3-Clause license. See the accompanying LICENSE file for details.
*/

#ifndef YARP_OS_RFPLUGINFACTORY_H
#define YARP_OS_RFPLUGINFACTORY_H

Expand Down
12 changes: 6 additions & 6 deletions src/libYARP_OS/src/RFModuleFactory.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
* All rights reserved.
*
* This software may be modified and distributed under the terms of the
* BSD-3-Clause license. See the accompanying LICENSE file for details.
*/
* Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
* All rights reserved.
*
* This software may be modified and distributed under the terms of the
* BSD-3-Clause license. See the accompanying LICENSE file for details.
*/

#include <yarp/os/YarpPluginSettings.h>

Expand Down
12 changes: 7 additions & 5 deletions src/libYARP_OS/src/RFPlugin.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
* Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
* All rights reserved.
*
* This software may be modified and distributed under the terms of the
* BSD-3-Clause license. See the accompanying LICENSE file for details.
*/

#include <yarp/os/RFPlugin.h>
#include <yarp/os/YarpPluginSelector.h>
Expand Down Expand Up @@ -55,11 +62,6 @@ string RFPlugin::getCmd()
return impl->command;
}

string RFPlugin::getAlias()
{
return impl->alias;
}

int RFPlugin::getThreadKey()
{
return impl->module->getThreadKey();
Expand Down

0 comments on commit 392c864

Please sign in to comment.