00001 // OSB library ********************************************* -*- C++ -*- 00014 /* 00015 AUTHOR(S): Huang Yong Feng (hyf) 00016 00017 RCS information 00018 $Name: OSB_060808 $ 00019 $Revision: 1.13 $ 00020 00021 License 00022 OSB rating and billing library for communication networks 00023 Copyright (C) 2004, 2005, 2006 OSB systems 00024 00025 This file may be distributed and/or modify under the terms of the 00026 GNU General Public License (GPL) as published by the Free Software 00027 Foundation which is provided in the file LICENSE.GPL included in the 00028 packaging of this file. 00029 00030 The file is distributed in the hope that it will be useful, but WITHOUT 00031 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00032 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00033 for more details. 00034 00035 Holders of a OSB Commercial License may use this file under the terms 00036 and conditions of this commercial license. 00037 */ 00038 00039 #ifndef _NETWORKADMIN_SERVER_H_ 00040 #define _NETWORKADMIN_SERVER_H_ 00041 00042 // ********************************************************************* 00043 // included header files 00044 // + standard includes 00045 // + libraries and external header files 00046 // + local headers 00047 00048 namespace OSB_DB { 00049 class Session; 00050 } 00051 00052 namespace OSB_LIB { 00053 class Mutex; 00054 class OsbException; 00055 } 00056 00057 // ********************************************************************* 00058 // class SessionGuard 00059 class SessionGuard { 00060 static OSB_LIB::Mutex mutex_; 00061 public: 00062 SessionGuard(bool noWait); 00063 ~SessionGuard(); 00064 OSB_DB::Session& get(); 00065 00066 private: 00067 SessionGuard(const SessionGuard&); // copy c'tor: not implemented. 00068 OSB_DB::Session* pSession_; 00069 }; 00070 #endif // #ifndef _NETWORKADMIN_SERVER_H_