/**
 * \file    Mimic_Node.hpp
 * \author  Silvan Murer
 * \date    24 September 2022
 *
 * \brief   Base class of Mimic Generic Feature implementation
 */

#ifndef INC_FEATURES_MIMIC_NODE
#define INC_FEATURES_MIMIC_NODE

#include <memory>
#include <string>
#include <variant>
#include <vector>

namespace GenApi_3_4 {
	struct INode; ///< forware declaration of GenICam node
}

namespace mimic {

class Mimic_Node {
public:
	/**
	 * \enum Type_e
	 * \brief enumeration of feature types
	 */
	enum class Type_e : uint32_t {
		NODE = 0,         /**< Mimic_Node (base) feature type */
		CATEGORY = 1,     /**< Mimic_Category feature type */
		INTEGER = 2,      /**< Mimic_Integer feature type */
		FLOAT = 3,        /**< Mimic_Float feature type */
		STRING = 4,       /**< Mimic_String feature type */
		ENUMERATION = 5,  /**< Mimic_Enumeration feature type */
		COMMAND = 6,      /**< Mimic_Command feature type */
		BOOLEAN = 7       /**< Mimic_Boolean feature type */
	};
protected:
	Type_e type;
	GenApi_3_4::INode* node;

public:
	Mimic_Node();
	Mimic_Node(GenApi_3_4::INode* node);
	virtual ~Mimic_Node();

	inline bool operator==(const Mimic_Node& rhs) {
		return (node == rhs.node);
	};
	inline bool operator!=(const Mimic_Node& rhs) {
		return (node != rhs.node);
	};

	Type_e getType();
	std::string getName();

	virtual std::variant<int64_t, double, bool, std::string> getVariant(std::string name);
	virtual void setVariant(std::string name, std::variant<int64_t, double, bool, std::string> value);

	// GenICam ISelector Interface
	bool isSelector();
	std::vector<std::shared_ptr<Mimic_Node>> getSelectedFeatures();
	std::vector<std::shared_ptr<Mimic_Node>> getSelectingFeatures();
};

} /* namespace mimic */

#endif
