From: JINMEI Tatuya Date: Wed, 3 Oct 2012 16:21:16 +0000 (-0700) Subject: [2060] clarified the ownership of obj returned via getFinder/AllRRsets. X-Git-Tag: trac2351_base~9^2^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fa51dffbe444e5d2ac6a768da001b60ad16d0341;p=thirdparty%2Fkea.git [2060] clarified the ownership of obj returned via getFinder/AllRRsets. --- diff --git a/src/lib/datasrc/zone.h b/src/lib/datasrc/zone.h index a417500399..3885aeef74 100644 --- a/src/lib/datasrc/zone.h +++ b/src/lib/datasrc/zone.h @@ -332,10 +332,15 @@ public: protected: /// \brief Return the \c ZoneFinder that created this \c Context. /// - /// A derived class implementation can return NULL if it specializes + /// A derived class implementation can return NULL if it defines /// other protected methods that require a non NULL result from /// this method. Otherwise it must return a valid, non NULL pointer /// to the \c ZoneFinder object. + /// + /// When returning non NULL, the ownership of the pointed object + /// was not transferred to the caller; it cannot be assumed to be + /// valid after the originating \c Context object is destroyed. + /// Also, the caller must not try to delete the returned object. virtual ZoneFinder* getFinder() = 0; /// \brief Return a vector of RRsets corresponding to findAll() result. @@ -343,10 +348,15 @@ public: /// This method returns a set of RRsets that correspond to the /// returned RRsets to a prior \c findAll() call. /// - /// A derived class implementation can return NULL if it specializes + /// A derived class implementation can return NULL if it defines /// other protected methods that require a non NULL result from /// this method. Otherwise it must return a valid, non NULL pointer /// to a vector that correspond to the expected set of RRsets. + /// + /// When returning non NULL, the ownership of the pointed object + /// was not transferred to the caller; it cannot be assumed to be + /// valid after the originating \c Context object is destroyed. + /// Also, the caller must not try to delete the returned object. virtual const std::vector* getAllRRsets() const = 0;