[aspectc-user] Element counter example -- getting compile error

siva chelliah s.chelliah at samsung.com
Thu May 27 18:25:14 CEST 2004

It would be nice if you can post some working example coded on the web. I
have modified the code completely to use proper .h and .cpp files. 

I am getting some errors, but I will fix them and post the final code to
this list shortly.

During the test, I have found an error in the tutorial:

In the ErrorAspect.ah file, you have the following line:

advice execution("% Queue::dequeue(...)") && result(item)
But dequeue has no arguments! So I think it should be:

advice execution("% Queue::dequeue()") && result(item)

Instead testing the item after the execution, another idea is to test the
variable 'first' to see it that is 0. Here is the advice for that:

advice execution("% Queue::dequeue()") && that(q):
  before(Queue* q) {
    if (q->first == 0) {
      throw QueueEmptyError();

What do you think about this?

Siva Chelliah
Samsung Telecommunications America
1301 East Lookout Dr.   Richardson, TX 75082
972-761-7903 (fax: 7909)
A conclusion is simply the place where someone got tired of thinking

More information about the aspectc-user mailing list