Merge branch '1.x' of ssh://authdev.it.ohio-state.edu/~scantor/git/cpp-xmltooling...
[shibboleth/cpp-xmltooling.git] / xmltooling / util / XMLObjectChildrenList.h
index 145f91e..837d83e 100644 (file)
@@ -1,23 +1,27 @@
-/*
- *  Copyright 2001-2007 Internet2
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/**
+ * Licensed to the University Corporation for Advanced Internet
+ * Development, Inc. (UCAID) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for
+ * additional information regarding copyright ownership.
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ * UCAID licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the
+ * License at
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific
+ * language governing permissions and limitations under the License.
  */
 
 /**
  * @file xmltooling/util/XMLObjectChildrenList.h
  * 
- * STL-compatible container wrapper
+ * STL-compatible container wrapper.
  */
 
 #ifndef __xmltooling_list_h__
@@ -488,12 +492,12 @@ namespace xmltooling {
 
         const_iterator begin() const {
             // return iterator for beginning of const sequence
-            return m_container.begin();
+            return const_cast<const Container&>(m_container).begin();
         }
 
         const_iterator end() const {
             // return iterator for end of const sequence
-            return m_container.end();
+            return const_cast<const Container&>(m_container).end();
         }
 
         const_reference at(size_type _Pos) const {
@@ -558,7 +562,7 @@ namespace xmltooling {
         void removeParent(const_reference _Val) {
             if (_Val->getParent()!=m_parent)
                 throw XMLObjectException("Child object not owned by this parent.");
-            _Val->setParent(NULL);
+            _Val->setParent(nullptr);
             m_parent->releaseParentDOM(true);
         }
 
@@ -642,12 +646,12 @@ namespace xmltooling {
 
         const_iterator begin() const {
             // return iterator for beginning of const sequence
-            return m_container.begin();
+            return const_cast<const Container&>(m_container).begin();
         }
 
         const_iterator end() const {
             // return iterator for end of const sequence
-            return m_container.end();
+            return const_cast<const Container&>(m_container).end();
         }
 
         const_reference at(size_type _Pos) const {
@@ -720,9 +724,9 @@ namespace xmltooling {
         void removeParent(const_reference _Val) {
             if (_Val.first->getParent()!=m_parent || (_Val.second && _Val.second->getParent()!=m_parent))
                 throw XMLObjectException("One of the child objects not owned by this parent.");
-            _Val.first->setParent(NULL);
+            _Val.first->setParent(nullptr);
             if (_Val.second)
-                _Val.second->setParent(NULL);
+                _Val.second->setParent(nullptr);
             m_parent->releaseParentDOM(true);
         }