Hello again I'm working with the Poco internet library trying to understand it but I have come across some syntax that I don't quite understand. This may be a beginner question. Here it is:

Poco::AutoPtr<Poco::Notification> pNf (_queue.waitDequeueNotification);

I know AutoPtr's contain a count of how many objects reference the object being pointed to; and that only one object can hold ownership over the object. I do not understand what's going on here. Could somebody explain it to me?

Recommended Answers

All 2 Replies

This line declares a variable called pNf which is an auto-pointer to a Notification object, and it is initialized to _queue.waitDequeueNotification.

The AutoPtr is a class template. And the Notification class is it's template argument, making AutoPtr<Notification> an auto-pointer to a notification object. I believe that it is essentially equivalent to the standard unique-pointer.

Ah, that's almost exactly what I guessed that it was. Looking up unknown syntax is difficult you know? :D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.