Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #82652

plugin design problem

Newsgroups comp.lang.c++
Date 2021-12-16 03:24 -0800
Message-ID <66035e91-eaab-45ca-b952-08de4857ca7an@googlegroups.com> (permalink)
Subject plugin design problem
From alessio211734 <alessio211734@yahoo.it>

Show all headers | View raw


Hello,
i would like store a single plugin for every dll.
All plugin have a same interface.

For example suppose that every plugin (dll) have two C style function:
void mousePressed(int x, int y, OpenglContex * context)
void mouseMove(int x, int y, OpenglContex * context)

I would like remap c function extract from every dll on different class Plugin1 and Plugin2

class Plugin
{
public:
	Plugin() {};
	virtual void mousePressEvent(GLWidget* widget, QMouseEvent *event)=0;
	virtual void mouseMoveEvent(GLWidget* widget, QMouseEvent *event)=0;
....
};

and other subclass as

class Plugin1: public Plugin
{
// remap on dll 1
}

class Plugin2: public Plugin
{
// remap on dll2
}

Any idea how to solve my problem?
It's possibile declare function pointer in the Plugin1 or Plugin2 class and 
call them from method?

Back to comp.lang.c++ | Previous | NextNext in thread | Find similar | Unroll thread


Thread

plugin design problem alessio211734 <alessio211734@yahoo.it> - 2021-12-16 03:24 -0800
  Re: plugin design problem Paavo Helde <eesnimi@osa.pri.ee> - 2021-12-16 14:22 +0200

csiph-web