SVGAnimatedPropertyDescription.h [plain text]
#ifndef SVGAnimatedPropertyDescription_h
#define SVGAnimatedPropertyDescription_h
#include <wtf/HashMap.h>
#include <wtf/text/AtomicString.h>
namespace WebCore {
class SVGElement;
struct SVGAnimatedPropertyDescription {
SVGAnimatedPropertyDescription()
: m_element(nullptr)
, m_attributeName(nullptr)
{
}
SVGAnimatedPropertyDescription(WTF::HashTableDeletedValueType)
: m_element(reinterpret_cast<SVGElement*>(-1))
{
}
bool isHashTableDeletedValue() const
{
return m_element == reinterpret_cast<SVGElement*>(-1);
}
SVGAnimatedPropertyDescription(SVGElement* element, const AtomicString& attributeName)
: m_element(element)
, m_attributeName(attributeName.impl())
{
ASSERT(m_element);
ASSERT(m_attributeName);
}
bool operator==(const SVGAnimatedPropertyDescription& other) const
{
return m_element == other.m_element && m_attributeName == other.m_attributeName;
}
SVGElement* m_element;
AtomicStringImpl* m_attributeName;
};
struct SVGAnimatedPropertyDescriptionHash {
static unsigned hash(const SVGAnimatedPropertyDescription& key)
{
return StringHasher::hashMemory<sizeof(SVGAnimatedPropertyDescription)>(&key);
}
static bool equal(const SVGAnimatedPropertyDescription& a, const SVGAnimatedPropertyDescription& b)
{
return a == b;
}
static const bool safeToCompareToEmptyOrDeleted = true;
};
struct SVGAnimatedPropertyDescriptionHashTraits : WTF::SimpleClassHashTraits<SVGAnimatedPropertyDescription> { };
}
#endif // SVGAnimatedPropertyDescription_h