Re: Re: API / thread safe libdar

Christian Neumann <[email protected]> Thu, 17 Jun 2004 12:32:50 +0200
Newsgroups gmane.comp.sysutils.backup.dar.libdar
Message-ID <20040617123250.3b03e82b@minerva>
On Wed, 16 Jun 2004 21:50:31 +0200
Denis Corbin <[email protected]> wrote:

> I could keep the use of the op_create and other API functions as
> normal function (not class members). They received several new
> arguments, among which, the most important is the "dialog" class (as
> first argument). This object contains all the callback functions, as
> defined by the libdar user. Given this object libdar is able to use
> the appropriate callback function.
It would be nice to have the possibility to derive from this Dialog
class, so that one could overwrite the Dialog's write() members.
Example: (I don't know yet how you implemented it..)

class Dialog { // @ libdar
private:
void set_warning_callback(...);
protected:
virtual void write_warning(...);
}

The dialog's implementation of write_warning should call the callback
function defined by set_write_callback(...) or sth else. So the user
could create a Dialog, set the callback functions, and pass the Dialog
to op_create etc.

But he should also be able to do something like this:

class LogWindow : public Dialog { // @ backup gui
private:
void add_line_to_log(...);
void write_warning(...) { add_line_to_log(...) };
}

The overwritten write_warning(...) would write the warning directly to
the LogWindow, without calling any callback function. I think that
this would result in cleaner code (but as said, one could have both
possibilities).


> The native language support is also a feature for next major release 
> (version 2.2.0) ;-)
That's good :) If you need a german translator, tell me ;)

Regards,
Christian


-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND