📄 executor.h
字号:
//-------------------------------------------------------------------
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Revisions.....:
//===================================================================
#ifndef __EXECUTOR_H__
#define __EXECUTOR_H__
#include <copyright.h>
#include <kernel/algorithms/algorithm.h>
//-------------------------------------------------------------------
// Class.........: Executor
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Executes a set of commands in a command script.
// Comments......:
// Revisions.....:
//===================================================================
class Executor : public Algorithm {
protected:
//- Parameters.....................................................
Id output_; // Type of output.
String commandfile_; // Location of file with commands.
String logfile_; // Location of log file.
protected:
//- Protected methods..............................................
virtual bool LoadCommands(const String &filename, Algorithm::Handles &algorithms, Vector(String) ¶meters) const;
virtual Structure *ExecuteCommands(Structure &structure, const Algorithm::Handles &algorithms, const Vector(String) ¶meters) const;
virtual Structure *ExecuteCommands(Structure &structure, const Algorithm::Handles &algorithms, const Vector(String) ¶meters, ofstream &stream) const = 0;
virtual bool SaveLogHeader(ofstream &stream) const;
virtual bool SaveLogEntry(ofstream &stream, const Algorithm &algorithm) const;
virtual bool SaveLogEntry(ofstream &stream, const Structure &structure) const;
public:
//- Constructors/destructor........................................
Executor();
virtual ~Executor();
//- Methods inherited from Identifier..............................
DECLAREIDMETHODS()
//- Methods inherited from Algorithm...............................
virtual String GetParameters() const;
virtual bool GetOutputFilenames(Vector(String) &filenames) const;
virtual bool SetParameter(const String &keyword, const String &value);
virtual bool IsApplicable(const Structure &structure, bool warn = true) const;
virtual Structure *Apply(Structure &structure) const;
//- Local methods..................................................
Id GetOutputType() const {return output_;}
bool SetOutputType(Id output) {output_ = output; return true;}
const String &GetCommandFilename() const {return commandfile_;}
bool SetCommandFilename(const String &commandfile) {commandfile_ = commandfile; return true;}
const String &GetLogFilename() const {return logfile_;}
bool SetLogFilename(const String &logfile) {logfile_ = logfile; return true;}
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -