Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OSGTypedFunctorBase.inl

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *             Copyright (C) 2002 by the OpenSG Forum                        *
00006  *                                                                           *
00007  *                            www.opensg.org                                 *
00008  *                                                                           *
00009  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00010  *                                                                           *
00011 \*---------------------------------------------------------------------------*/
00012 /*---------------------------------------------------------------------------*\
00013  *                                License                                    *
00014  *                                                                           *
00015  * This library is free software; you can redistribute it and/or modify it   *
00016  * under the terms of the GNU Library General Public License as published    *
00017  * by the Free Software Foundation, version 2.                               *
00018  *                                                                           *
00019  * This library is distributed in the hope that it will be useful, but       *
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00022  * Library General Public License for more details.                          *
00023  *                                                                           *
00024  * You should have received a copy of the GNU Library General Public         *
00025  * License along with this library; if not, write to the Free Software       *
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00027  *                                                                           *
00028 \*---------------------------------------------------------------------------*/
00029 /*---------------------------------------------------------------------------*\
00030  *                                Changes                                    *
00031  *                                                                           *
00032  *                                                                           *
00033  *                                                                           *
00034  *                                                                           *
00035  *                                                                           *
00036  *                                                                           *
00037 \*---------------------------------------------------------------------------*/
00038 
00039 //---------------------------------------------------------------------------
00040 //  Includes
00041 //---------------------------------------------------------------------------
00042 
00043 #include <stdlib.h>
00044 #include <stdio.h>
00045 
00046 #include "OSGConfig.h"
00047 
00048 #include <iostream>
00049 
00050 #include <OSGLog.h>
00051 
00052 OSG_BEGIN_NAMESPACE
00053 
00054 //---------------------------------------------------------------------------
00055 //  TypedFunctorBase
00056 //---------------------------------------------------------------------------
00057 
00058 
00059 template <class SizeTraitsT> inline
00060 TypedFunctorBase<SizeTraitsT>::TypedFunctorBase(void) :
00061     Inherited()
00062 {
00063 }
00064 
00065 
00066 template <class SizeTraitsT> inline
00067 TypedFunctorBase<SizeTraitsT>::TypedFunctorBase(
00068     const TypedFunctorBase &source) :
00069 
00070     Inherited(source)
00071 {
00072 }
00073 
00074 
00075 template <class SizeTraitsT> inline
00076 TypedFunctorBase<SizeTraitsT>::~TypedFunctorBase(void)
00077 {
00078 }
00079 
00080 
00081 template <class SizeTraitsT> inline
00082 void TypedFunctorBase<SizeTraitsT>::operator =(const TypedFunctorBase &source)
00083 {
00084     if(this != &source)
00085     {
00086         memcpy(this, &source, 
00087                sizeof(TypedFunctorBase<SizeTraitsT>)); 
00088     }
00089 }
00090 
00091 
00092 template <class SizeTraitsT> inline
00093 void TypedFunctorBase<SizeTraitsT>::postCopyConstruct(
00094     const TypedFunctorBase &source)
00095 {
00096     memcpy(this, &source, 
00097            sizeof(TypedFunctorBase<SizeTraitsT>)); 
00098 }
00099 
00100 
00101 
00102 
00103 //---------------------------------------------------------------------------
00104 //  TypedFunctionFunctorBase
00105 //---------------------------------------------------------------------------
00106 
00107 
00108 template <class Parent, class Params> inline
00109 TypedFunctionFunctorBase<Parent, Params>::TypedFunctionFunctorBase(void)  :
00110     Inherited()
00111 {
00112 }
00113 
00114 
00115 template <class Parent, class Params> inline
00116 TypedFunctionFunctorBase<Parent, Params>::TypedFunctionFunctorBase(
00117     const TypedFunctionFunctorBase &source) : 
00118 
00119     Inherited(source) 
00120 {
00121 }
00122     
00123 
00124 template <class Parent, class Params> inline
00125 TypedFunctionFunctorBase<Parent, Params>::~TypedFunctionFunctorBase(void) 
00126 {
00127 }
00128 
00129 
00130 template <class Parent, class Params> inline
00131 void TypedFunctionFunctorBase<Parent, Params>::setMethod(FunctionF pFunc)
00132 {
00133     Self::_flags |=  Self::FuncPtrValid;
00134 
00135     *((FunctionF *) Self::_data2) = pFunc; 
00136 }
00137 
00138 
00139 
00140 
00141 //---------------------------------------------------------------------------
00142 //  TypedObjectFunctorBase
00143 //---------------------------------------------------------------------------
00144 
00145 
00146 template <class Parent, class Params> inline
00147 TypedObjectFunctorBase<Parent, Params>::TypedObjectFunctorBase(void)  :
00148     Inherited()
00149 {
00150 }
00151 
00152 
00153 template <class Parent, class Params> inline
00154 TypedObjectFunctorBase<Parent, Params>::TypedObjectFunctorBase(
00155     const TypedObjectFunctorBase &source) : 
00156 
00157     Inherited(source) 
00158 {
00159 }
00160     
00161 
00162 template <class Parent, class Params> inline
00163 TypedObjectFunctorBase<Parent, Params>::~TypedObjectFunctorBase(void) 
00164 {
00165 }
00166 
00167 
00168 template <class Parent, class Params> inline
00169 void TypedObjectFunctorBase<Parent, Params>::setMethod(ObjMethodF pFunc)
00170 {
00171     Self::_flags |=  Self::FuncPtrValid;
00172 
00173     *((ObjMethodF *) Self::_data2) = pFunc; 
00174 }
00175 
00176 
00177 
00178 
00179 //---------------------------------------------------------------------------
00180 //  TypedStoredObjectFunctorBase
00181 //---------------------------------------------------------------------------
00182 
00183 
00184 template <class Parent, class Params> inline
00185 TypedStoredObjectFunctorBase<Parent, Params>::TypedStoredObjectFunctorBase(
00186     void) :
00187 
00188     Inherited()
00189 {
00190 }
00191 
00192 
00193 template <class Parent, class Params> inline
00194 TypedStoredObjectFunctorBase<Parent, Params>::TypedStoredObjectFunctorBase(
00195     const TypedStoredObjectFunctorBase &source) : 
00196 
00197     Inherited(source) 
00198 {
00199 }
00200     
00201 
00202 template <class Parent, class Params> inline
00203 TypedStoredObjectFunctorBase<Parent, Params>::~TypedStoredObjectFunctorBase(
00204                                    void) 
00205 {
00206 }
00207 
00208 
00209 template <class Parent, class Params> inline
00210 void TypedStoredObjectFunctorBase<Parent, Params>::setMethod(ObjMethodF pFunc)
00211 {
00212     Self::_flags |=  Self::FuncPtrValid;
00213 
00214     *((ObjMethodF *) Self::_data2) = pFunc; 
00215 }
00216 
00217 
00218 template <class Parent, class Params> inline
00219 void TypedStoredObjectFunctorBase<Parent, Params>::setCalledObject(
00220     SetObjectT pObj)
00221 {
00222     Self::_flags |= Self::ObjectValid;
00223 
00224     Params::setCalledObject(reinterpret_cast<Char8 *>(Self::_data1), pObj);
00225 }
00226 
00227 
00228 template <class Parent, class Params> inline
00229 void TypedStoredObjectFunctorBase<Parent, Params>::setObjectAndMethod(
00230     SetObjectT pObj, 
00231     ObjMethodF pFunc)
00232 {
00233     Self::_flags |=  Self::FuncPtrValid;
00234     Self::_flags |=  Self::ObjectValid;
00235      
00236     Params::setCalledObject(reinterpret_cast<Char8 *>(Self::_data1), pObj);
00237 
00238     *((ObjMethodF *) Self::_data2) = pFunc; 
00239 }
00240 
00241 OSG_END_NAMESPACE
00242 

Generated on Thu Aug 25 04:11:55 2005 for OpenSG by  doxygen 1.4.3