@@ -83,9 +83,8 @@ DotManager *DotManager::instance()
83
83
return m_theInstance;
84
84
}
85
85
86
- DotManager::DotManager () : m_runners(), m_filePatchers(1009 )
86
+ DotManager::DotManager () : m_runners(), m_filePatchers()
87
87
{
88
- m_filePatchers.setAutoDelete (TRUE );
89
88
m_queue = new DotRunnerQueue;
90
89
int i;
91
90
int dotNumThreads = Config_getInt (DOT_NUM_THREADS);
@@ -130,25 +129,27 @@ DotRunner* DotManager::createRunner(const std::string &absDotName, const std::st
130
129
{
131
130
err (" md5 hash does not match for two different runs of %s !\n " , absDotName.data ());
132
131
}
132
+ rv = runit->second .get ();
133
133
}
134
+ assert (rv);
134
135
return rv;
135
136
}
136
137
137
- DotFilePatcher *DotManager::createFilePatcher (const QCString &fileName)
138
+ DotFilePatcher *DotManager::createFilePatcher (const std::string &fileName)
138
139
{
139
- DotFilePatcher * patcher = m_filePatchers.find (fileName);
140
- if (patcher== 0 )
141
- {
142
- patcher = new DotFilePatcher (fileName);
143
- m_filePatchers.append (fileName,patcher );
144
- }
145
- return patcher ;
140
+ auto patcher = m_filePatchers.find (fileName);
141
+
142
+ if (patcher != m_filePatchers. end ()) return &(patcher-> second );
143
+
144
+ auto rv = m_filePatchers.emplace (fileName, fileName. c_str () );
145
+ assert (rv. second );
146
+ return &(rv. first -> second ) ;
146
147
}
147
148
148
149
bool DotManager::run () const
149
150
{
150
151
uint numDotRuns = m_runners.size ();
151
- uint numFilePatchers = m_filePatchers.count ();
152
+ uint numFilePatchers = m_filePatchers.size ();
152
153
if (numDotRuns+numFilePatchers>1 )
153
154
{
154
155
if (m_workers.count ()==0 )
@@ -236,27 +237,25 @@ bool DotManager::run() const
236
237
237
238
// patch the output file and insert the maps and figures
238
239
i=1 ;
239
- SDict<DotFilePatcher>::Iterator di (m_filePatchers);
240
- const DotFilePatcher *fp;
241
240
// since patching the svg files may involve patching the header of the SVG
242
241
// (for zoomable SVGs), and patching the .html files requires reading that
243
242
// header after the SVG is patched, we first process the .svg files and
244
243
// then the other files.
245
- for (di. toFirst ();(fp=di. current ());++di )
244
+ for (auto & fp : m_filePatchers )
246
245
{
247
- if (fp-> isSVGFile ())
246
+ if (fp. second . isSVGFile ())
248
247
{
249
248
msg (" Patching output file %d/%d\n " ,i,numFilePatchers);
250
- if (!fp-> run ()) return FALSE ;
249
+ if (!fp. second . run ()) return FALSE ;
251
250
i++;
252
251
}
253
252
}
254
- for (di. toFirst ();(fp=di. current ());++di )
253
+ for (auto & fp : m_filePatchers )
255
254
{
256
- if (!fp-> isSVGFile ())
255
+ if (!fp. second . isSVGFile ())
257
256
{
258
257
msg (" Patching output file %d/%d\n " ,i,numFilePatchers);
259
- if (!fp-> run ()) return FALSE ;
258
+ if (!fp. second . run ()) return FALSE ;
260
259
i++;
261
260
}
262
261
}
0 commit comments