-// Copyright (C) 2009-2011 by Konrad Rosenbaum <konrad@silmor.de>
+// Copyright (C) 2009-2012 by Konrad Rosenbaum <konrad@silmor.de>
// protected under the GNU GPL version 3 or at your option any newer.
// See COPYING.GPL file that comes with this distribution.
//
scd+="}\n";
hcd+="\t"+cn+"& operator=(const "+cn+"&);\n";
scd+=cn+"& "+cn+"::operator=(const "+cn+"&o)\n{\n";
+ scd+="\tif(this == &o)return *this;\n";
scd+="\t"+cnb+"::operator=(o);\n";
for(int i=0;i<k.size();i++)
scd+="\tmp_"+k[i]+"=o.mp_"+k[i]+";\n";
}
}
scd+="}\n";
+ hcd+="\tvirtual ~"+cn+"(){}\n";
//write it...
hdr.write(hcd.toAscii());
-// Copyright (C) 2009-2011 by Konrad Rosenbaum <konrad@silmor.de>
+// Copyright (C) 2009-2012 by Konrad Rosenbaum <konrad@silmor.de>
// protected under the GNU GPL version 3 or at your option any newer.
// See COPYING.GPL file that comes with this distribution.
//
-// Copyright (C) 2009-2011 by Konrad Rosenbaum <konrad@silmor.de>
+// Copyright (C) 2009-2012 by Konrad Rosenbaum <konrad@silmor.de>
// protected under the GNU GPL version 3 or at your option any newer.
// See COPYING.GPL file that comes with this distribution.
//
{
//define parametric constructor
ct.hcd+=" protected:\n";
- ct.hcd+="\t"+ct.cn+"("+ct.xinlist+");\n";
+ ct.hcd+="\texplicit "+ct.cn+"("+ct.xinlist+");\n";
//parametric constructor implementation
ct.scd+=ct.cn+"::"+ct.cn+"("+ct.xinlist+")\n\t:"+m_transbase+"(iface)\n{\n";
ct.scd+="\tnew "+ct.cnp+"(this);\n";
ct.hcd+="\t"+ct.cn+"& operator=(const "+ct.cn+"&);\n";
//copy operator implemented
ct.scd+=ct.cn+"& "+ct.cn+"::operator=(const "+ct.cn+"&t)\n{\n";
+ ct.scd+="\tif(this == &t)return *this;\n";
ct.scd+="\t"+m_transbase+"::operator=(t);\n";
ct.scd+="\tp->detach(this);t.p->attach(this);\n";
ct.scd+="\treturn *this;\n}\n\n";
//destructor
- ct.hcd+="\t~"+ct.cn+"();\n";
+ ct.hcd+="\tvirtual ~"+ct.cn+"();\n";
ct.scd+=ct.cn+"::~"+ct.cn+"()\n{\n\tp->detach(this);\n}\n\n";
}
-// Copyright (C) 2009-2011 by Konrad Rosenbaum <konrad@silmor.de>
+// Copyright (C) 2009-2012 by Konrad Rosenbaum <konrad@silmor.de>
// protected under the GNU GPL version 3 or at your option any newer.
// See COPYING.GPL file that comes with this distribution.
//
//define parametric constructor
ct.hcd+=" protected:\n";
ct.hcd+="\tfriend class "+m_parent->ifaceClassName()+";\n";
- ct.hcd+="\t"+ct.cn+"(QString,const WServerRequest&);\n";
+ ct.hcd+="\texplicit "+ct.cn+"(QString,const WServerRequest&);\n";
//parametric constructor implementation
ct.scd+=ct.cn+"::"+ct.cn+"(QString iface,const WServerRequest&request)\n";
ct.scd+="\t:"+m_transbase+"(iface)\n{\n";
ct.hcd+="\t"+ct.cn+"& operator=(const "+ct.cn+"&);\n";
//copy operator implemented
ct.scd+=ct.cn+"& "+ct.cn+"::operator=(const "+ct.cn+"&t)\n{\n";
+ ct.scd+="\tif(this==&t)return *this;\n";
ct.scd+="\t"+m_transbase+"::operator=(t);\n";
ct.scd+="\tp->detach(this);t.p->attach(this);\n";
ct.scd+="\treturn *this;\n}\n\n";