1 #ifndef DYNAMIC_DEPTH_INTERNAL_DYNAMIC_DEPTH_ELEMENT_H_  // NOLINT
2 #define DYNAMIC_DEPTH_INTERNAL_DYNAMIC_DEPTH_ELEMENT_H_  // NOLINT
3 
4 #include <unordered_map>
5 
6 #include "xmpmeta/xml/deserializer.h"
7 #include "xmpmeta/xml/serializer.h"
8 
9 namespace dynamic_depth {
10 
11 /**
12  * An interface for an element in the Dynamic Depth spec.
13  */
14 class Element {
15  public:
~Element()16   virtual ~Element() {}
17 
18   // Appends child elements' namespaces' and their respective hrefs to the
19   // given collection, and any parent nodes' names to prefix_names.
20   // Key: Name of the namespace.
21   // Value: Full namespace URL.
22   // Example: ("Image", "http://ns.google.com/photos/dd/1.0/image/")
23   virtual void GetNamespaces(
24       std::unordered_map<string, string>* ns_name_href_map) = 0;
25 
26   // Serializes this element.
27   virtual bool Serialize(
28       ::dynamic_depth::xmpmeta::xml::Serializer* serializer) const = 0;
29 };
30 
31 }  // namespace dynamic_depth
32 
33 #endif  // DYNAMIC_DEPTH_INTERNAL_DYNAMIC_DEPTH_ELEMENT_H_  // NOLINT
34