Skip to content

InscoperAPI/API/Base/Recipe/RecipeElementSimple.h

Namespaces

Name
Inscoper
Inscoper namespace.

Classes

Name
class Inscoper::RecipeElementSimple
RecipeElementSimple class represents a basic recipe step with actions and conditions.

Source code

#ifndef RECIPEELEMENTSIMPLE_H
#define RECIPEELEMENTSIMPLE_H

#include <Base/Device/EFunctionType.h>
#include <Base/Device/SubDeviceId.h>
#include <Base/Recipe/RecipeElement.h>
#include <Base/Recipe/ValueCondition.h>

#include <map>
#include <vector>

namespace Inscoper {

class INSCOPER_EXPORT RecipeElementSimple : public RecipeElement {
public:
#ifndef SWIG
  RecipeElementSimple(RecipeElementSimple const &) = delete;
  RecipeElementSimple(RecipeElementSimple &&) = delete;
  RecipeElementSimple &operator=(RecipeElementSimple const &) = delete;
  RecipeElementSimple &operator=(RecipeElementSimple &&) = delete;
#endif

  RecipeElementSimple();

  virtual ~RecipeElementSimple();

  virtual void fromXML(Inscoper::XMLNode &xml) INSCOPER_EXCEPTION override;

  virtual void toXML(Inscoper::XMLNode &xmlParent) INSCOPER_EXCEPTION override;

  virtual Inscoper::ERecipeElementType getType() override;

  const std::string &getDescription() const;

  void setDescription(const std::string &description);

  const Inscoper::SubDeviceId getSubDeviceId() const;

  void setSubDeviceId(const Inscoper::SubDeviceId subDeviceId);

  const std::string &getRecipeId() const;

  void setRecipeId(const std::string &recipeId);

  Inscoper::EFunctionType getFunction() const;

  void setFunction(Inscoper::EFunctionType function);

  const std::string &getValue() const;

  void setValue(const std::string &value);

  bool getImage() const;

  void setImage(bool image);

  const std::vector<Inscoper::ValueConditionPtr> &getValueConditionList() const;

  void setValueConditionList(const std::vector<Inscoper::ValueConditionPtr> &valueConditionList);

  void addValueCondition(const Inscoper::ValueConditionPtr &valueCondition);

  const std::string &getTagCondition() const;

  void setTagCondition(const std::string &tagCondition);

  bool getOptimisation() const;

  void setOptimisation(bool optimisation);

  bool hasValueCondition();

  const std::string &getCallId();

  void setCallId(const std::string &callId);

  void addOnCallSubRecipes(const std::vector<std::shared_ptr<RecipeElementSimple>> &elems);

  void addOnCallSubRecipe(const std::shared_ptr<RecipeElementSimple> &elem);

  std::vector<std::string> getDependencies();

  void setRecipeCalled(const std::string &id);

  const std::string &getRecipeCallCondition();

  void setRecipeCallCondition(const std::string &recipeCallCondition);

  std::map<std::string, bool> &getRecipeCallState();

  const std::vector<std::shared_ptr<RecipeElementSimple>> &getRecipeCallSubRecipes();

private:
  std::string _description;

  // action elements
  Inscoper::SubDeviceId _subDeviceId;
  std::string _recipeId;
  Inscoper::EFunctionType _function;
  std::string _value;
  bool _image;

  // condition elements
  // std::string _valueCondition;
  std::string _tagCondition;
  bool _optimisation;
  std::vector<Inscoper::ValueConditionPtr> _valueConditions;

  // call condition elements
  std::string _callId;
  std::string _recipeCallCondition;
  std::vector<std::shared_ptr<RecipeElementSimple>> _recipeCallSubRecipes;
  std::map<std::string, bool> _recipeCallState;
};

typedef std::shared_ptr<RecipeElementSimple> RecipeElementSimplePtr;

} // namespace Inscoper

#endif // RECIPEELEMENTSIMPLE_H

Updated on 2026-09-03 at 12:14:17 +0200