<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I just tried this, resulting in our friendly ag++ claiming:<br>
<br>
warning: cannot introduce non-inline function or static attribute into
"class Device". It has to contain link-once code.<br>
<br>
which I don't understand.<br>
<br>
Francisco Afonso wrote:
<blockquote cite="mid:BAY137-W2232B119AA04B1FA2FEC26D0FC0@phx.gbl"
type="cite">
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
<pre>And if you use named slices?
//------------------------------
slice class mySlice{
public:
static unsigned int counter;
};
slice unsigned int mySlice::counter = 0;
aspect Counter{
advice "Device": slice mySlice;
};</pre>
//--------------------------------------------------<br>
<br>
Regards,<br>
<br>
Francisco Afonso<br>
<br>
<br>
> Date: Tue, 25 Mar 2008 10:36:50 +0100<br>
> From: <a class="moz-txt-link-abbreviated" href="mailto:arnd-hendrik.mathias@nefkom.net">arnd-hendrik.mathias@nefkom.net</a><br>
> To: <a class="moz-txt-link-abbreviated" href="mailto:aspectc-user@aspectc.org">aspectc-user@aspectc.org</a><br>
> Subject: [aspectc-user] non-inline introduction<br>
> <br>
> Hi,<br>
> I'm tryin' to introduce a new static member to a class including
the <br>
> corresponding non-inline introduction. The code I'm using looks
like <br>
> this:<br>
> <br>
> /** \code */<br>
> <br>
> class Device<br>
> {<br>
> unsigned char devspeed;<br>
> unsigned char devclass;<br>
> unsigned char devsubclass;<br>
> unsigned char devprotocol;<br>
> };<br>
> <br>
> aspect Counter<br>
> {<br>
> advice "Device" : slice class<br>
> {<br>
> public : static unsigned int counter;<br>
> };<br>
> };<br>
> <br>
> slice unsigned int Device::counter = 0;<br>
> <br>
> /** \endcode */<br>
> <br>
> Which looks pretty much like the example given in section 5 of the
<br>
> ac-language-reference page 27. Nevertheless ag++ reports an
"error: <br>
> invalid introduction" to me.<br>
> I also tried to put the non-inline introduction into the aspect.
Which <br>
> only makes things different but not better. Can anyone give me
some <br>
> good advice (or at least some better slice than mine ;-)<br>
> Best regards<br>
> <br>
> Arnd-Hendrik<br>
> <br>
> <br>
> _______________________________________________<br>
> aspectc-user mailing list<br>
> <a class="moz-txt-link-abbreviated" href="mailto:aspectc-user@aspectc.org">aspectc-user@aspectc.org</a><br>
> <a class="moz-txt-link-freetext" href="http://www.aspectc.org/mailman/listinfo/aspectc-user">http://www.aspectc.org/mailman/listinfo/aspectc-user</a><br>
<br>
<hr>How well do you know your celebrity gossip? <a
moz-do-not-send="true"
href="http://originals.msn.com/thebigdebate?ocid=T002MSN03N0707A"
target="_new">Talk celebrity smackdowns here.</a></blockquote>
</body>
</html>