Hello Stefan,
Did you receive an answer to your request?
I really need more information before making a proper recommendation such
as the hardware platform you are designing the system (e.g., TI DSP, ARM
DSP, Hitatchi Controller, etc.), and even then I may not be able to help.
:)
Nonetheless, I have found it very difficult to adhere to strict OO
conventions when designing embedded real-time systems. As far as
persisting objects, I have had to take an approach like this:
1. Create a memory map section that holds pointers to functions. This
section should have a specific base address in flash and labels for each
entry.
2. Create a structure of function pointers that overlays this memory
section. As part of the structure, create an entry for every function that
you objects may point to. As new functions are added to the list, add them
to the end of the structure so that existing function pointers are not
offset from their original locations.
3. In your class declaration for objects that require storing, replace
friend definitions with references to the appropriate entry of this new
structure. Use this reference to call the necessary functions from your
class.
Now, when the program code changes in flash, this structure must be updated
as well to reflect the "new" position of the functions. However, the base
address of this structure will not change since it is the only
structure/code mapped directly to a this memory section, you can always
reference the appropriate function through this structure. Think of it as
a translation table.
This approach requires that you use precompiler directives in your code (I
am assuming you are using C++) to place the structure in the appropriate
section. How you do this depends on the compiler you are using.
Thanks.
Matt Burton
e-ALP Project Architect
[EMAIL PROTECTED]
"Mueller,
Stefan-Horst" To: [EMAIL PROTECTED]
<Stefan-Horst.Muell cc:
[EMAIL PROTECTED]> Subject: (ROSE) Saving objects
Sent by:
owner-rose_forum@ra
tional.com
01/28/2003 02:36 AM
Please respond to
"Mueller,
Stefan-Horst"
Hi all,
I am writing a firmware for an embedded system and I'm developing an
OO-Design in Rational Rose.
I have dufficulties with the special features that we have a buffered ram
and a flash we can "save" data in. So far our parameters were placed in the
buffered ram so that they where still valid after system restart. The data
could be copied into the flash so that the settings were still available
after a longer Time. The settings were checked with an simple checksum.
Even
if the firmware had changed by download (different memory mapping etc.) the
settings could be restored, at least from the flash, maybe even from the
ram.
My problem is now: how do I save objects for they do not only contain
attributes but also the functionpointers at least for the virtual
(polymorhistic) methods.
It would be easy to place the objects in the non-init ram and compute a
checksum but what about the function pointers. They need to be initialized.
Maybe the program has changed and the functions are mapped differently.
What
would be am propper OO-Solution in your opinion? Maybe I should mention
that
there are many objects to be saved and therefore not to much dataconvertion
should take place.
Kind regards,
Stefan M�ller
Entwicklungsabteilung T-V
Tel: 06151-803 650
Fax: 06151-803 524
Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
* Only plain-text messages are supported.
* HTML or Rich-Text messages may be rejected.
*
* Post or Reply to: [EMAIL PROTECTED]
* Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
* http://www.rational.com/support/usergroups/rose/rose_forum.jsp
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
* To: [EMAIL PROTECTED]
* Subject: <BLANK>
* Body: unsubscribe rose_forum
*************************************************************************
************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
* Only plain-text messages are supported.
* HTML or Rich-Text messages may be rejected.
*
* Post or Reply to: [EMAIL PROTECTED]
* Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
* http://www.rational.com/support/usergroups/rose/rose_forum.jsp
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
* To: [EMAIL PROTECTED]
* Subject: <BLANK>
* Body: unsubscribe rose_forum
*************************************************************************