1 /**************************************************************************\
2 * Copyright (c) Kongsberg Oil & Gas Technologies AS
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met:
8 *
9 * Redistributions of source code must retain the above copyright notice,
10 * this list of conditions and the following disclaimer.
11 *
12 * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * Neither the name of the copyright holder nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 \**************************************************************************/
32
33 /*!
34 \class SoNodeList SoNodeList.h Inventor/lists/SoNodeList.h
35 \brief The SoNodeList class is a container for pointers to SoNode objects.
36
37 As this class inherits SoBaseList, referencing and dereferencing
38 will default be done on the objects at append(), remove(), insert()
39 etc.
40 */
41
42 #include <Inventor/lists/SoNodeList.h>
43
44
45 /*!
46 Default constructor.
47 */
SoNodeList(void)48 SoNodeList::SoNodeList(void)
49 {
50 }
51
52 /*!
53 Constructor with a hint about the number of elements the list will
54 hold.
55
56 \sa SoBaseList::SoBaseList(const int)
57 */
SoNodeList(const int size)58 SoNodeList::SoNodeList(const int size)
59 : SoBaseList(size)
60 {
61 }
62
63 /*!
64 Copy constructor.
65
66 \sa SoBaseList::SoBaseList(const SoBaseList &)
67 */
SoNodeList(const SoNodeList & nl)68 SoNodeList::SoNodeList(const SoNodeList & nl)
69 : SoBaseList(nl)
70 {
71 }
72
73 /*!
74 Destructor.
75
76 \sa SoBaseList::~SoBaseList()
77 */
~SoNodeList()78 SoNodeList::~SoNodeList()
79 {
80 }
81
82 /*!
83 Append \a ptr to the list.
84
85 \sa SoBaseList::append()
86 */
87 void
append(SoNode * const ptr)88 SoNodeList::append(SoNode * const ptr)
89 {
90 SoBaseList::append((SoBase *)ptr);
91 }
92
93 /*!
94 Return node pointer at index \a i.
95
96 \sa SoBaseList::operator[]()
97 */
98 SoNode *
operator [](const int i) const99 SoNodeList::operator[](const int i) const
100 {
101 return (SoNode *)SoBaseList::operator[](i);
102 }
103
104 /*!
105 Copy contents of list \a nl to this list.
106
107 \sa SoBaseList::operator=()
108 */
109 SoNodeList &
operator =(const SoNodeList & nl)110 SoNodeList::operator=(const SoNodeList & nl)
111 {
112 this->copy(nl);
113 return *this;
114 }
115