<html>
<head>
</head>
<body>
This demo shows how you can use operator new and shows how it is returned
as the address of the array.<br>
<br>
Peter Mueller wrote:<br>
<blockquote type="cite" cite="mid:20020323142854.790615fa.peter.o.mueller@gmx.de">
<pre wrap="">Hi Angelo,<br><br>can you send me an example?<br><br>Thanks,<br>Peter<br><br>On Sat, 23 Mar 2002 12:25:41 +1100<br>Angelo Fraietta <a class="moz-txt-link-rfc2396E" href="mailto:angelo_f@bigpond.com"><angelo_f@bigpond.com></a> wrote:<br><br></pre>
<blockquote type="cite">
<pre wrap="">You can allocate the memory for a class however and wherever you want to <br>by overloading operators new and delete (you don't even have to allocate <br>memory, you just return a ponter to it). If you have members of a class <br>that need to be allocated as ROM, that is not a problem so long as you <br>make these const. You could still have non default constructors in these <br>ROM allocated classes so long as you do not try to change any members of <br>the class (as they must be const also and so you cannot pre-set them <br>even in a default constructor as your memory is read only). So what <br>your class effectively becomes is a class interface to the ROM. As long <br>as all the classes members are const, there is no problem that I am <br>aware of.<br><br>Peter Mueller wrote:<br><br></pre>
<blockquote type="cite">
<pre wrap="">Hi all,<br><br>we want to use C++ for our future systems. But it seems that there are several design aspects that should be taken into account to develop efficient C++ code especially in terms of RAM usage. E.g. to be able to put an object into rom the class can not have<br>- others than the default ctor<br>- only public methods etc<br>- ...<br><br>I found some links in the net but not much. Can you recommend papers etc. about this topic and C++ in embedded systems in general?<br><br>Thanks a lot,<br>Peter<br><br></pre>
</blockquote>
<pre wrap="">-- <br>Angelo Fraietta<br><br>PO Box 859<br>Hamilton NSW 2303<br><br>Home Page<br><br><br><a class="moz-txt-link-freetext" href="http://www.users.bigpond.com/angelo_f/">http://www.users.bigpond.com/angelo_f/</a><br><br>There are those who seek knowledge for the sake of knowledge - that is CURIOSITY<br>There are those who seek knowledge to be known by others - that is VANITY<br>There are those who seek knowledge in order to serve - that is LOVE<br> Bernard of Clairvaux (1090 - 1153)<br><br><br><br><br></pre>
</blockquote>
<pre wrap=""><!----><br><br></pre>
</blockquote>
<br>
<pre class="moz-signature" cols="$mailwrapcol">--
Angelo Fraietta
PO Box 859
Hamilton NSW 2303
Home Page
<a class="moz-txt-link-freetext" href="http://www.users.bigpond.com/angelo_f/">http://www.users.bigpond.com/angelo_f/</a>
There are those who seek knowledge for the sake of knowledge - that is CURIOSITY
There are those who seek knowledge to be known by others - that is VANITY
There are those who seek knowledge in order to serve - that is LOVE
Bernard of Clairvaux (1090 - 1153)</pre>
<br>
</body>
</html>