?
=?iso-8859-1?q?Ernesto_Basc=F3n?=
Hi everybody:
I am writing a C++ application that will handle several "applets"
inside of it.
Let's say an "applet" is a full independent module that will run in its
own thread inside the same underlying process. I like the idea of
"applets" because they decrease a lot the need of context switching and
the interoperability between "applets" is great.
Anyway, there are a lot of problems in this model:
* How processing exceptions or crashes inside the "applets"?
* How freeing resources (memory, opened files, etc.) if an "applet" has
crashed?
* How avoiding the danger of corrupt another "applets" if they are
running in the same address space?
* How provide easy interoperability between objects (as simple function
calls) without decreasing the security of other applets, maybe
critical?
Is there a way to overload some operators or overload some methods to
check the validity of the pointers being accessed through code? I want
this validation to be seamless for the end developer.
By example:
MyObject* obj = (MyObject*) 1434348392; //maybe wrong
obj->setName("12");
In that case, how can I overload the "->" to validate if the pointer is
going to access to some valid position?
Overloading the MyObject.operator-> just works when I declare:
MyObject obj;
and I want to work with pointers.
Please help me on this topic and give me some tips about my idea on
"applets".
Thanks in advance,
Ernesto
PDTA: Maybe using smart pointers?
I am writing a C++ application that will handle several "applets"
inside of it.
Let's say an "applet" is a full independent module that will run in its
own thread inside the same underlying process. I like the idea of
"applets" because they decrease a lot the need of context switching and
the interoperability between "applets" is great.
Anyway, there are a lot of problems in this model:
* How processing exceptions or crashes inside the "applets"?
* How freeing resources (memory, opened files, etc.) if an "applet" has
crashed?
* How avoiding the danger of corrupt another "applets" if they are
running in the same address space?
* How provide easy interoperability between objects (as simple function
calls) without decreasing the security of other applets, maybe
critical?
Is there a way to overload some operators or overload some methods to
check the validity of the pointers being accessed through code? I want
this validation to be seamless for the end developer.
By example:
MyObject* obj = (MyObject*) 1434348392; //maybe wrong
obj->setName("12");
In that case, how can I overload the "->" to validate if the pointer is
going to access to some valid position?
Overloading the MyObject.operator-> just works when I declare:
MyObject obj;
and I want to work with pointers.
Please help me on this topic and give me some tips about my idea on
"applets".
Thanks in advance,
Ernesto
PDTA: Maybe using smart pointers?