Reducing header overuse, non-inlining selected methods (CPPOST-35).
[shibboleth/cpp-sp.git] / shibsp / attribute / ExtensibleAttribute.h
index 8a12836..1543288 100644 (file)
@@ -24,7 +24,6 @@
 #define __shibsp_extattr_h__
 
 #include <shibsp/attribute/Attribute.h>
-#include <xmltooling/exceptions.h>
 
 namespace shibsp {
 
@@ -45,65 +44,32 @@ namespace shibsp {
          * @param ids       array with primary identifier in first position, followed by any aliases
          * @param formatter template for serialization of values
          */
-        ExtensibleAttribute(const std::vector<std::string>& ids, const char* formatter) : Attribute(ids) {
-            m_obj = Attribute::marshall();
-            m_obj.name("Extensible");
-            m_obj.addmember("_formatter").string(formatter);
-        }
+        ExtensibleAttribute(const std::vector<std::string>& ids, const char* formatter);
 
         /**
          * Constructs based on a remoted ExtensibleAttribute.
          *
          * @param in    input object containing marshalled ExtensibleAttribute
          */
-        ExtensibleAttribute(DDF& in) : Attribute(in), m_obj(in.copy()) {
-        }
+        ExtensibleAttribute(DDF& in);
 
-        virtual ~ExtensibleAttribute() {
-            m_obj.destroy();
-        }
+        virtual ~ExtensibleAttribute();
 
         /**
          * Returns the set of values in a DDF list.
          *
          * @return  a mutable list object containing the values
          */
-        DDF getValues() {
-            return m_obj.first();
-        }
-
-        size_t valueCount() const {
-            return m_obj.first().integer();
-        }
-
-        void clearSerializedValues() {
-            m_serialized.clear();
-        }
-
-        const char* getString(size_t index) const {
-            return m_obj.first()[static_cast<unsigned long>(index)].string();
-        }
-
-        const char* getScope(size_t index) const {
-            return NULL;
-        }
-
-        void removeValue(size_t index) {
-            Attribute::removeValue(index);
-            DDF vals = m_obj.first();
-            if (index < static_cast<size_t>(vals.integer()))
-                vals[static_cast<unsigned long>(index)].remove().destroy();
-        }
-
+        DDF getValues();
+
+        // Virtual function overrides.
+        size_t valueCount() const;
+        void clearSerializedValues();
+        const char* getString(size_t index) const;
+        const char* getScope(size_t index) const;
+        void removeValue(size_t index);
         const std::vector<std::string>& getSerializedValues() const;
-
-        DDF marshall() const {
-            if (!isCaseSensitive())
-                m_obj.addmember("case_insensitive");
-            if (isInternal())
-                m_obj.addmember("internal");
-            return m_obj.copy();
-        }
+        DDF marshall() const;
 
     private:
         mutable DDF m_obj;