weak pointer



Hi developers,

I need a weak pointer in glibmm. I was thinking about something like:
template <typename Tobj>
class WeakPtr: private RefPtr<Tobj>
{
   RefPtr<Tobj> a;
 public:
WeakPtr(other RefPTr)
{
 a = reptr;
 a.cppObject->unreference();
}

 RefPtr<Tobj> lock()
{
//Try to get a valid RefPtr from a
//if it's not valid, throw an error.
}
};

Would it be possible to start a discussion about the full
implementation and get this into glibmm if I put in some effort to
implement it more correctly?


Greets,
 Bram



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]