1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 * You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 // Original author: ekr@rtfm.com 8 9 #ifndef task_utils_h__ 10 #define task_utils_h__ 11 12 13 class gmp_args_base : public GMPTask { 14 public: 15 void Run() = 0; Destroy()16 void Destroy() { 17 delete this; 18 } 19 }; 20 21 // The generated file contains four major function templates 22 // (in variants for arbitrary numbers of arguments up to 10, 23 // which is why it is machine generated). The four templates 24 // are: 25 // 26 // WrapTask(o, m, ...) -- wraps a member function m of an object ptr o 27 // WrapTaskRet(o, m, ..., r) -- wraps a member function m of an object ptr o 28 // the function returns something that can 29 // be assigned to *r 30 // WrapTaskNM(f, ...) -- wraps a function f 31 // WrapTaskNMRet(f, ..., r) -- wraps a function f that returns something 32 // that can be assigned to *r 33 // 34 // All of these template functions return a Task* which can be passed 35 // to Post(). 36 #include "task_utils_generated.h" 37 38 #endif 39