Skip to content
Snippets Groups Projects
Commit e8175c2a authored by Aaron Cuevas Lopez's avatar Aaron Cuevas Lopez
Browse files

Add machine descriptor field to metadata descriptor

parent f2bc1a65
No related branches found
No related tags found
No related merge requests found
......@@ -44,8 +44,8 @@ bool checkMetaDataType(MetaDataDescriptor::MetaDataTypes baseType)
//MetaDataDescriptor
MetaDataDescriptor::MetaDataDescriptor(MetaDataDescriptor::MetaDataTypes t, unsigned int length, String n, String d)
: m_type(t), m_length(length), m_name(n), m_desc(d)
MetaDataDescriptor::MetaDataDescriptor(MetaDataDescriptor::MetaDataTypes t, unsigned int length, String n, String d, String dm)
: m_name(n), m_description(d), m_descriptor(dm), m_type(t), m_length(length)
{};
MetaDataDescriptor::~MetaDataDescriptor() {};
......@@ -54,7 +54,8 @@ MetaDataDescriptor::MetaDataTypes MetaDataDescriptor::getType() const { return m
unsigned int MetaDataDescriptor::getLength() const { return m_length; }
size_t MetaDataDescriptor::getDataSize() const { return m_length*getTypeSize(m_type); }
String MetaDataDescriptor::getName() const { return m_name; }
String MetaDataDescriptor::getDescription() const { return m_desc; }
String MetaDataDescriptor::getDescription() const { return m_description; }
String MetaDataDescriptor::getDescriptor() const { return m_descriptor; }
bool MetaDataDescriptor::isEqual(const MetaDataDescriptor& other) const
{
......
......@@ -57,13 +57,30 @@ public:
DOUBLE
};
MetaDataDescriptor(MetaDataTypes type, unsigned int length, String name, String desc);
/**
MetaData descriptor constructor
@param type The primitive type this metadata field will hold
@param length The length of the data. 1 for single value or mroe for arrays.
@param name The human-readable name of this metadata field
@param humanDescription A human-readable description of what this field represents
@param machineDescriptor A simple machine-readable name for this metadata value
name and humanDescription will be saved in most data formats for latter reference
*/
MetaDataDescriptor(MetaDataTypes type, unsigned int length, String name, String humanDescription, String machineDescriptor);
~MetaDataDescriptor();
/** Gets the primitive type of this field */
MetaDataTypes getType() const;
/** Gets the number of elements in this field */
unsigned int getLength() const;
/** Gets the total data in bytes for this field */
size_t getDataSize() const;
/** Gets the human-readable name of this field */
String getName() const;
/** Gets the human-readable description of the field */
String getDescription() const;
/** Gets the machine-readable descriptor for this field */
String getDescriptor() const;
bool isEqual(const MetaDataDescriptor& other) const;
bool operator==(const MetaDataDescriptor& other) const;
......@@ -71,10 +88,11 @@ public:
static size_t getTypeSize(MetaDataTypes type);
private:
MetaDataDescriptor() = delete;
String m_name;
String m_desc;
MetaDataTypes m_type;
unsigned int m_length;
const String m_name;
const String m_descriptor;
const String m_description;
const MetaDataTypes m_type;
const unsigned int m_length;
JUCE_LEAK_DETECTOR(MetaDataDescriptor);
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment