[Cmap-cvs] cmap cmap.cpp,1.35,1.36 evalImpl.h,1.10,1.11
Status: Beta
Brought to you by:
dyp
From: Denis P. <dy...@us...> - 2004-05-25 21:37:14
|
Update of /cvsroot/cmap/cmap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1444 Modified Files: cmap.cpp evalImpl.h Log Message: Delete config when done Index: cmap.cpp =================================================================== RCS file: /cvsroot/cmap/cmap/cmap.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- cmap.cpp 17 May 2004 16:02:06 -0000 1.35 +++ cmap.cpp 25 May 2004 21:37:01 -0000 1.36 @@ -21,6 +21,7 @@ #include "parser.h" #include "IngitFile.h" #include "PolishFormat.h" +#include "evalImpl.h" char cmapVersion[] = "cMap ver. 1.6b"; char cmapDescription[] = "Map data converter\n"; @@ -560,6 +561,8 @@ s_free(names_codif); s_free(names_gt1); + clearObjectConf(); + printf("Points......%i\n", N_Points); printf("Polylines...%i\n", N_Poliline); printf("Polygons....%i\n", N_Poligon); Index: evalImpl.h =================================================================== RCS file: /cvsroot/cmap/cmap/evalImpl.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- evalImpl.h 23 May 2004 06:27:21 -0000 1.10 +++ evalImpl.h 25 May 2004 21:37:01 -0000 1.11 @@ -10,6 +10,9 @@ class StringExpr { public: + virtual ~StringExpr() { + } + virtual std::string getValue(const h_object *obj, const ObjectProp &o) = 0; }; @@ -33,6 +36,9 @@ StringConst(const std::string &_value) : value(_value) { } + virtual ~StringConst() { + } + virtual std::string getValue(const h_object *, const ObjectProp &) { return value; } @@ -59,6 +65,9 @@ class IntExpr { public: + virtual ~IntExpr() { + } + virtual int getValue(const h_object *obj, const ObjectProp &o, int numArray) = 0; }; @@ -168,6 +177,13 @@ Assign() : next(NULL) { } + virtual ~Assign() { + if (next != NULL) { + delete next; + next = NULL; + } + } + virtual void exec(const h_object *obj, ObjectProp &o, int numArray) = 0; Assign *next; @@ -178,6 +194,11 @@ StringLVar *lvalue; StringExpr *rvalue; + virtual ~StringAssign() { + delete lvalue; + delete rvalue; + }; + virtual void exec(const h_object *obj, ObjectProp &o, int numArray); }; @@ -191,6 +212,11 @@ IntLVar *lvalue; IntExpr *rvalue; + virtual ~IntAssign() { + delete lvalue; + delete rvalue; + } + virtual void exec(const h_object *obj, ObjectProp &o, int numArray); }; @@ -201,6 +227,9 @@ class BoolExpr { public: + virtual ~BoolExpr() { + } + virtual bool getValue(const h_object *obj, const ObjectProp &o, int numArray) = 0; }; @@ -256,6 +285,10 @@ NotExpr(BoolExpr *_expr) : expr(_expr) { } + virtual ~NotExpr() { + delete expr; + } + virtual bool getValue(const h_object *obj, const ObjectProp &o, int numArray) { return !expr->getValue(obj, o, numArray); } @@ -268,6 +301,11 @@ BoolLVar *lvalue; BoolExpr *rvalue; + virtual ~BoolAssign() { + delete lvalue; + delete rvalue; + } + virtual void exec(const h_object *obj, ObjectProp &o, int numArray); }; @@ -276,6 +314,11 @@ BinaryIntExpr(IntExpr *_expr1, IntExpr *_expr2) : expr1(_expr1), expr2(_expr2) { } + virtual ~BinaryIntExpr() { + delete expr1; + delete expr2; + } + IntExpr *expr1; IntExpr *expr2; }; @@ -345,6 +388,11 @@ BinaryStringExpr(StringExpr *_expr1, StringExpr *_expr2) : expr1(_expr1), expr2(_expr2) { } + virtual ~BinaryStringExpr() { + delete expr1; + delete expr2; + } + StringExpr *expr1; StringExpr *expr2; }; @@ -389,6 +437,11 @@ BinarySetExpr(SetVar *_expr1, IntExpr *_expr2) : expr1(_expr1), expr2(_expr2) { } + ~BinarySetExpr() { + delete expr1; + delete expr2; + } + SetVar *expr1; IntExpr *expr2; }; @@ -424,6 +477,20 @@ Block() : first(NULL), last(NULL), firstCase(NULL), lastCase(NULL) { } + virtual ~Block() { + if (first != NULL) { + delete first; + first = NULL; + last = NULL; + } + + if (firstCase != NULL) { + delete (Block *)firstCase; + firstCase = NULL; + lastCase = NULL; + } + } + virtual void exec(const h_object *obj, ObjectProp &o, int numArray); void addAssign(Assign *a); void addCase(Case *a); @@ -440,6 +507,14 @@ Case(BoolExpr *_expr) : Block(), expr(_expr), next(NULL) { } + virtual ~Case() { + delete expr; + if (next != NULL) { + delete next; + next = NULL; + } + } + virtual void exec(const h_object *obj, ObjectProp &o, int numArray); BoolExpr *expr; |