NNFile
class NNFile : public NNData
{
public:
NNFile(std::string fileName);
public:
std::string getFileName();
public:
virtual std::string getType();
virtual std::string toString();
virtual std::shared_ptr<NNData> clone(bool deep);
};
Introduction to the class
The NNFile class represents a neural network data entity that is specifically associated with a file. It inherits from the NNData class, providing additional functionalities related to file handling.
This class encapsulates the filename and provides methods to retrieve it, as well as overridden methods to get the type of data and to create a string representation of the object. Additionally, it supports cloning the object, with an option for deep copying.
Introduction to the Class's Methods
NNRect()
brief: Constructs a new NNFile object.
param
x: fileName The name of the file associated with this neural network data entity.
std::string getFileName()
brief: Retrieves the name of the file associated with this object.
return string: A string containing the filename.
std::string getType()
brief: Returns a string identifying the type of this data entity.
return string: A string representing the type of data ("File").
std::string toString()
brief: Returns a string representation of the object, including the filename.
return string: A formatted string containing information about the object.
std::shared_ptr<NNData> clone(bool deep)
brief: Creates a copy of this object. If deep is true, performs a deep copy; otherwise, a shallow copy.
param
deep: Specifies whether to perform a deep copy (true) or a shallow copy (false).
return shared_ptr<NNData>: A shared pointer to the newly created copy of the object.