Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Multi platform plug-in development made easy!

, 7 Mar 2006
How to use and develop plug-ins for multiple platforms.
multi_platform_plugin_spl_demo.zip
obj
builds
dotnet2003
libspl.suo
linux
inst-sh
INSTALL
makefile
vc6
libspl.dsp
libspl.dsw
code
include
source
documents
bin
release
DocuSPL.chm
html
classSPL_1_1slaPluginServer.png
classSPL_1_1slaPluginServer__coll__graph.map
classSPL_1_1slaPluginServer__coll__graph.md5
classSPL_1_1slaPluginServer__coll__graph.png
classSPL_1_1slaPluginServer__inherit__graph.map
classSPL_1_1slaPluginServer__inherit__graph.md5
classSPL_1_1slaPluginServer__inherit__graph.png
classSPL_1_1slcMutex__inherit__graph.map
classSPL_1_1slcMutex__inherit__graph.md5
classSPL_1_1slcMutex__inherit__graph.png
classSPL_1_1slcPluginArgs.png
classSPL_1_1slcPluginArgs__coll__graph.map
classSPL_1_1slcPluginArgs__coll__graph.md5
classSPL_1_1slcPluginArgs__coll__graph.png
classSPL_1_1slcPluginArgs__inherit__graph.map
classSPL_1_1slcPluginArgs__inherit__graph.md5
classSPL_1_1slcPluginArgs__inherit__graph.png
classSPL_1_1slcPluginInfo.png
classSPL_1_1slcPluginInfo__coll__graph.map
classSPL_1_1slcPluginInfo__coll__graph.md5
classSPL_1_1slcPluginInfo__coll__graph.png
classSPL_1_1slcPluginInfo__inherit__graph.map
classSPL_1_1slcPluginInfo__inherit__graph.md5
classSPL_1_1slcPluginInfo__inherit__graph.png
classSPL_1_1slcPluginServer.png
classSPL_1_1slcPluginServer_a10_cgraph.map
classSPL_1_1slcPluginServer_a10_cgraph.md5
classSPL_1_1slcPluginServer_a10_cgraph.png
classSPL_1_1slcPluginServer_a1_cgraph.map
classSPL_1_1slcPluginServer_a1_cgraph.md5
classSPL_1_1slcPluginServer_a1_cgraph.png
classSPL_1_1slcPluginServer_a7_cgraph.map
classSPL_1_1slcPluginServer_a7_cgraph.md5
classSPL_1_1slcPluginServer_a7_cgraph.png
classSPL_1_1slcPluginServer_a9_cgraph.map
classSPL_1_1slcPluginServer_a9_cgraph.md5
classSPL_1_1slcPluginServer_a9_cgraph.png
classSPL_1_1slcPluginServer__coll__graph.map
classSPL_1_1slcPluginServer__coll__graph.md5
classSPL_1_1slcPluginServer__coll__graph.png
classSPL_1_1slcPluginServer__inherit__graph.map
classSPL_1_1slcPluginServer__inherit__graph.md5
classSPL_1_1slcPluginServer__inherit__graph.png
classSPL_1_1slcThread.png
classSPL_1_1slcThreadLock_a0_cgraph.map
classSPL_1_1slcThreadLock_a0_cgraph.md5
classSPL_1_1slcThreadLock_a0_cgraph.png
classSPL_1_1slcThreadLock_a1_cgraph.map
classSPL_1_1slcThreadLock_a1_cgraph.md5
classSPL_1_1slcThreadLock_a1_cgraph.png
classSPL_1_1slcThreadLock_a2_cgraph.map
classSPL_1_1slcThreadLock_a2_cgraph.md5
classSPL_1_1slcThreadLock_a2_cgraph.png
classSPL_1_1slcThreadLock_a3_cgraph.map
classSPL_1_1slcThreadLock_a3_cgraph.md5
classSPL_1_1slcThreadLock_a3_cgraph.png
classSPL_1_1slcThreadLock_a4_cgraph.map
classSPL_1_1slcThreadLock_a4_cgraph.md5
classSPL_1_1slcThreadLock_a4_cgraph.png
classSPL_1_1slcThreadLock__coll__graph.map
classSPL_1_1slcThreadLock__coll__graph.md5
classSPL_1_1slcThreadLock__coll__graph.png
classSPL_1_1slcThread__inherit__graph.map
classSPL_1_1slcThread__inherit__graph.md5
classSPL_1_1slcThread__inherit__graph.png
doxygen.png
graph_legend.dot
graph_legend.png
index.hhc
index.hhk
index.hhp
inherit__graph__0.map
inherit__graph__0.md5
inherit__graph__0.png
inherit__graph__1.map
inherit__graph__1.md5
inherit__graph__1.png
spl_8h__incl.map
spl_8h__incl.md5
spl_8h__incl.png
spl__mutex_8cpp__incl.map
spl__mutex_8cpp__incl.md5
spl__mutex_8cpp__incl.png
spl__mutex_8h__dep__incl.map
spl__mutex_8h__dep__incl.md5
spl__mutex_8h__dep__incl.png
spl__mutex_8h__incl.map
spl__mutex_8h__incl.md5
spl__mutex_8h__incl.png
spl__platform_8h__dep__incl.map
spl__platform_8h__dep__incl.md5
spl__platform_8h__dep__incl.png
spl__pluginargs_8cpp__incl.map
spl__pluginargs_8cpp__incl.md5
spl__pluginargs_8cpp__incl.png
spl__pluginargs_8h__dep__incl.map
spl__pluginargs_8h__dep__incl.md5
spl__pluginargs_8h__dep__incl.png
spl__pluginargs_8h__incl.map
spl__pluginargs_8h__incl.md5
spl__pluginargs_8h__incl.png
spl__plugininfo_8cpp__incl.map
spl__plugininfo_8cpp__incl.md5
spl__plugininfo_8cpp__incl.png
spl__plugininfo_8h__dep__incl.map
spl__plugininfo_8h__dep__incl.md5
spl__plugininfo_8h__dep__incl.png
spl__plugininfo_8h__incl.map
spl__plugininfo_8h__incl.md5
spl__plugininfo_8h__incl.png
spl__pluginserver_8cpp__incl.map
spl__pluginserver_8cpp__incl.md5
spl__pluginserver_8cpp__incl.png
spl__pluginserver_8h__dep__incl.map
spl__pluginserver_8h__dep__incl.md5
spl__pluginserver_8h__dep__incl.png
spl__pluginserver_8h__incl.map
spl__pluginserver_8h__incl.md5
spl__pluginserver_8h__incl.png
spl__pluginserver__linux_8cpp__incl.map
spl__pluginserver__linux_8cpp__incl.md5
spl__pluginserver__linux_8cpp__incl.png
spl__pluginserver__linux_8h__dep__incl.map
spl__pluginserver__linux_8h__dep__incl.md5
spl__pluginserver__linux_8h__dep__incl.png
spl__pluginserver__linux_8h__incl.map
spl__pluginserver__linux_8h__incl.md5
spl__pluginserver__linux_8h__incl.png
spl__pluginserver__win32_8cpp__incl.map
spl__pluginserver__win32_8cpp__incl.md5
spl__pluginserver__win32_8cpp__incl.png
spl__pluginserver__win32_8h__dep__incl.map
spl__pluginserver__win32_8h__dep__incl.md5
spl__pluginserver__win32_8h__dep__incl.png
spl__pluginserver__win32_8h__incl.map
spl__pluginserver__win32_8h__incl.md5
spl__pluginserver__win32_8h__incl.png
spl__threadlock_8cpp__incl.map
spl__threadlock_8cpp__incl.md5
spl__threadlock_8cpp__incl.png
spl__threadlock_8h__dep__incl.map
spl__threadlock_8h__dep__incl.md5
spl__threadlock_8h__dep__incl.png
spl__threadlock_8h__incl.map
spl__threadlock_8h__incl.md5
spl__threadlock_8h__incl.png
spl__thread_8cpp__incl.map
spl__thread_8cpp__incl.md5
spl__thread_8cpp__incl.png
spl__thread_8h__dep__incl.map
spl__thread_8h__dep__incl.md5
spl__thread_8h__dep__incl.png
spl__typedefs_8h__dep__incl.map
spl__typedefs_8h__dep__incl.md5
spl__typedefs_8h__dep__incl.png
spl__typedefs_8h__incl.map
spl__typedefs_8h__incl.md5
spl__typedefs_8h__incl.png
spl.dox
examples
bin
ConsoleTest.exe
MfcPluginDllTest.exe
MFCPluginTest.exe
MfcThreadPluginTest.exe
spl.dll
builds
ConsoleTest
makefile
MfcPluginDllTest
res
MfcPluginDllTest.ico
MfcPluginTest
res
mfcplugintest.ico
MfcThreadPluginTest
res
MfcThreadPluginTest.ico
plArgInfos
makefile
plHelloWorld
makefile
plHelloWorldNoMacros
makefile
plReverse
makefile
plReverseSlow
makefile
plToLower
makefile
plToUpper
makefile
obj
plugins
plArgInfos.dll
plHelloWorld.dll
plHelloWorldNoMacros.dll
plReverse.dll
plReverseSlow.dll
plToLower.dll
plToUpper.dll
lib
dll
spl.dll
spl.lib
spld.dll
spld.lib
libspl.lib
libspld.lib
/*!

\section terms_of_use Terms of Use

libspl - the simple plugin layer library.
Copyright (C) 2004 Andreas Loeffler and Ren� Stuhr (www.unitedbytes.de).

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

\section author Author
Ren� Stuhr (www.unitedbytes.de)

*/

//---------------------------------------------------------------------------------------------------------------------------
/// @file		spl_pluginargs.h
/// @version	1.0
/// @brief		The plugin argument class.
/// @author		Ren� Stuhr
//---------------------------------------------------------------------------------------------------------------------------

#ifndef		__SPL_PLUGINARGS_H__
#define		__SPL_PLUGINARGS_H__

#ifndef		__SPL_TYPEDEFS_H__
#include	"spl_typedefs.h"
#endif

#ifndef		__SPL_MUTEX_H__
#include	"spl_mutex.h"
#endif

#ifndef		_MAP_
#include	<map>
#endif

#ifndef		_STRING_
#include	<string>
#endif

#if SPL_PLATFORM == SPL_PLATFORM_WIN32
	#if		defined ( SPL_MAKE_DLL )
		#define SPL_API		__declspec( dllexport )
	#elif	defined ( SPL_USE_DLL )
		#define SPL_API		__declspec( dllimport )
	#else 
		#define SPL_API	
	#endif
#else
	#define SPL_API 
#endif


using namespace std;

namespace SPL {

//---------------------------------------------------------------------------------------------------------------------------
///	@brief		The plugin argument class.
///	@ingroup	SPL
//---------------------------------------------------------------------------------------------------------------------------
class slcPluginArgs : public slcMutex
{
	//
	//-----------------------------------------------------------------------------------------------------------------------
	//***********************************************     CON/DESTRUCTION     ***********************************************
	//-----------------------------------------------------------------------------------------------------------------------
	//
public:

