|
Boost : |
From: Tim Blechmann (TimBlechmann_at_[hidden])
Date: 2006-04-29 07:06:54
hello boost devs,
using the plugin library from the boost-sandbox, i experience problems
in the following two cases:
- the base class of the plugin accepts parameters:
*** Creating an instance of plugin class
Could not load weapon: Boost.Plugin: Can't cast to the right factor type
- the base class of plugin is inherited from another class:
Could not load weapon: Boost.Plugin: Could not open shared library
'./library.so'
i've added both cases to the example sources and attached them, would be
awesome, if this could be made working ...
although i'm not really familiar with the plugin internals, i'd be
willing to test any code, the plugin developers send me...
thanks in advance ... tim
ps: please cc any response to me, since i'm a posting-only member.
pps: since sourceforge currently seems to have some problems with
synchronizing anonymous and developer's cvs, please also send me patches
-- TimBlechmann_at_[hidden] ICQ: 96771783 http://www.mokabar.tk Linux is like a wigwam: no windows, no gates, apache inside, stable.
#ifndef WEAPON_HPP
#define WEAPON_HPP
#include <string>
#include <boost/plugin/virtual_constructors.hpp>
class Foo
{
public:
virtual ~Foo();
};
class Weapon:
public Foo
{
public:
Weapon(int i)
{
dummy=i;
}
virtual void fire() = 0;
virtual ~Weapon() {}
int dummy;
};
namespace boost { namespace plugin {
template<>
struct virtual_constructors<Weapon>
{
typedef mpl::list<
mpl::list<std::string>,
mpl::list<std::string, int>,
mpl::list<std::string, int, int>
> type;
};
}}
#endif
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk