| 26 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 27 |  | const int numThreads; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 28 |  | QThreadPool myThreadPool; | 
 
 
 
 
 
 
 
 
 | 29 | – | QMutex mutexIsAvailable; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 29 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 30 |  | struct jsCustomCodeEngine{ | 
 
 
 
 
 
 
 
 | 31 | + | /* No need to delete these... They will stay alive until program quits. */ | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 32 |  | QScriptEngine* scriptEngine; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 33 |  | QScriptValue* jsFunction; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 34 |  | QScriptValue* getXmlDataFunction; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 35 |  | QScriptValue* setXmlDataFunction; | 
 
 
 
 
 
 
 
 
 
 
 | 36 | < | bool isAvailable; | 
 
 
 
 
 
 
 
 
 | 36 | > | QMutex *mutexForEngine; | 
 
 
 
 
 
 
 
 
 
 
 | 37 |  | }; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 38 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 39 |  | QVector<jsCustomCodeEngine> jsScriptEngines; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 43 |  | XmlCustomCode& operator=(XmlCustomCode const&);  // assignment operator is private | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 44 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 45 |  | void displayJsException(QScriptEngine &engine, QScriptValue &engineResult); | 
 
 
 
 
 
 
 
 
 | 46 | – | jsCustomCodeEngine& getAvailableJsEngine(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 46 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 47 |  | __attribute__((always_inline)) inline void customCodeUnwinding(const QString &fileName, QString &currXmlFileString, | 
 
 
 
 
 
 
 
 
 
 
 | 48 | < | QScriptEngine &engine, clock_t &begin, double elapsed_secs, QScriptValue &engineResult, QScriptValue &jsFunction, | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 49 | < | QScriptValue &getXmlDataFunction, QScriptValue &setXmlDataFunction, const bool &backupsEnabled, const bool &verboseEnabled){ | 
 
 
 
 
 
 
 
 
 | 48 | > | QScriptEngine &engine, clock_t &begin, double elapsed_secs, QScriptValue &engineResult, QScriptValue &jsFunction, | 
 
 
 
 
 | 49 | > | QScriptValue &getXmlDataFunction, QScriptValue &setXmlDataFunction, const bool &backupsEnabled, const bool &verboseEnabled){ | 
 
 
 
 
 
 
 
 
 
 
 | 50 |  | if(backupsEnabled){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 51 |  | UtilXmlTools::backupFile(fileName, verboseEnabled); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 52 |  | } |