##// END OF EJS Templates
Implements move operations (1)...
Implements move operations (1) Creates MoveOperation struct

File last commit:

r1217:faf15cb3a00c
r1217:faf15cb3a00c
Show More
FuzzingOperations.h
49 lines | 1.7 KiB | text/x-c | CLexer
/ plugins / amda / tests / FuzzingOperations.h
Alexandre Leroux
Defines fuzzing operations...
r1202 #ifndef SCIQLOP_FUZZINGOPERATIONS_H
#define SCIQLOP_FUZZINGOPERATIONS_H
#include "FuzzingDefs.h"
#include <memory>
#include <set>
#include <QLoggingCategory>
#include <QMetaType>
Q_DECLARE_LOGGING_CATEGORY(LOG_FuzzingOperations)
class Variable;
class VariableController;
/**
* Enumeration of types of existing fuzzing operations
*/
Alexandre Leroux
Implements move operations (1)...
r1217 enum class FuzzingOperationType { CREATE, PAN_LEFT, PAN_RIGHT, ZOOM_IN, ZOOM_OUT };
Alexandre Leroux
Defines fuzzing operations...
r1202
/// Interface that represents an operation that can be executed during a fuzzing test
struct IFuzzingOperation {
virtual ~IFuzzingOperation() noexcept = default;
Alexandre Leroux
Fixes clang-format for resource files
r1211 /// Checks if the operation can be executed according to the current state of the variable
/// passed in parameter
Alexandre Leroux
Defines fuzzing operations...
r1202 virtual bool canExecute(std::shared_ptr<Variable> variable) const = 0;
/// Executes the operation on the variable passed in parameter
/// @param variable the variable on which to execute the operation
/// @param variableController the controller associated to the operation
/// @param properties properties that can be used to configure the operation
Alexandre Leroux
Fixes clang-format for resource files
r1211 /// @remarks variable is passed as a reference because, according to the operation, it can be
/// modified (in/out parameter)
virtual void execute(std::shared_ptr<Variable> &variable,
VariableController &variableController,
const Properties &properties = {}) const = 0;
Alexandre Leroux
Defines fuzzing operations...
r1202 };
/// Factory of @sa IFuzzingOperation
struct FuzzingOperationFactory {
/// Creates a fuzzing operation from a type
static std::unique_ptr<IFuzzingOperation> create(FuzzingOperationType type);
};
Alexandre Leroux
Adds weights to operations (2)...
r1216 using WeightedOperationsTypes = std::map<FuzzingOperationType, double>;
Q_DECLARE_METATYPE(WeightedOperationsTypes)
Alexandre Leroux
Defines fuzzing operations...
r1202
#endif // SCIQLOP_FUZZINGOPERATIONS_H