Doxygen
Loading...
Searching...
No Matches
dotrunner.h
Go to the documentation of this file.
1/******************************************************************************
2*
3* Copyright (C) 1997-2019 by Dimitri van Heesch.
4*
5* Permission to use, copy, modify, and distribute this software and its
6* documentation under the terms of the GNU General Public License is hereby
7* granted. No representations are made about the suitability of this software
8* for any purpose. It is provided "as is" without express or implied warranty.
9* See the GNU General Public License for more details.
10*
11* Documents produced by Doxygen are derivative works derived from the
12* input used in their production; they are not affected by this license.
13*
14*/
15
16#ifndef DOTRUNNER_H
17#define DOTRUNNER_H
18
19#include <string>
20#include <thread>
21#include <list>
22#include <queue>
23#include <mutex>
24#include <condition_variable>
25#include <memory>
26
27#include "qcstring.h"
28
29/** Helper class to run dot from doxygen from multiple threads. */
31{
32 struct DotJob
33 {
34 DotJob(const QCString &f, const QCString &o, const QCString &a,
35 const QCString &s,int l)
36 : format(f), output(o), args(a), srcFile(s), srcLine(l) {}
37 QCString format;
38 QCString output;
39 QCString args;
40 QCString srcFile;
42 };
43
44 public:
45 /** Creates a runner for a dot \a file. */
46 DotRunner(const QCString & absDotName, const QCString& md5Hash = QCString());
47
48 /** Adds an additional job to the run.
49 * Performing multiple jobs one file can be faster.
50 */
51 void addJob(const QCString &format,const QCString &output,const QCString &srcFile,int srcLine);
52
53 /** Prevent cleanup of the dot file (for user provided dot files) */
54 void preventCleanUp() { m_cleanUp = false; }
55
56 /** Runs dot for all jobs added. */
57 bool run();
58
59 QCString getMd5Hash() { return m_md5Hash; }
60
61 static bool readBoundingBox(const QCString &fileName, int* width, int* height, bool isEps);
62
63 private:
64 QCString m_file;
65 QCString m_md5Hash;
66 QCString m_dotExe;
68 std::vector<DotJob> m_jobs;
69};
70
71#endif
QCString m_file
Definition dotrunner.h:64
bool m_cleanUp
Definition dotrunner.h:67
QCString m_md5Hash
Definition dotrunner.h:65
void preventCleanUp()
Prevent cleanup of the dot file (for user provided dot files)
Definition dotrunner.h:54
DotRunner(const QCString &absDotName, const QCString &md5Hash=QCString())
Creates a runner for a dot file.
void addJob(const QCString &format, const QCString &output, const QCString &srcFile, int srcLine)
Adds an additional job to the run.
bool run()
Runs dot for all jobs added.
QCString getMd5Hash()
Definition dotrunner.h:59
std::vector< DotJob > m_jobs
Definition dotrunner.h:68
static bool readBoundingBox(const QCString &fileName, int *width, int *height, bool isEps)
QCString m_dotExe
Definition dotrunner.h:66
QCString srcFile
Definition dotrunner.h:40
QCString format
Definition dotrunner.h:37
QCString output
Definition dotrunner.h:38
DotJob(const QCString &f, const QCString &o, const QCString &a, const QCString &s, int l)
Definition dotrunner.h:34