Home | History | Annotate | Download | only in base
      1 $$ This is a pump file for generating file templates.  Pump is a python
      2 $$ script that is part of the Google Test suite of utilities.  Description
      3 $$ can be found here:
      4 $$
      5 $$ http://code.google.com/p/googletest/wiki/PumpManual
      6 $$
      7 
      8 $var MAX_ARITY = 6
      9 
     10 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
     11 // Use of this source code is governed by a BSD-style license that can be
     12 // found in the LICENSE file.
     13 
     14 // Specializations of FunctionTraits<> for Windows specific calling
     15 // conventions.  Please see base/bind_internal.h for more info.
     16 
     17 #ifndef BASE_BIND_INTERNAL_WIN_H_
     18 #define BASE_BIND_INTERNAL_WIN_H_
     19 #pragma once
     20 
     21 namespace base {
     22 namespace internal {
     23 
     24 template <typename Sig>
     25 struct FunctionTraits;
     26 
     27 $range ARITY 0..MAX_ARITY
     28 $for ARITY [[
     29 $range ARG 1..ARITY
     30 
     31 // __stdcall Function: Arity $(ARITY).
     32 template <typename R[[]]
     33 $if ARITY > 0[[, ]] $for ARG , [[typename X$(ARG)]]>
     34 struct FunctionTraits<R(__stdcall *)($for ARG , [[X$(ARG)]])> {
     35   typedef R (*NormalizedSig)($for ARG , [[X$(ARG)]]);
     36   typedef false_type IsMethod;
     37 
     38 $if ARITY > 0 [[
     39 
     40   // Target type for each bound parameter.
     41 
     42 $for ARG [[
     43   typedef X$(ARG) B$(ARG);
     44 
     45 ]]  $$ for ARG
     46 ]]  $$ if ARITY > 0
     47 };
     48 
     49 // __fastcall Function: Arity $(ARITY).
     50 template <typename R[[]]
     51 $if ARITY > 0[[, ]] $for ARG , [[typename X$(ARG)]]>
     52 struct FunctionTraits<R(__fastcall *)($for ARG , [[X$(ARG)]])> {
     53   typedef R (*NormalizedSig)($for ARG , [[X$(ARG)]]);
     54   typedef false_type IsMethod;
     55 
     56 $if ARITY > 0 [[
     57 
     58   // Target type for each bound parameter.
     59 
     60 $for ARG [[
     61   typedef X$(ARG) B$(ARG);
     62 
     63 ]]  $$ for ARG
     64 ]]  $$ if ARITY > 0
     65 };
     66 
     67 ]]  $$for ARITY
     68 
     69 }  // namespace internal
     70 }  // namespace base
     71 
     72 #endif  // BASE_BIND_INTERNAL_WIN_H_
     73