Commit 00520c57 by Francois Gygi

cleaned up destructors


git-svn-id: http://qboxcode.org/svn/qb/trunk@670 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 47a857e2
......@@ -15,7 +15,7 @@
// ComputeMLWFCmd.C:
//
////////////////////////////////////////////////////////////////////////////////
// $Id: ComputeMLWFCmd.C,v 1.7 2008-09-08 15:56:18 fgygi Exp $
// $Id: ComputeMLWFCmd.C,v 1.8 2008-11-14 22:11:30 fgygi Exp $
#include "ComputeMLWFCmd.h"
#include<iostream>
......@@ -23,12 +23,13 @@
#include "SlaterDet.h"
using namespace std;
////////////////////////////////////////////////////////////////////////////////
int ComputeMLWFCmd::action(int argc, char **argv)
{
Wavefunction& wf = s->wf;
SlaterDet& sd = *(wf.sd(0,0));
mlwft = new MLWFTransform(sd);
MLWFTransform* mlwft = new MLWFTransform(sd);
mlwft->compute_transform();
mlwft->apply_transform(sd);
......
......@@ -15,7 +15,7 @@
// ComputeMLWFCmd.h
//
////////////////////////////////////////////////////////////////////////////////
// $Id: ComputeMLWFCmd.h,v 1.4 2008-09-08 15:56:18 fgygi Exp $
// $Id: ComputeMLWFCmd.h,v 1.5 2008-11-14 22:11:30 fgygi Exp $
#ifndef COMPUTEMLWFCMD_H
#define COMPUTEMLWFCMD_H
......@@ -32,8 +32,6 @@ class ComputeMLWFCmd : public Cmd
{
private:
MLWFTransform* mlwft;
public:
Sample *s;
......@@ -53,6 +51,5 @@ class ComputeMLWFCmd : public Cmd
int action(int argc, char **argv);
ComputeMLWFCmd();
~ComputeMLWFCmd();
};
#endif
......@@ -15,7 +15,7 @@
// UserInterface.C: definition of readCmd and processCmds
//
////////////////////////////////////////////////////////////////////////////////
// $Id: UserInterface.C,v 1.10 2008-11-14 04:06:25 fgygi Exp $
// $Id: UserInterface.C,v 1.11 2008-11-14 22:11:30 fgygi Exp $
#include "UserInterface.h"
#include <string>
......@@ -65,6 +65,17 @@ UserInterface::UserInterface(void) : terminate_(false)
}
////////////////////////////////////////////////////////////////////////////////
UserInterface::~UserInterface(void)
{
std::list<Cmd*>::iterator cmd;
for ( cmd = cmdlist.begin(); cmd != cmdlist.end(); cmd++ )
delete *cmd;
std::list<Var*>::iterator var;
for ( var = varlist.begin(); var != varlist.end(); var++ )
delete *var;
}
////////////////////////////////////////////////////////////////////////////////
int UserInterface::readCmd(char *s, int max, istream &fp, bool echo)
{
int ch, i = 0;
......
......@@ -36,6 +36,7 @@ class Cmd
virtual char *name(void) const = 0;
virtual char *help_msg(void) const = 0;
virtual int action(int argc, char **argv) = 0;
virtual ~Cmd(void) {}
};
class Var
......@@ -45,6 +46,7 @@ class Var
virtual char *name ( void ) const = 0;
virtual int set ( int argc, char **argv ) = 0;
virtual std::string print ( void ) const = 0;
virtual ~Var(void) {}
};
class UserInterface
......@@ -115,5 +117,6 @@ class UserInterface
bool onpe0(void) const { return onpe0_; }
UserInterface(void);
~UserInterface(void);
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment