changed: gcc8 base update
[opensg.git] / Source / Base / FieldContainer / Fields / MemObjPointerFields / OSGMemObjPointerAccessHandler.h
blob6d775b11a302a25c1e43affa577e242f4fa7a936
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 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGMEMOBJPOINTERACCESSHANDLERDECL_H_
40 #define _OSGMEMOBJPOINTERACCESSHANDLERDECL_H_
42 #ifdef __sgi
43 #pragma once
44 #endif
46 #include "OSGConfig.h"
48 OSG_BEGIN_NAMESPACE
50 // forward declarations
51 class MemObjPointerMFieldBase;
52 class MemObjPointerSFieldBase;
54 /*! \ingroup GrpBaseMemoryObjectsFields
55 \ingroup GrpLibOSGBase
56 \nohierarchy
59 template<typename RefCountPolicyT>
60 class MemObjPointerAccessHandler
62 /*========================== PUBLIC =================================*/
64 public:
66 /*---------------------------------------------------------------------*/
67 /*! \name Public Types */
68 /*! \{ */
70 typedef MemObjPointerAccessHandler Self;
72 typedef RefCountPolicyT RefCountPolicyType;
74 typedef MemObjPointerMFieldBase MFieldBaseType;
75 typedef MemObjPointerSFieldBase SFieldBaseType;
77 /*! \} */
78 /*---------------------------------------------------------------------*/
79 /*! \name Access Handling */
80 /*! \{ */
82 static void onAdd (SFieldBaseType * const pSField,
83 MemoryObject * const pObj );
84 static void onAdd (MFieldBaseType * const pMField,
85 MemoryObject * const pObj );
87 static void onSub (SFieldBaseType * const pSField,
88 MemoryObject * const pObj );
89 static void onSub (MFieldBaseType * const pMField,
90 MemoryObject * const pObj );
92 static void onReplace(SFieldBaseType * const pSField,
93 MemoryObject * const pOldObj,
94 MemoryObject * const pNewObj);
95 static void onReplace(MFieldBaseType * const pMField,
96 MemoryObject * const pOldObj,
97 MemoryObject * const pNewObj);
99 /*! \} */
100 /*---------------------------------------------------------------------*/
101 /*! \name Sync Access Handling */
102 /*! \{ */
104 static void onSyncAdd (SFieldBaseType * const pSField,
105 MemoryObject * const pObj );
106 static void onSyncAdd (MFieldBaseType * const pMField,
107 MemoryObject * const pObj );
109 static void onSyncSub (SFieldBaseType * const pSField,
110 MemoryObject * const pObj );
111 static void onSyncSub (MFieldBaseType * const pMField,
112 MemoryObject * const pObj );
114 static void onSyncReplace(SFieldBaseType * const pSField,
115 MemoryObject * const pOldObj,
116 MemoryObject * const pNewObj);
117 static void onSyncReplace(MFieldBaseType * const pMField,
118 MemoryObject * const pOldObj,
119 MemoryObject * const pNewObj);
121 /*! \} */
122 /*---------------------------------------------------------------------*/
124 template <class ObjectT>
125 static ObjectT *validate(ObjectT * const pObject)
127 return RefCountPolicyType::validate(pObject);
131 OSG_END_NAMESPACE
133 #include "OSGMemObjPointerAccessHandler.inl"
135 #endif // _OSGMEMOBJPOINTERACCESSHANDLER_H_