[Xapian-tickets] [Xapian] #554: Complement clone() method with destroy()

Xapian nobody at xapian.org
Wed Jul 27 07:24:26 BST 2011


#554: Complement clone() method with destroy()
-------------------------+--------------------------------------------------
 Reporter:  olly         |       Owner:  olly 
     Type:  enhancement  |      Status:  new  
 Priority:  normal       |   Milestone:  1.3.0
Component:  Library API  |     Version:       
 Severity:  normal       |    Keywords:       
Blockedby:               |    Platform:  All  
 Blocking:               |  
-------------------------+--------------------------------------------------
 Currently methods like {{{MatchSpy::clone()}}} return an object which has
 to be deallocatable with {{{delete}}}.  If we added a virtual method:

 {{{
 #!cpp
 virtual void
 MatchSpy::destroy()
 {
     delete this;
 }
 }}}

 Then instead of:

 {{{
 #!cpp
 delete matchspy;
 }}}

 Xapian could use:

 {{{
 #!cpp
 matchspy->destroy();
 }}}

 And then subclasses of {{{MatchSpy}}} could allocate themselves in other
 ways in {{{clone()}}} and provide the corresponding code to deallocate the
 object in {{{destroy()}}}.

 This might make it feasible to implement {{{MatchSpy::clone()}}} in the
 bindings.

 Marking for 1.3.0 for now.

-- 
Ticket URL: <http://trac.xapian.org/ticket/554>
Xapian <http://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list