charmxi sdag: privatize estateVars and convert from TList
authorPhil Miller <mille121@illinois.edu>
Thu, 4 Oct 2012 17:05:38 +0000 (12:05 -0500)
committerPhil Miller <mille121@illinois.edu>
Thu, 4 Oct 2012 17:05:38 +0000 (12:05 -0500)
src/xlat-i/sdag/CEntry.h
src/xlat-i/sdag/CSdagConstruct.C
src/xlat-i/xi-symbol.h

index 5ced043dce65adc7820672db4893c7eb6df4cf22..91d6c196a139b2f8c32587142daf19859e8bd15c 100644 (file)
@@ -3,7 +3,6 @@
 
 #include "xi-util.h"
 #include "sdag-globals.h"
-#include "CList.h"
 
 #include <list>
 
@@ -26,11 +25,9 @@ public:
     int needsParamMarshalling;
     int refNumNeeded;
     std::list<SdagConstruct*> whenList;
-    CEntry(XStr *e, ParamList *p, TList<CStateVar*>& list, int pm) : entry(e), paramlist(p), needsParamMarshalling(pm) {
+    CEntry(XStr *e, ParamList *p, const std::list<CStateVar*>& list, int pm) : entry(e), paramlist(p), needsParamMarshalling(pm) {
        CStateVar *sv;
-       for(sv=list.begin(); !list.end(); sv=list.next()) {
-         myParameters.push_back(sv);
-       }
+       myParameters = list;
        entryNum = numEntries++;
        refNumNeeded =0;
        decl_entry = NULL;
index aec760b75dee4ad9154faed479fbeac68fc375bc..24e4b89913c5991698fc47c40fbd1004a9eea4bb 100644 (file)
@@ -400,16 +400,14 @@ void SdagConstruct::propagateState(TList<CStateVar*>& list, TList<CStateVar*>& w
             //stateVars->append(sv);
               stateVarsChildren->append(sv);
               whensEntryMethodStateVars->append(sv); 
-             el->entry->estateVars.append(sv);
-             el->entry->stateVars->append(sv);
+              el->entry->addEStateVar(sv);
           }
           else {
             while(pl != NULL) {
               sv = new CStateVar(pl);
               stateVarsChildren->append(sv);
               whensEntryMethodStateVars->append(sv); 
-             el->entry->estateVars.append(sv);
-             el->entry->stateVars->append(sv);
+              el->entry->addEStateVar(sv);
 
               pl = pl->next;
            }
index a871d43bd1f79cd772fe3506a7210324c93991e9..636ff4dec0c166825583f9630b8b4462bfb0e33c 100644 (file)
@@ -976,6 +976,7 @@ class Entry : public Member {
     XStr syncReturn(void);
     XStr marshallMsg(void);
     XStr callThread(const XStr &procName,int prependEntryName=0);
+    std::list<CStateVar *> estateVars;
   public:
     XStr *label;
     char *name;
@@ -985,7 +986,6 @@ class Entry : public Member {
     SdagConstruct *sdagCon;
     TList<CStateVar *> *stateVars;
     TList<CStateVar *> *stateVarsChildren;
-    TList<CStateVar *> estateVars;
     CEntry *entryPtr;
     const char *intExpr;
     ParamList *param;
@@ -993,6 +993,11 @@ class Entry : public Member {
     int isConnect;
     int isWhenEntry;
 
+    void addEStateVar(CStateVar *sv) {
+      estateVars.push_back(sv);
+      stateVars->append(sv);
+    }
+
     // DMK - Accel Support
     ParamList* accelParam;
     XStr* accelCodeBody;