00001 /* 00002 NetLink Sockets: Networking C++ library 00003 Copyright 2012 Pedro Francisco Pareja Ruiz (PedroPareja@Gmail.com) 00004 00005 This file is part of NetLink Sockets. 00006 00007 NetLink Sockets is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation, either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 NetLink Sockets is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with NetLink Sockets. If not, see <http://www.gnu.org/licenses/>. 00019 00020 */ 00021 00022 #ifndef __NL_RM 00023 #define __NL_RM 00024 00025 #include <netlink/core.h> 00026 00027 #include <vector> 00028 00029 NL_NAMESPACE 00030 00031 using std::vector; 00032 00041 template<typename T> 00042 class ReleaseManager { 00043 00044 protected: 00045 00046 vector<T**> _releaseQueue; 00047 void (*_releaseFunction) (T*); 00048 00049 public: 00050 00051 ReleaseManager(void (*releaseFunction)(T*) = NULL); 00052 virtual ~ReleaseManager(); 00053 00054 void add(T** var); 00055 }; 00056 00057 00058 #include "netlink/release_manager.inline.h" 00059 00060 NL_NAMESPACE_END 00061 00062 #endif
1.7.3