#include"modelCDMFolder.h"
+/**
+ * Class representing a black box inside a Crea project. A black box is modular construct that uses the project libraries to execute its operations
+ */
class modelCDMBlackBox : public modelCDMFolder
{
public:
+ /**
+ * Default Constructor.
+ */
modelCDMBlackBox();
- modelCDMBlackBox(const std::string& path, const std::string& name, const int& level = 1);
+ /**
+ * Black Box Constructor.
+ * @param parent parent node of the black box node.
+ * @param path Path of the source folder of the black box node.
+ * @param name Name of the black box node.
+ * @param level Hierarchy level of the black box node in the project. By default 3
+ */
+ modelCDMBlackBox(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level = 3);
+ /**
+ * Destructor.
+ */
~modelCDMBlackBox();
+ /**
+ * Returns the name of the black box node.
+ * @return Name of the black box node.
+ */
const std::string& GetNameBlackBox() const;
+ /**
+ * Retrieves the black box authors' names.
+ * @return Names of the black box node authors.
+ */
const std::string& GetAuthors() const;
+ /**
+ * Retrieves the categories of the black box.
+ * @return Categories associated with the black box.
+ */
const std::string& GetCategories() const;
+ /**
+ * Returns the description of the black box purpose.
+ * @return Description of the black box.
+ */
const std::string& GetDescription() const;
+ /**
+ * Returns a reference of the header file of the black box.
+ * @return Header file of the black box.
+ */
modelCDMFile* GetHeaderFile() const;
+ /**
+ * Returns a reference of the source file of the black box.
+ * @return Source file of the black box.
+ */
modelCDMFile* GetSourceFile() const;
+ /**
+ * Sets the name of the black box with the one provided.
+ * @param name New name of the black box.
+ * @param result Result message.
+ * @return True if the operation was successful.
+ */
bool SetNameBlackBox(const std::string& name, std::string*& result);
+ /**
+ * Sets the authors' names of the black box to the ones given.
+ * @param authors Authors' names.
+ * @param result Result message.
+ * @return True if the operation was successful.
+ */
bool SetAuthors(const std::string& authors, std::string*& result);
- bool SetCategories(const std::string& version, std::string*& result);
+ /**
+ * Sets the Categories associated with the black box to the given ones.
+ * @param categories Categories associated with the black box.
+ * @param result Result message
+ * @return True if the operation was successful.
+ */
+ bool SetCategories(const std::string& categories, std::string*& result);
+ /**
+ * Sets the Description of the black box to the given one.
+ * @param description Description of the black box.
+ * @param result Result message.
+ * @return True if the operation was successful.
+ */
bool SetDescription(const std::string& description, std::string*& result);
+ /**
+ * Sets the reference of the header file.
+ * @param file Reference to the Header file.
+ */
void SetHeaderFile(modelCDMFile* file);
+ /**
+ * Sets the reference of the source file.
+ * @param file Reference to the source file.
+ */
void SetSourceFile(modelCDMFile* file);
+ /**
+ * Opens the source file with the system default code editor
+ * @param result Result message.
+ * @return True if the operation was successful.
+ */
bool OpenCxx(std::string*& result);
+ /**
+ * Opens the header file with the system default code editor
+ * @param result Result message.
+ * @return True if the operation was successful.
+ */
bool OpenHxx(std::string*& result);
+ /**
+ * Refreshes the structure and properties of the black box.
+ * @param result Result message.
+ * @return True if the operation was successful.
+ */
const bool Refresh(std::string*& result);
private:
+ /**
+ * Name of the black box. It might be different from the header file name.
+ */
std::string nameBlackBox;
+ /**
+ * Authors of the black box.
+ */
std::string authors;
+ /**
+ * Categories associated to the categories.
+ */
std::string categories;
+ /**
+ * Description of the black box.
+ */
std::string description;
+ /**
+ * Reference to the header file of the black box.
+ */
modelCDMFile* header;
+ /**
+ * Reference to the source file of the black box.
+ */
modelCDMFile* source;
};