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

OSGTypedFunctors1.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 OSG_BEGIN_NAMESPACE
00051 
00052 //---------------------------------------------------------------------------
00053 //  TypedFunctor1Base
00054 //---------------------------------------------------------------------------
00055 
00056 
00057 template <class RetT,
00058           class CallArgT,
00059           class SizeTraitsT> inline
00060 TypedFunctor1Base<RetT, 
00061                   CallArgT,
00062                   SizeTraitsT>::TypedFunctor1Base(void) :
00063     Inherited()
00064 {
00065 }
00066 
00067 
00068 template <class RetT,
00069           class CallArgT,
00070           class SizeTraitsT> inline
00071 TypedFunctor1Base<RetT, 
00072                   CallArgT, 
00073                   SizeTraitsT>::TypedFunctor1Base(
00074     const TypedFunctor1Base &source) :
00075 
00076     Inherited(source)
00077 {
00078     Self::postCopyConstruct(source);
00079 }
00080 
00081 
00082 template <class RetT,
00083           class CallArgT,
00084           class SizeTraitsT> inline
00085 TypedFunctor1Base<RetT, 
00086                   CallArgT,
00087                   SizeTraitsT>::~TypedFunctor1Base(void)
00088 {
00089 }
00090 
00091 
00092 #ifdef __sgi
00093 #pragma set woff 1551 
00094 #endif
00095 
00096 #if defined(OSG_WIN32_CL_NET70) 
00097 #pragma warning (disable : 4700)
00098 #endif
00099 
00100 template <class RetT,
00101           class CallArgT,
00102           class SizeTraitsT> inline
00103 RetT TypedFunctor1Base<RetT, 
00104                        CallArgT,
00105                        SizeTraitsT>::call(CallArgType)
00106 {
00107     FWARNING(("TypedFunctor1Base::call called, undefined behaviour "
00108                  "might be the consequence\n"));
00109 
00110     return RetT();
00111 }
00112 
00113 #if defined(OSG_WIN32_CL_NET70) 
00114 #pragma warning (default : 4700)
00115 #endif
00116 
00117 #ifdef __sgi
00118 #pragma reset woff 1551 
00119 #endif
00120 
00121 
00122 template <class RetT,
00123           class CallArgT,
00124           class SizeTraitsT> inline
00125 void TypedFunctor1Base<RetT, 
00126                        CallArgT,
00127                        SizeTraitsT>::operator =(
00128                               const TypedFunctor1Base &source)
00129 {
00130     if (this != &source)
00131     {
00132         *(static_cast<Inherited *>(this)) = source;
00133     }
00134 }
00135 
00136 
00137 
00138 
00139 //---------------------------------------------------------------------------
00140 //  TypedVoidFunctor1Base
00141 //---------------------------------------------------------------------------
00142 
00143 
00144 template <class CallArgT, class SizeTraitsT> inline
00145 TypedVoidFunctor1Base<CallArgT,
00146                       SizeTraitsT>::TypedVoidFunctor1Base(void) :
00147     Inherited()
00148 {
00149 }
00150 
00151 
00152 template <class CallArgT, class SizeTraitsT> inline
00153 TypedVoidFunctor1Base<CallArgT, SizeTraitsT>::TypedVoidFunctor1Base(
00154     const TypedVoidFunctor1Base &source) :
00155 
00156     Inherited(source)
00157 {
00158     Self::postCopyConstruct(source);
00159 }
00160 
00161 
00162 template <class CallArgT, class SizeTraitsT> inline
00163 TypedVoidFunctor1Base<CallArgT, 
00164                       SizeTraitsT>::~TypedVoidFunctor1Base(void)
00165 {
00166 }
00167 
00168 
00169 template <class CallArgT, class SizeTraitsT> inline
00170 void TypedVoidFunctor1Base<CallArgT, 
00171                            SizeTraitsT>::call(CallArgType)
00172 {
00173     FWARNING(("TypedFunctor1Base::call called, undefined behaviour " 
00174                  "might be the consequence\n"));
00175 }
00176 
00177 
00178 template <class CallArgT,
00179           class SizeTraitsT> inline
00180 void TypedVoidFunctor1Base<CallArgT,
00181                            SizeTraitsT>::operator =(
00182                                const TypedVoidFunctor1Base &source)
00183 {
00184     if (this != &source)
00185     {
00186         *(static_cast<Inherited *>(this)) = source;
00187     }
00188 }
00189 
00190 
00191 
00192 
00193 //---------------------------------------------------------------------------
00194 //  TypedFunctionFunctor1
00195 //---------------------------------------------------------------------------
00196 
00197 
00198 template <class RetT, 
00199           class CallArgT, 
00200           class SizeTraitsT> inline
00201 TypedFunctionFunctor1<RetT, 
00202                       CallArgT,
00203                       SizeTraitsT>::TypedFunctionFunctor1(void)  :
00204     Inherited()
00205 {
00206 }
00207 
00208 
00209 template <class RetT, 
00210           class CallArgT, 
00211           class SizeTraitsT> inline
00212 TypedFunctionFunctor1<RetT,
00213                       CallArgT,
00214                       SizeTraitsT>::TypedFunctionFunctor1(
00215     const TypedFunctionFunctor1 &source) : 
00216 
00217     Inherited(source) 
00218 {
00219 }
00220     
00221 
00222 template <class RetT, 
00223           class CallArgT, 
00224           class SizeTraitsT> inline
00225 TypedFunctionFunctor1<RetT,
00226                       CallArgT,
00227                       SizeTraitsT>::~TypedFunctionFunctor1(void) 
00228 {
00229 }
00230 
00231 
00232 #ifdef __sgi
00233 #pragma set woff 1551 
00234 #endif
00235 
00236 template <class RetT, 
00237           class CallArgT, 
00238           class SizeTraitsT> inline
00239 RetT TypedFunctionFunctor1<RetT, 
00240                            CallArgT,
00241                            SizeTraitsT>::call(CallArgType pObj) 
00242 { 
00243     typedef typename Self::FunctionF FuncF;
00244 
00245     if(Self::_flags & Self::FuncPtrValid)
00246     {
00247         FuncF pFunc = *((FuncF *) Self::_data2);
00248         
00249         return pFunc(pObj);
00250     }
00251     else
00252     {
00253         return RetT();
00254     }
00255 }
00256 
00257 #ifdef __sgi
00258 #pragma reset woff 1551 
00259 #endif
00260 
00261 
00262 
00263 
00264 //---------------------------------------------------------------------------
00265 //  TypedFunctionVoidFunctor1
00266 //---------------------------------------------------------------------------
00267 
00268 
00269 template <class CallArgT, 
00270           class SizeTraitsT> inline
00271 TypedFunctionVoidFunctor1<CallArgT,
00272                           SizeTraitsT>::TypedFunctionVoidFunctor1(void)  :
00273     Inherited()
00274 {
00275 }
00276 
00277 
00278 template <class CallArgT, 
00279           class SizeTraitsT> inline
00280 TypedFunctionVoidFunctor1<CallArgT,
00281                           SizeTraitsT>::TypedFunctionVoidFunctor1(
00282                               const TypedFunctionVoidFunctor1 &source) : 
00283 
00284     Inherited(source) 
00285 {
00286 }
00287     
00288 
00289 template <class CallArgT, 
00290           class SizeTraitsT> inline
00291 TypedFunctionVoidFunctor1<CallArgT,
00292                           SizeTraitsT>::~TypedFunctionVoidFunctor1(void) 
00293 {
00294 }
00295 
00296 
00297 template <class CallArgT, 
00298           class SizeTraitsT> inline
00299 void TypedFunctionVoidFunctor1<CallArgT,
00300                                SizeTraitsT>::call(CallArgType pObj) 
00301 { 
00302     typedef typename Self::FunctionF FuncF;
00303 
00304     if(Self::_flags & Self::FuncPtrValid)
00305     {
00306         FuncF pFunc = *((FuncF *) Self::_data2);
00307         
00308         pFunc(pObj);
00309     }
00310 }
00311 
00312 
00313 
00314 
00315 //---------------------------------------------------------------------------
00316 //  TypedObjectFunctor1
00317 //---------------------------------------------------------------------------
00318 
00319 
00320 template <class RetT, 
00321           class CallArgT, 
00322           class SizeTraitsT> inline
00323 TypedObjectFunctor1<RetT, 
00324                     CallArgT,
00325                     SizeTraitsT>::TypedObjectFunctor1(void)  :
00326     Inherited()
00327 {
00328 }
00329 
00330 
00331 template <class RetT, 
00332           class CallArgT, 
00333           class SizeTraitsT> inline
00334 TypedObjectFunctor1<RetT,
00335                     CallArgT,
00336                     SizeTraitsT>::TypedObjectFunctor1(
00337     const TypedObjectFunctor1 &source) : 
00338 
00339     Inherited(source) 
00340 {
00341 }
00342 
00343 
00344 template <class RetT, 
00345           class CallArgT, 
00346           class SizeTraitsT> inline
00347 TypedObjectFunctor1<RetT,
00348                     CallArgT,
00349                     SizeTraitsT>::~TypedObjectFunctor1(void) 
00350 {
00351 }
00352 
00353 
00354 #ifdef __sgi
00355 #pragma set woff 1551 
00356 #endif
00357 
00358 template <class RetT, 
00359           class CallArgT, 
00360           class SizeTraitsT> inline
00361 RetT TypedObjectFunctor1<RetT, 
00362                          CallArgT,
00363                          SizeTraitsT>::call(CallArgType obj) 
00364 { 
00365     if(Self::_flags & Self::FuncPtrValid)
00366     {
00367         return TypeTraits::callObjectMethod(Self::_data2, obj);
00368     }
00369     else
00370     {
00371         return RetT();
00372     }
00373 }
00374 
00375 #ifdef __sgi
00376 #pragma reset woff 1551 
00377 #endif
00378 
00379 
00380 
00381 
00382 //---------------------------------------------------------------------------
00383 //  TypedObjectVoidFunctor1
00384 //---------------------------------------------------------------------------
00385 
00386 
00387 template <class CallArgT, 
00388           class SizeTraitsT> inline
00389 TypedObjectVoidFunctor1<CallArgT,
00390                         SizeTraitsT>::TypedObjectVoidFunctor1(void)  :
00391     Inherited()
00392 {
00393 }
00394 
00395 
00396 template <class CallArgT, 
00397           class SizeTraitsT> inline
00398 TypedObjectVoidFunctor1<CallArgT,
00399                         SizeTraitsT>::TypedObjectVoidFunctor1(
00400     const TypedObjectVoidFunctor1 &source) : 
00401 
00402     Inherited(source) 
00403 {
00404 }
00405     
00406 
00407 template <class CallArgT, 
00408           class SizeTraitsT> inline
00409 TypedObjectVoidFunctor1<CallArgT,
00410                         SizeTraitsT>::~TypedObjectVoidFunctor1(void) 
00411 {
00412 }
00413 
00414 
00415 template <class CallArgT, 
00416           class SizeTraitsT> inline
00417 void TypedObjectVoidFunctor1<CallArgT,
00418                              SizeTraitsT>::call(CallArgType obj) 
00419 { 
00420     if(Self::_flags & Self::FuncPtrValid)
00421     {
00422         TypeTraits::callObjectMethodVoid(Self::_data2, obj);
00423     }
00424 }
00425 
00426 
00427 
00428 
00429 //---------------------------------------------------------------------------
00430 //  TypedStoredObjectFunctor1
00431 //---------------------------------------------------------------------------
00432 
00433 
00434 template <class RetT, 
00435           class StoredObjectT,
00436           class ArgsT, 
00437           class SizeTraitsT> inline
00438 TypedStoredObjectFunctor1<RetT, 
00439                           StoredObjectT,
00440                           ArgsT,
00441                           SizeTraitsT>::TypedStoredObjectFunctor1(void) :
00442     Inherited()
00443 {
00444 }
00445 
00446 
00447 template <class RetT, 
00448           class StoredObjectT,
00449           class ArgsT, 
00450           class SizeTraitsT> inline
00451 TypedStoredObjectFunctor1<RetT,
00452                           StoredObjectT,
00453                           ArgsT,
00454                           SizeTraitsT>::TypedStoredObjectFunctor1(
00455     const TypedStoredObjectFunctor1 &source) : 
00456 
00457     Inherited(source) 
00458 {
00459 }
00460     
00461 
00462 template <class RetT, 
00463           class StoredObjectT,
00464           class ArgsT, 
00465           class SizeTraitsT> inline
00466 TypedStoredObjectFunctor1<RetT,
00467                           StoredObjectT,
00468                           ArgsT,
00469                           SizeTraitsT>::~TypedStoredObjectFunctor1(void) 
00470 {
00471 }
00472 
00473 
00474 #ifdef __sgi
00475 #pragma set woff 1551 
00476 #endif
00477 
00478 template <class RetT, 
00479           class StoredObjectT,
00480           class ArgsT, 
00481           class SizeTraitsT> inline
00482 RetT TypedStoredObjectFunctor1<RetT, 
00483                                StoredObjectT,
00484                                ArgsT,
00485                                SizeTraitsT>::call(CallArgType obj) 
00486 { 
00487     if(Self::_flags & Self::FuncPtrValid &&
00488        Self::_flags & Self::ObjectValid)
00489     {
00490         return TypeTraits::callObjectMethod(Self::_data1, Self::_data2, obj);
00491     }
00492     else
00493     {
00494         return RetT();
00495     }
00496 }
00497 
00498 #ifdef __sgi
00499 #pragma reset woff 1551 
00500 #endif
00501 
00502 
00503 
00504 
00505 //---------------------------------------------------------------------------
00506 //  TypedStoredObjectVoidFunctor1
00507 //---------------------------------------------------------------------------
00508 
00509 
00510 template <class StoredObjectT, 
00511           class ArgsT,
00512           class SizeTraitsT> inline
00513 TypedStoredObjectVoidFunctor1<StoredObjectT,
00514                               ArgsT,
00515                               SizeTraitsT>::TypedStoredObjectVoidFunctor1(
00516                                   void) :
00517     Inherited()
00518 {
00519 }
00520 
00521 
00522 template <class StoredObjectT, 
00523           class ArgsT,
00524           class SizeTraitsT> inline
00525 TypedStoredObjectVoidFunctor1<StoredObjectT,
00526                               ArgsT,
00527                               SizeTraitsT>::TypedStoredObjectVoidFunctor1(
00528     const TypedStoredObjectVoidFunctor1 &source) : 
00529 
00530     Inherited(source) 
00531 {
00532 }
00533 
00534 
00535 template <class StoredObjectT, 
00536           class ArgsT,
00537           class SizeTraitsT> inline
00538 TypedStoredObjectVoidFunctor1<StoredObjectT,
00539                               ArgsT,
00540                               SizeTraitsT>::~TypedStoredObjectVoidFunctor1(
00541     void) 
00542 {
00543 }
00544 
00545 
00546 template <class StoredObjectT, 
00547           class ArgsT,
00548           class SizeTraitsT> inline
00549 void TypedStoredObjectVoidFunctor1<StoredObjectT,
00550                                    ArgsT,
00551                                    SizeTraitsT>::call(CallArgType obj) 
00552 { 
00553     if(Self::_flags & Self::FuncPtrValid &&
00554        Self::_flags & Self::ObjectValid)
00555     {
00556         TypeTraits::callObjectMethodVoid(Self::_data1, Self::_data2, obj);
00557     }
00558 }
00559 
00560 OSG_END_NAMESPACE
00561 
00562 
00563 
00564 
00565 
00566 

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