[aspectc-user] How to introduce a method into a class ??
Jean J
jean_10452 at yahoo.fr
Wed Jul 28 10:31:29 CEST 2004
Hello,
I'm gonna look more into my code to see if there is a
problem else where. On the other hand what is the
syntax to indicate that this method is going to be
public ?
thanks
--- Olaf Spinczyk
<Olaf.Spinczyk at informatik.uni-erlangen.de> a écrit : >
Hello Jean,
>
> Jean J wrote:
> > Hello,
> >
> > I am trying to introduce some variables and
> methods
> > into a class using AspectC++. As i read into the
> > quickref for aspectC++ "if the advice is not
> > recognized of being of a predefined kind, is is
> > regarded as an introduction of a new method,
> > attribute, or type ..."
> >
> > my code is the following :
> >
> >
> > aspect TEST {
> >
> > advice "Class1" : void do_some_work() {
> > cout << "doing some work" << endl;
> > return;
> > }
> > };
> >
> >
> > But i get an error with ac++ :
> >
> > In file included from ac_gen.cc:32:
> > test.ah:3: syntax error before `{'
> > ac_gen.cc:7: syntax error before `::'
> >
> > Is the syntax of my method introduction ok or not
> ?
> > any suggestions ?
> >
> > Thanks.
>
> The syntax looks OK. Do you have something like ...
>
> #include <iostream>
> using std::cout;
> using std::endl;
>
> ... in your aspect header? You have to make sure
> that every object,
> which is referenced by the introduced code, is known
> in every affected
> translation unit. The best way to achieve this goal
> is to include the
> respective header files in the aspect header.
>
> However, I doubt that this is the problem here.
>
> If you have a simple example, don't hesitate to send
> me the code.
>
> Olaf
>
Vous manquez despace pour stocker vos mails ?
Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer instantanément avec vos amis. A télécharger gratuitement sur http://fr.messenger.yahoo.com
More information about the aspectc-user
mailing list