Changeset 164


Ignore:
Timestamp:
1999-02-22T11:33:54+13:00 (25 years ago)
Author:
rjmcnab
Message:

Lots of stuff :-)

Location:
trunk/gsdl/src/recpt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/converter.cpp

    r150 r164  
    1212/*
    1313   $Log$
     14   Revision 1.2  1999/02/21 22:33:54  rjmcnab
     15   Lots of stuff :-)
     16
    1417   Revision 1.1  1999/02/05 10:42:45  rjmcnab
    1518
     
    2427
    2528// the converters within converterinfo become the property of
    26 // of this class after add_converter has been called. They should
    27 // be allocated with new but not explicitly destroyed (they will
    28 // be destroyed when this class is destroyed).
     29// of this class after add_converter has been called. The converters
     30// remain the responsability of the calling code and will not be
     31// deleted by this class.
    2932void convertinfoclass::add_converter (const text_t &name, inconvertclass *inconverter,
    3033                      rzwsoutconvertclass *outconverter) {
    3134  // can't add a null converter or an action with no name
    3235  if (inconverter == NULL || outconverter == NULL || name.empty()) {
    33     if (inconverter != NULL) delete inconverter;
    34     if (outconverter != NULL) delete outconverter;
    3536    return;
    3637  }
     
    4142  info.outconverter = outconverter;
    4243  converters[name] = info;
    43   info.inconverter = NULL;  // ownership has changed
    44   info.outconverter = NULL; // ownership has changed
    4544}
    4645
  • trunk/gsdl/src/recpt/converter.h

    r150 r164  
    2828
    2929
     30// inconverter and outconverter ARE NOT destroyed by this class
     31// they should be destroyed by the code which created them after
     32// no more pointers to the class exist.
     33//
     34// The above condition enables the class to be copied without
     35// copying the converters which might contain a lot of data (and
     36// be of an unknown derived type).
    3037class converterinfo {
    3138public:
     
    3542
    3643  converterinfo() {inconverter=NULL; outconverter=NULL;}
    37   ~converterinfo() {
    38     if (inconverter!=NULL) {
    39       delete inconverter;
    40       inconverter=NULL;
    41     }
    42     if (outconverter!=NULL) {
    43       delete outconverter;
    44       outconverter=NULL;
    45     }
    46   }
    4744};
    4845
     
    9087
    9188  // the converters within converterinfo become the property of
    92   // of this class after add_converter has been called. They should
    93   // be allocated with new but not explicitly destroyed (they will
    94   // be destroyed when this class is destroyed).
     89  // of this class after add_converter has been called. The converters
     90  // remain the responsability of the calling code and will not be
     91  // deleted by this class.
    9592  void add_converter (const text_t &name, inconvertclass *inconverter,
    9693              rzwsoutconvertclass *outconverter);
Note: See TracChangeset for help on using the changeset viewer.