|
reSIProcate/rutil
9694
|
00001 #if !defined(RESIP_SUBSYSTEM_HXX) 00002 #define RESIP_SUBSYSTEM_HXX 00003 00004 #include <iostream> 00005 #include "rutil/Data.hxx" 00006 #include "rutil/Log.hxx" 00007 00008 namespace resip 00009 { 00010 00033 class Subsystem 00034 { 00035 public: 00036 // Add new systems below 00037 static Subsystem APP; 00038 static Subsystem CONTENTS; 00039 static Subsystem DNS; 00040 static Subsystem DUM; 00041 static Subsystem NONE; // default subsystem 00042 static Subsystem PRESENCE; 00043 static Subsystem SDP; 00044 static Subsystem SIP; // SIP Stack / Parser 00045 static Subsystem TEST; 00046 static Subsystem TRANSACTION; 00047 static Subsystem TRANSPORT; 00048 static Subsystem STATS; 00049 static Subsystem REPRO; 00050 00051 const Data& getSubsystem() const; 00052 Log::Level getLevel() const { return mLevel; } 00053 void setLevel(Log::Level level) { mLevel = level; } 00054 protected: 00055 explicit Subsystem(const char* rhs) : mSubsystem(rhs), mLevel(Log::None) {}; 00056 explicit Subsystem(const Data& rhs) : mSubsystem(rhs), mLevel(Log::None) {}; 00057 Subsystem& operator=(const Data& rhs); 00058 00059 Data mSubsystem; 00060 Log::Level mLevel; 00061 00062 friend EncodeStream& operator<<(EncodeStream& strm, const Subsystem& ss); 00063 }; 00064 00065 00066 // in order to have subsystems in your application, subclass from this class 00067 /* 00068 #include "rutil/Data.hxx" 00069 #include "rutil/Subsystem.hxx" 00070 00071 namespace MyNamespace 00072 { 00073 00074 class Subsystem : public resip::Subsystem 00075 { 00076 public: 00077 // Add new systems below 00078 static const Subsystem SPECIAL_SUBSYSTEM; 00079 00080 private: 00081 explicit Subsystem(const char* rhs) : resip::Subsystem(rhs) {}; 00082 explicit Subsystem(const resip::Data& rhs); 00083 Subsystem& operator=(const resip::Data& rhs); 00084 }; 00085 00086 } 00087 */ 00088 00089 } 00090 00091 #endif 00092 00093 /* ==================================================================== 00094 * The Vovida Software License, Version 1.0 00095 * 00096 * Copyright (c) 2000-2005 00097 * 00098 * Redistribution and use in source and binary forms, with or without 00099 * modification, are permitted provided that the following conditions 00100 * are met: 00101 * 00102 * 1. Redistributions of source code must retain the above copyright 00103 * notice, this list of conditions and the following disclaimer. 00104 * 00105 * 2. Redistributions in binary form must reproduce the above copyright 00106 * notice, this list of conditions and the following disclaimer in 00107 * the documentation and/or other materials provided with the 00108 * distribution. 00109 * 00110 * 3. The names "VOCAL", "Vovida Open Communication Application Library", 00111 * and "Vovida Open Communication Application Library (VOCAL)" must 00112 * not be used to endorse or promote products derived from this 00113 * software without prior written permission. For written 00114 * permission, please contact vocal@vovida.org. 00115 * 00116 * 4. Products derived from this software may not be called "VOCAL", nor 00117 * may "VOCAL" appear in their name, without prior written 00118 * permission of Vovida Networks, Inc. 00119 * 00120 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED 00121 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00122 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND 00123 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA 00124 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES 00125 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL, 00126 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00127 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00128 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 00129 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00130 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 00131 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 00132 * DAMAGE. 00133 * 00134 * ==================================================================== 00135 * 00136 * This software consists of voluntary contributions made by Vovida 00137 * Networks, Inc. and many individuals on behalf of Vovida Networks, 00138 * Inc. For more information on Vovida Networks, Inc., please see 00139 * <http://www.vovida.org/>. 00140 * 00141 */
1.7.5.1