	//-----------------------------------------------------------------------------------------------------------------------
	///	@brief		Default constructor.
	//-----------------------------------------------------------------------------------------------------------------------
	SPL_API slcPluginArgs( void );

	//-----------------------------------------------------------------------------------------------------------------------
	///	@brief		Copy constructor.
	//-----------------------------------------------------------------------------------------------------------------------
	SPL_API slcPluginArgs( const slcPluginArgs& a_pluginArgs );

	//-----------------------------------------------------------------------------------------------------------------------
	///	@brief		Default destructor.
	//-----------------------------------------------------------------------------------------------------------------------
	virtual SPL_API ~slcPluginArgs( void );

	//
	//-----------------------------------------------------------------------------------------------------------------------
	//************************************************     MODIFICATION     *************************************************
	//-----------------------------------------------------------------------------------------------------------------------
	//
public:

	//-----------------------------------------------------------------------------------------------------------------------
	///	@brief		Sets an argument at the specified index (0-based).
	///	@param		a_lIndex	[in] Index where to fill the argument in.
	///	@param		a_pvArg		[in] Pointer to an argument.
	///	@return		The argument's index (should not differ from a_lIndex!).
	//-----------------------------------------------------------------------------------------------------------------------
	long SPL_API SetArg( long a_lIndex, void* a_pvArg );

	//-----------------------------------------------------------------------------------------------------------------------
	///	@brief		Sets an argument at the next free position.
	///	@param		a_pvArg		[in] Pointer to an argument.
	///	@return		The argument's index.
	//-----------------------------------------------------------------------------------------------------------------------
	long SPL_API SetArg( void* a_pvArg );

	//-----------------------------------------------------------------------------------------------------------------------
	///	@brief		Returns the number of arguments.
	///	@return		Number of arguments.
	//-----------------------------------------------------------------------------------------------------------------------
	long SPL_API GetCount( void );// const;

	//-----------------------------------------------------------------------------------------------------------------------
	///	@brief		Gets the argument at the specified index.
	///	@param		a_lIndex	[in] Index of argument to get.
	///	@param		a_pvArg		[out] Pointer to a valid, allocated memory block holding the argument.
	///	@return		The argument's index (should not differ from a_lIndex!).
	//-----------------------------------------------------------------------------------------------------------------------
	long SPL_API GetArg( long a_lIndex, void* a_pvArg );

	//-----------------------------------------------------------------------------------------------------------------------
	///	@brief		Returns the number of deleted arguments.
	///	@return		Number of arguments.
	//-----------------------------------------------------------------------------------------------------------------------
	long SPL_API Clear( void );

	//
	//-----------------------------------------------------------------------------------------------------------------------
	//*************************************************     ATTRIBUTES     **************************************************
	//-----------------------------------------------------------------------------------------------------------------------
	//
private:
	
	map< long, SPL_BITTYPE >	m_mapArgs;		///< Map for arguments.
};

} // End of namespace SPL

#endif	// End __SPL_PLUGINARGS_H__

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Andreas Loeffler
Web Developer
Germany Germany
I was born in 1982 near Stuttgart / Germany and began my first steps in programming computers at the age of only nine years on an old Commodore CBM 7072. In 2002 I finished my education as IT specialist for software engineering and did my civillian service afterwards. Currently I'm working as leader of the software division in a bigger company located in south west Germany, mainly on software development and research projects for multimedia terminals and user recognition/verification systems.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.141216.1 | Last Updated 7 Mar 2006
Article Copyright 2004 by Andreas Loeffler
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid