Im transferring some code from ACE to Poco. I’m new to multithreaded design so it is confusing me just a little!
typedef Arc::AutoPtr<ResultSet, ACE_Thread_Mutex> QueryResult;
Im not able to just re-write it like this, as Poco::AutoPtr only accepts one argument as a class template
typedef Poco::AutoPtr<ResultSet, Poco::Mutex> QueryResult;
How should i write it?
I’m not sure what
Arc::AutoPtris, because I couldn’t find anything like that in the ACE documentation. However if it’s the same asACE_Refcounted_Auto_Ptrthen the corresponding typedef for Poco would probably betypedef Poco::SharedPtr<ResultSet> QueryResult;. But it’s not clear from the docs whether the SharedPtr in Poco implements a thread safe reference counting, so you have to be careful of that.Poco::AutoPtris actually an intrusive smart pointer which requires support from the pointed type (similar toboost::intrusive_ptr).