G
Guy Dreger
Hi, I have read a lot of solutions to this problem but I can't help but
think I'm missing a better answer.
I have a class called UI. That handles all the User Interface stuff for
some dedicated hardware (forklifts and such). The UI class is used in
lots of different applications that do different things. I would like
to offer in the UI a way of handling the validation of in coming
characters. This is down quite low down in the code and in C I would
simply create a pointer function and a function to set the pointer
function so the low level code knows to use it. This of course all
still works with a straight C main line but when the UI class is used
inside a different class I loss the ability to set the call back
function to a function member.
Complicating matters is that many apps are highly multi-threaded. i.e.
handling many forklifts/users and what they are doing all at once so
static members are not much of a help.
Also;
[soap-box mode on]
Why is this such a problem for the compiler manufactures? I normally
get the response that they need the instance information. Of course.
This is a Duh.... But They have it. They have the class deceleration,
the function (and therefore the function offset from the class
instance), The this pointer. As I see it everything is available to
them. I'd be willing to conceded they may want different syntax in
order to make member functions and standard c functions easier to
distinguish and handle. So the question here is.... Whats up with that ah?
[soap-box mode off]
think I'm missing a better answer.
I have a class called UI. That handles all the User Interface stuff for
some dedicated hardware (forklifts and such). The UI class is used in
lots of different applications that do different things. I would like
to offer in the UI a way of handling the validation of in coming
characters. This is down quite low down in the code and in C I would
simply create a pointer function and a function to set the pointer
function so the low level code knows to use it. This of course all
still works with a straight C main line but when the UI class is used
inside a different class I loss the ability to set the call back
function to a function member.
Complicating matters is that many apps are highly multi-threaded. i.e.
handling many forklifts/users and what they are doing all at once so
static members are not much of a help.
Also;
[soap-box mode on]
Why is this such a problem for the compiler manufactures? I normally
get the response that they need the instance information. Of course.
This is a Duh.... But They have it. They have the class deceleration,
the function (and therefore the function offset from the class
instance), The this pointer. As I see it everything is available to
them. I'd be willing to conceded they may want different syntax in
order to make member functions and standard c functions easier to
distinguish and handle. So the question here is.... Whats up with that ah?
[soap-box mode off]