Show
Ignore:
Timestamp:
04/07/08 02:50:33 (8 months ago)
Author:
vossg
Message:

changed: merged some merge changes back to have a running reference

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/Carsten_PtrWork2/Source/System/FieldContainer/Fields/Base/OSGPointerMFieldBase.inl

    r1072 r1138  
     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\*---------------------------------------------------------------------------*/ 
    138 
    239#ifdef OSG_DOC_FILES_IN_MODULE 
     
    1956 */ 
    2057 
     58inline 
     59UInt32 PointerMFieldBase::getBinSize(void) const 
     60{ 
     61    return  
     62        sizeof(UInt32) + // num elements 
     63        (_ptrStore.size() ?  
     64         MFieldTraits::getBinSize(&(_ptrStore[0]), _ptrStore.size()) : 0); 
     65} 
     66 
     67 
     68inline 
     69void PointerMFieldBase::copyToBin(BinaryDataHandler &pMem) const 
     70{ 
     71    UInt32 n = _ptrStore.size(); 
     72 
     73    pMem.putValue(n); 
     74 
     75    if(n != 0) 
     76    { 
     77        MFieldTraits::copyToBin(   pMem,  
     78                                &(_ptrStore[0]), 
     79                                  _ptrStore.size()); 
     80    } 
     81} 
     82 
     83/*-------------------------------------------------------------------------*/ 
     84/* Std Library Const Interface                                             */ 
     85 
     86inline  
     87PointerMFieldBase::const_iterator PointerMFieldBase::begin(void) const 
     88{ 
     89    return _ptrStore.begin(); 
     90} 
     91 
     92inline  
     93PointerMFieldBase::const_iterator PointerMFieldBase::end(void) const 
     94{ 
     95    return _ptrStore.end(); 
     96} 
     97     
     98inline  
     99PointerMFieldBase::const_reverse_iterator PointerMFieldBase::rbegin(void) const 
     100{ 
     101    return _ptrStore.rbegin(); 
     102} 
     103 
     104inline  
     105PointerMFieldBase::const_reverse_iterator PointerMFieldBase::rend(void) const 
     106{ 
     107    return _ptrStore.rend(); 
     108} 
     109 
     110inline  
     111PointerMFieldBase::const_value PointerMFieldBase::front(void) const 
     112{ 
     113    return _ptrStore.front(); 
     114} 
     115 
     116inline  
     117PointerMFieldBase::const_value PointerMFieldBase::back(void) const 
     118{ 
     119    return _ptrStore.back(); 
     120} 
     121 
     122inline  
     123bool PointerMFieldBase::empty(void) const 
     124{ 
     125    return _ptrStore.empty(); 
     126} 
     127 
     128inline  
     129PointerMFieldBase::size_type PointerMFieldBase::size(void) const 
     130{ 
     131    return _ptrStore.size(); 
     132} 
     133 
     134inline  
     135PointerMFieldBase::size_type PointerMFieldBase::max_size(void) const 
     136{ 
     137    return _ptrStore.max_size(); 
     138} 
     139 
     140inline  
     141PointerMFieldBase::size_type PointerMFieldBase::capacity(void) const 
     142{ 
     143    return _ptrStore.capacity(); 
     144} 
     145     
     146inline 
     147Int32 PointerMFieldBase::findIndex(const_value value) const 
     148{ 
     149    const_iterator it = std::find(_ptrStore.begin(), _ptrStore.end(), value); 
     150 
     151    if(it != _ptrStore.end()) 
     152    { 
     153        return it - _ptrStore.begin(); 
     154    } 
     155    else 
     156    { 
     157        return -1; 
     158    } 
     159} 
     160 
     161inline  
     162PointerMFieldBase::const_value  
     163    PointerMFieldBase::operator[](UInt32 const index) const 
     164{ 
     165    return _ptrStore[index]; 
     166} 
     167 
     168inline  
     169PointerMFieldBase::const_value  
     170    PointerMFieldBase::at(UInt32 const index) const 
     171{ 
     172    return _ptrStore.at(index); 
     173} 
     174     
     175inline 
     176bool PointerMFieldBase::operator ==(const Self &source) const 
     177{ 
     178    return _ptrStore == source._ptrStore; 
     179} 
     180 
     181 
     182#ifdef OSG_MT_CPTR_ASPECT 
     183inline 
     184void PointerMFieldBase::beginEdit(UInt32              , 
     185                                  AspectOffsetStore  &) 
     186{ 
     187} 
     188 
     189inline 
     190PointerMFieldBase::Self * 
     191    PointerMFieldBase::resolveShare(UInt32              ,  
     192                                    AspectOffsetStore  &) 
     193{ 
     194    return NULL; 
     195} 
     196 
     197inline 
     198void PointerMFieldBase::terminateShare(UInt32              ,  
     199                                       AspectOffsetStore  &) 
     200{ 
     201     
     202} 
     203 
     204inline 
     205bool PointerMFieldBase::isShared(void) 
     206{ 
     207    return false; 
     208} 
     209#endif 
     210 
    21211/*-------------------------------------------------------------------------*/ 
    22212/* Constructors                                                            */ 
    23213 
    24214inline 
    25     PointerMFieldBase::PointerMFieldBase(void) 
    26      
    27     : _ptrStore() 
    28 
    29 
    30  
    31 inline 
    32     PointerMFieldBase::PointerMFieldBase(Self const &source) 
    33      
    34     : _ptrStore(source._ptrStore) 
    35 
    36 
    37  
    38 inline 
    39     PointerMFieldBase::PointerMFieldBase(UInt32 const size) 
    40      
    41     : _ptrStore(size) 
     215PointerMFieldBase::PointerMFieldBase(void) : 
     216     Inherited(), 
     217    _ptrStore () 
    42218{ 
    43219} 
     
    47223 
    48224inline 
    49     PointerMFieldBase::~PointerMFieldBase(void) 
    50 
    51 
    52  
    53 /*-------------------------------------------------------------------------*/ 
    54 /* Std Library Const Interface                                             */ 
    55  
    56 inline PointerMFieldBase::const_iterator 
    57     PointerMFieldBase::begin(void) const 
    58 
    59     return _ptrStore.begin(); 
    60 
    61  
    62 inline PointerMFieldBase::const_iterator 
    63     PointerMFieldBase::end(void) const 
    64 
    65     return _ptrStore.end(); 
    66 
    67      
    68 inline PointerMFieldBase::const_reverse_iterator 
    69     PointerMFieldBase::rbegin(void) const 
    70 
    71     return _ptrStore.rbegin(); 
    72 
    73  
    74 inline PointerMFieldBase::const_reverse_iterator 
    75     PointerMFieldBase::rend(void) const 
    76 
    77     return _ptrStore.rend(); 
    78 
    79  
    80 inline bool 
    81     PointerMFieldBase::empty(void) const 
    82 
    83     return _ptrStore.empty(); 
    84 
    85  
    86 inline PointerMFieldBase::size_type 
    87     PointerMFieldBase::size(void) const 
    88 
    89     return _ptrStore.size(); 
    90 
    91  
    92 inline PointerMFieldBase::size_type 
    93     PointerMFieldBase::max_size(void) const 
    94 
    95     return _ptrStore.max_size(); 
    96 
    97  
    98 inline PointerMFieldBase::size_type 
    99     PointerMFieldBase::capacity(void) const 
    100 
    101     return _ptrStore.capacity(); 
    102 
    103      
    104 inline PointerMFieldBase::const_reference 
    105     PointerMFieldBase::operator[](UInt32 const index) 
    106 
    107     return _ptrStore[index]; 
    108 
    109  
    110 inline PointerMFieldBase::const_reference 
    111     PointerMFieldBase::at(UInt32 const index) 
    112 
    113     return _ptrStore.at(index); 
    114 
    115      
    116 inline PointerMFieldBase::const_reference 
    117     PointerMFieldBase::front(void) const 
    118 
    119     return _ptrStore.front(); 
    120 
    121  
    122 inline PointerMFieldBase::const_reference 
    123     PointerMFieldBase::back(void) const 
    124 
    125     return _ptrStore.back(); 
    126 
     225PointerMFieldBase::~PointerMFieldBase(void) 
     226
     227
     228 
    127229 
    128230/*-------------------------------------------------------------------------*/ 
    129231/* Raw Store Access                                                        */ 
    130232 
    131 inline PointerMFieldBase::PtrStoreType & 
     233inline  
     234PointerMFieldBase::StorageType & 
    132235    PointerMFieldBase::editRawStore(void) 
    133236{ 
     
    135238} 
    136239 
    137 inline PointerMFieldBase::PtrStoreType const & 
     240inline  
     241PointerMFieldBase::StorageType const & 
    138242    PointerMFieldBase::getRawStore(void) const 
    139243{ 
     
    144248/* Cast Store Access                                                       */ 
    145249 
    146 template <class TargetStoredTypeT> 
    147 inline typename PointerMFieldBase::rebindStore<TargetStoredTypeT>::type & 
     250template <class TargetStoredTypeT> inline  
     251typename PointerMFieldBase::rebindStore<TargetStoredTypeT>::type & 
    148252    PointerMFieldBase::editStore(void) 
    149253{ 
     
    153257} 
    154258 
    155 template <class TargetStoredTypeT> 
    156 inline typename PointerMFieldBase::rebindStore<TargetStoredTypeT>::type const & 
     259template <class TargetStoredTypeT> inline  
     260typename PointerMFieldBase::rebindStore<TargetStoredTypeT>::type const & 
    157261    PointerMFieldBase::getStore(void) const 
    158262{