• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

sst/elements/genericProc/FE/ppcFrontEnd/SCall.h

00001 // Copyright 2007 Sandia Corporation. Under the terms
00002 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
00003 // Government retains certain rights in this software.
00004 // 
00005 // Copyright (c) 2005-2007, Sandia Corporation
00006 // All rights reserved.
00007 // Copyright (c) 2003-2005, University of Notre Dame
00008 // All rights reserved.
00009 // 
00010 // This file is part of the SST software package. For license
00011 // information, see the LICENSE file in the top level directory of the
00012 // distribution.
00013 
00014 
00015 #ifndef SCALL_H
00016 #define SCALL_H
00017 
00018 //:System Caller
00019 //
00020 // Several specialized template functions called 'SCall' assist in
00021 // calling common system calls in the ppc front end. They generally
00022 // take a function pointer and list of arguments, and then call the
00023 // function.
00024 //
00025 //!SEC:ppcFront
00026 template <class T, class S, int N>
00027 struct SCall {
00028   int doIt(T func, S a, int b=0, int c=0, int d=0);
00029 };
00030 
00031 //!IGNORE:
00032 template <class T, class S>
00033 struct SCall<T,S,-1> {
00034   int doIt(T func, S a, int b=0, int c=0, int d=0) {
00035     return func();
00036   }
00037 };
00038 
00039 //!IGNORE:
00040 template <class T, class S>
00041 struct SCall<T,S,0> {
00042   int doIt(T func, S a, int b=0, int c=0, int d=0) {
00043     return func(a);
00044   }
00045 };
00046 
00047 //!IGNORE:
00048 template <class T, class S>
00049 struct SCall<T,S,1> {
00050   int doIt(T func, S a, int b=0, int c=0, int d=0) {
00051     return func(a, b);
00052   }
00053 };
00054 
00055 //!IGNORE:
00056 template <class T, class S>
00057 struct SCall<T,S,2> {
00058   int doIt(T func, S a, int b=0, int c=0, int d=0) {
00059     return func(a, b, c);
00060   }
00061 };
00062 
00063 #endif

Generated on Fri Oct 22 2010 11:02:22 for SST by  doxygen 1.7.1