| 1 | | |
|---|
| | 1 | /*---------------------------------------------------------------------------*\ |
|---|
| | 2 | * OpenSG * |
|---|
| | 3 | * * |
|---|
| | 4 | * * |
|---|
| | 5 | * Copyright (C) 2008 by the OpenSG Forum * |
|---|
| | 6 | * * |
|---|
| | 7 | * www.opensg.org * |
|---|
| | 8 | * * |
|---|
| | 9 | * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de * |
|---|
| | 10 | * * |
|---|
| | 11 | \*---------------------------------------------------------------------------*/ |
|---|
| | 12 | /*---------------------------------------------------------------------------*\ |
|---|
| | 13 | * License * |
|---|
| | 14 | * * |
|---|
| | 15 | * This library is free software; you can redistribute it and/or modify it * |
|---|
| | 16 | * under the terms of the GNU Library General Public License as published * |
|---|
| | 17 | * by the Free Software Foundation, version 2. * |
|---|
| | 18 | * * |
|---|
| | 19 | * This library is distributed in the hope that it will be useful, but * |
|---|
| | 20 | * WITHOUT ANY WARRANTY; without even the implied warranty of * |
|---|
| | 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * |
|---|
| | 22 | * Library General Public License for more details. * |
|---|
| | 23 | * * |
|---|
| | 24 | * You should have received a copy of the GNU Library General Public * |
|---|
| | 25 | * License along with this library; if not, write to the Free Software * |
|---|
| | 26 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * |
|---|
| | 27 | * * |
|---|
| | 28 | \*---------------------------------------------------------------------------*/ |
|---|
| | 29 | /*---------------------------------------------------------------------------*\ |
|---|
| | 30 | * Changes * |
|---|
| | 31 | * * |
|---|
| | 32 | * * |
|---|
| | 33 | * * |
|---|
| | 34 | * * |
|---|
| | 35 | * * |
|---|
| | 36 | * * |
|---|
| | 37 | \*---------------------------------------------------------------------------*/ |
|---|
| 29 | | template <class ObjectTypeT> |
|---|
| 30 | | ChildSFieldReferenceProxy<ObjectTypeT>::ChildSFieldReferenceProxy( |
|---|
| 31 | | Self const &source) |
|---|
| 32 | | |
|---|
| 33 | | : _pValue(source._pValue), |
|---|
| 34 | | _pField(source._pField) |
|---|
| | 73 | template <class ObjectTypeT, Int32 NamespaceI> inline |
|---|
| | 74 | ChildPointerSField<ObjectTypeT, |
|---|
| | 75 | NamespaceI >::ChildPointerSField(Self const &source) : |
|---|
| | 76 | Inherited(source) |
|---|
| | 77 | { |
|---|
| | 78 | // nothing to do |
|---|
| | 79 | } |
|---|
| | 80 | |
|---|
| | 81 | template <class ObjectTypeT, Int32 NamespaceI> inline |
|---|
| | 82 | ChildPointerSField<ObjectTypeT, |
|---|
| | 83 | NamespaceI >::ChildPointerSField(ValueType value) : |
|---|
| | 84 | Inherited(value) |
|---|
| 42 | | template <class ObjectTypeT> |
|---|
| 43 | | inline |
|---|
| 44 | | ChildSFieldReferenceProxy<ObjectTypeT>::~ChildSFieldReferenceProxy(void) |
|---|
| 45 | | { |
|---|
| 46 | | // nothing to do |
|---|
| 47 | | } |
|---|
| 48 | | |
|---|
| 49 | | /*-------------------------------------------------------------------------*/ |
|---|
| 50 | | /* Operators */ |
|---|
| 51 | | |
|---|
| 52 | | template <class ObjectTypeT> |
|---|
| 53 | | inline |
|---|
| 54 | | ChildSFieldReferenceProxy<ObjectTypeT>::operator value_type(void) const |
|---|
| 55 | | { |
|---|
| 56 | | return AccessHandler::validate(*_pValue); |
|---|
| 57 | | } |
|---|
| 58 | | |
|---|
| 59 | | template <class ObjectTypeT> |
|---|
| 60 | | inline typename ChildSFieldReferenceProxy<ObjectTypeT>::value_type |
|---|
| 61 | | ChildSFieldReferenceProxy<ObjectTypeT>::operator->(void) const |
|---|
| 62 | | { |
|---|
| 63 | | return AccessHandler::validate(*_pValue); |
|---|
| 64 | | } |
|---|
| 65 | | |
|---|
| 66 | | template <class ObjectTypeT> |
|---|
| 67 | | inline void |
|---|
| 68 | | ChildSFieldReferenceProxy<ObjectTypeT>::operator=(value_type newValue) |
|---|
| 69 | | { |
|---|
| 70 | | AccessHandler::onReplace(_pField, *_pValue, newValue); |
|---|
| 71 | | |
|---|
| 72 | | *_pValue = newValue; |
|---|
| 73 | | } |
|---|
| 74 | | |
|---|
| 75 | | /*-------------------------------------------------------------------------*/ |
|---|
| 76 | | /* ChildPointerSField<ObjectTypeT, */ |
|---|
| 77 | | /* NamespaceI > */ |
|---|
| 78 | | /*-------------------------------------------------------------------------*/ |
|---|
| 79 | | |
|---|
| 80 | | /*-------------------------------------------------------------------------*/ |
|---|
| 81 | | /* Class Type */ |
|---|
| 82 | | |
|---|
| 83 | | template <class ObjectTypeT, Int32 NamespaceI> |
|---|
| 84 | | inline FieldType const & |
|---|
| 85 | | ChildPointerSField<ObjectTypeT, |
|---|
| 86 | | NamespaceI >::getClassType(void) |
|---|
| 87 | | { |
|---|
| 88 | | return _fieldType; |
|---|
| 89 | | } |
|---|
| 90 | | |
|---|
| 91 | | /*-------------------------------------------------------------------------*/ |
|---|
| 92 | | /* Constructors */ |
|---|
| 93 | | |
|---|
| 94 | | template <class ObjectTypeT, Int32 NamespaceI> |
|---|
| 95 | | inline |
|---|
| 96 | | ChildPointerSField<ObjectTypeT, |
|---|
| 97 | | NamespaceI >::ChildPointerSField(void) |
|---|
| 98 | | : Inherited() |
|---|
| 99 | | { |
|---|
| 100 | | // nothing to do |
|---|
| 101 | | } |
|---|
| 102 | | |
|---|
| 103 | | template <class ObjectTypeT, Int32 NamespaceI> |
|---|
| 104 | | inline |
|---|
| 105 | | ChildPointerSField<ObjectTypeT, |
|---|
| 106 | | NamespaceI >::ChildPointerSField(Self const &source) |
|---|
| 107 | | : Inherited(source) |
|---|
| 108 | | { |
|---|
| 109 | | // nothing to do |
|---|
| 110 | | } |
|---|
| 111 | | |
|---|
| 112 | | template <class ObjectTypeT, Int32 NamespaceI> |
|---|
| 113 | | inline |
|---|
| 114 | | ChildPointerSField<ObjectTypeT, |
|---|
| 115 | | NamespaceI >::ChildPointerSField(ValueType value) |
|---|
| 116 | | : Inherited(value) |
|---|
| 117 | | { |
|---|
| 118 | | // nothing to do |
|---|
| 119 | | } |
|---|
| 120 | | |
|---|
| 121 | | /*-------------------------------------------------------------------------*/ |
|---|
| 122 | | /* Destructor */ |
|---|
| 123 | | |
|---|
| 124 | | template <class ObjectTypeT, Int32 NamespaceI> |
|---|
| 125 | | inline |
|---|
| 126 | | ChildPointerSField<ObjectTypeT, |
|---|
| 127 | | NamespaceI >::~ChildPointerSField(void) |
|---|
| | 92 | template <class ObjectTypeT, Int32 NamespaceI> inline |
|---|
| | 93 | ChildPointerSField<ObjectTypeT, |
|---|
| | 94 | NamespaceI >::~ChildPointerSField(void) |
|---|
| 138 | | NamespaceI >::editValue(void) |
|---|
| 139 | | { |
|---|
| 140 | | return reference(&this->editRawStore(), this); |
|---|
| 141 | | } |
|---|
| 142 | | |
|---|
| 143 | | template <class ObjectTypeT, Int32 NamespaceI> |
|---|
| 144 | | inline typename ChildPointerSField<ObjectTypeT, |
|---|
| 145 | | NamespaceI >::const_reference |
|---|
| 146 | | ChildPointerSField<ObjectTypeT, |
|---|
| 147 | | NamespaceI >::getValue(void) const |
|---|
| | 105 | NamespaceI >::getValue(void) const |
|---|