charmxi: convert SdagConstruct::publishesList from TList to std::list
authorPhil Miller <mille121@illinois.edu>
Fri, 5 Oct 2012 01:51:20 +0000 (20:51 -0500)
committerPhil Miller <mille121@illinois.edu>
Fri, 5 Oct 2012 01:51:20 +0000 (20:51 -0500)
src/xlat-i/sdag/CSdagConstruct.C
src/xlat-i/xi-symbol.h

index 60878aff2c8f4d2fec502a226b5a4e8d34f8f713..c2e9abd2c90883cdb892814c067abfd7482ac779 100644 (file)
@@ -20,7 +20,7 @@ SdagConstruct::SdagConstruct(EToken t, SdagConstruct *construct1)
   con1 = 0;  con2 = 0; con3 = 0; con4 = 0;
   type = t;
   traceName=NULL;
-  publishesList = new TList<SdagConstruct*>();
+  publishesList = new list<SdagConstruct*>();
   constructs = new list<SdagConstruct*>();
   constructs->push_back(construct1);
 }
@@ -30,7 +30,7 @@ SdagConstruct::SdagConstruct(EToken t, SdagConstruct *construct1, SdagConstruct
   con1=0; con2=0; con3=0; con4=0;
   type = t;
   traceName=NULL;
-  publishesList = new TList<SdagConstruct*>();
+  publishesList = new list<SdagConstruct*>();
   constructs = new list<SdagConstruct*>();
   constructs->push_back(construct1);
   constructs->insert(constructs->end(), aList->constructs->begin(), aList->constructs->end());
@@ -43,7 +43,7 @@ SdagConstruct::SdagConstruct(EToken t, XStr *txt, SdagConstruct *c1, SdagConstru
   type = t;
   traceName=NULL;
   con1 = c1; con2 = c2; con3 = c3; con4 = c4;
-  publishesList = new TList<SdagConstruct*>();
+  publishesList = new list<SdagConstruct*>();
   constructs = new list<SdagConstruct*>();
   if (constructAppend != 0) {
     constructs->push_back(constructAppend);
@@ -58,7 +58,7 @@ SdagConstruct::SdagConstruct(EToken t, const char *entryStr, const char *codeStr
   text = new XStr(codeStr);
   connectEntry = new XStr(entryStr);
   con1 = 0; con2 = 0; con3 = 0; con4 =0;
-  publishesList = new TList<SdagConstruct*>();
+  publishesList = new list<SdagConstruct*>();
   constructs = new list<SdagConstruct*>();
   param = pl;
 }
@@ -350,7 +350,7 @@ void SdagConstruct::propagateState(int uniqueVarNum)
     (*it)->propagateState(*stateVarsChildren, whensEntryMethodStateVars, *publishesList, uniqueVarNum);
 }
 
-void SdagConstruct::propagateState(list<CStateVar*>& plist, list<CStateVar*>& wlist, TList<SdagConstruct*>& publist, int uniqueVarNum)
+void SdagConstruct::propagateState(list<CStateVar*>& plist, list<CStateVar*>& wlist, list<SdagConstruct*>& publist, int uniqueVarNum)
 {
   CStateVar *sv;
   list<CStateVar*> *whensEntryMethodStateVars = NULL;
@@ -397,7 +397,7 @@ void SdagConstruct::propagateState(list<CStateVar*>& plist, list<CStateVar*>& wl
       stateVars->insert(stateVars->end(), plist.begin(), plist.end());
       stateVarsChildren = stateVars;
       if (con1 != 0) {
-        publist.append(con1);
+        publist.push_back(con1);
         /*SdagConstruct *sc;
         SdagConstruct *sc1;
         for(sc =publist.begin(); !publist.end(); sc=publist.next()) {
@@ -426,7 +426,7 @@ void SdagConstruct::propagateState(list<CStateVar*>& plist, list<CStateVar*>& wl
   delete whensEntryMethodStateVars;
 }
 
-void WhenConstruct::propagateState(list<CStateVar*>& plist, list<CStateVar*>& wlist, TList<SdagConstruct*>& publist, int uniqueVarNum) {
+void WhenConstruct::propagateState(list<CStateVar*>& plist, list<CStateVar*>& wlist, list<SdagConstruct*>& publist, int uniqueVarNum) {
   CStateVar *sv;
   list<CStateVar*> whensEntryMethodStateVars;
   stateVars = new list<CStateVar*>();
@@ -468,7 +468,7 @@ void WhenConstruct::propagateState(list<CStateVar*>& plist, list<CStateVar*>& wl
   propagateStateToChildren(*stateVarsChildren, whensEntryMethodStateVars, publist, uniqueVarNum);
 }
 
-void SdagConstruct::propagateStateToChildren(list<CStateVar*>& stateVarsChildren, list<CStateVar*>& wlist, TList<SdagConstruct*>& publist, int uniqueVarNum) {
+void SdagConstruct::propagateStateToChildren(list<CStateVar*>& stateVarsChildren, list<CStateVar*>& wlist, list<SdagConstruct*>& publist, int uniqueVarNum) {
   if (constructs != 0) {
     for (list<SdagConstruct*>::iterator it = constructs->begin(); it != constructs->end();
          ++it)
@@ -1252,9 +1252,10 @@ void SdagConstruct::generateSdagEntry(XStr& decls, XStr& defs, Entry *entry)
 
   decls << "public:\n";
   generateSignature(decls, defs, entry, false, "void", con1->text, false, stateVars);
-  SdagConstruct *sc;
-  SdagConstruct *sc1;
-  for(sc =publishesList->begin(); !publishesList->end(); sc=publishesList->next()) {
+  for (list<SdagConstruct*>::iterator pubIter = publishesList->begin();
+       pubIter != publishesList->end();
+       ++pubIter) {
+    SdagConstruct *sc = *pubIter;
     for (list<SdagConstruct*>::iterator it = sc->constructs->begin();
          it != sc->constructs->end();
          ++it)
index 496ba03c70b64bd9acb94e1f8f86f3e9721c549e..0d0e27731c8db0a86ff4e14d06ccb146c9353a4f 100644 (file)
@@ -1281,9 +1281,9 @@ protected:
   void generateListEventBracket(XStr& defs, int eventType);
   void generateChildrenCode(XStr& decls, XStr& defs, Entry* entry);
   void generateChildrenEntryList(std::list<CEntry*>& CEntrylist, WhenConstruct *thisWhen);
-  void propagateStateToChildren(std::list<CStateVar*>&, std::list<CStateVar*>&, TList<SdagConstruct*>&, int);
+  void propagateStateToChildren(std::list<CStateVar*>&, std::list<CStateVar*>&, std::list<SdagConstruct*>&, int);
   std::list<SdagConstruct *> *constructs;
-  TList<SdagConstruct *> *publishesList;
+  std::list<SdagConstruct *> *publishesList;
   std::list<CStateVar *> *stateVars;
   std::list<CStateVar *> *stateVarsChildren;
 
@@ -1310,15 +1310,15 @@ public:
 
  SdagConstruct(EToken t, const char *str) : type(t), traceName(NULL), con1(0), con2(0), con3(0), con4(0)
   { text = new XStr(str); constructs = new std::list<SdagConstruct*>();
-                  publishesList = new TList<SdagConstruct*>(); }
+    publishesList = new std::list<SdagConstruct*>(); }
                                              
  
   SdagConstruct(EToken t) : type(t), traceName(NULL), con1(0), con2(0), con3(0), con4(0) 
-               { publishesList = new TList<SdagConstruct*>();
+  { publishesList = new std::list<SdagConstruct*>();
                  constructs = new std::list<SdagConstruct*>(); }
 
   SdagConstruct(EToken t, XStr *txt) : type(t), traceName(NULL), text(txt), con1(0), con2(0), con3(0), con4(0) 
-                { publishesList = new TList<SdagConstruct*>();
+  { publishesList = new std::list<SdagConstruct*>();
                  constructs = new std::list<SdagConstruct*>();  }
   SdagConstruct(EToken t, const char *entryStr, const char *codeStr, ParamList *pl);
   void numberNodes(void);
@@ -1327,7 +1327,7 @@ public:
   void generateConnectEntries(XStr&);
   virtual void generateEntryList(std::list<CEntry*>&, WhenConstruct *);
   void propagateState(int);
-  virtual void propagateState(std::list<CStateVar*>&, std::list<CStateVar*>&, TList<SdagConstruct*>&, int);
+  virtual void propagateState(std::list<CStateVar*>&, std::list<CStateVar*>&, std::list<SdagConstruct*>&, int);
   virtual void generateCode(XStr& decls, XStr& defs, Entry *entry);
   void generateWhenCode(XStr& op);
   void setNext(SdagConstruct *, int);
@@ -1351,7 +1351,7 @@ public:
     : SdagConstruct(SWHEN, 0, 0, 0,0,0, body, el)
   { }
   void generateEntryList(std::list<CEntry*>& CEntrylist, WhenConstruct *thisWhen);
-  void propagateState(std::list<CStateVar*>&, std::list<CStateVar*>&, TList<SdagConstruct*>&, int);
+  void propagateState(std::list<CStateVar*>&, std::list<CStateVar*>&, std::list<SdagConstruct*>&, int);
 };
 
 SdagConstruct *buildAtomic(const char* code,