Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation
qpid/log/Selector.h
Go to the documentation of this file.
00001 #ifndef SELECTOR_H
00002 #define SELECTOR_H
00003 
00004 /*
00005  *
00006  * Copyright (c) 2006 The Apache Software Foundation
00007  *
00008  * Licensed under the Apache License, Version 2.0 (the "License");
00009  * you may not use this file except in compliance with the License.
00010  * You may obtain a copy of the License at
00011  *
00012  *    http://www.apache.org/licenses/LICENSE-2.0
00013  *
00014  * Unless required by applicable law or agreed to in writing, software
00015  * distributed under the License is distributed on an "AS IS" BASIS,
00016  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00017  * See the License for the specific language governing permissions and
00018  * limitations under the License.
00019  *
00020  */
00021 
00022 #include "qpid/log/Statement.h"
00023 #include "qpid/CommonImportExport.h"
00024 #include <vector>
00025 
00026 namespace qpid {
00027 namespace log {
00028 struct Options;
00029 
00035 class Selector {
00036   public:
00038     Selector() {}
00039 
00041     QPID_COMMON_EXTERN Selector(const Options&);
00042 
00044     Selector(Level l, const std::string& s=std::string()) {
00045         enable(l,s);
00046     }
00047 
00048     Selector(const std::string& enableStr) { enable(enableStr); }
00053     void enable(Level level, const std::string& substring=std::string()) {
00054         substrings[level].push_back(substring);
00055     }
00056 
00058     QPID_COMMON_EXTERN void enable(const std::string& enableStr);
00059 
00061     QPID_COMMON_EXTERN bool isEnabled(Level level, const char* function);
00062 
00063   private:
00064     std::vector<std::string> substrings[LevelTraits::COUNT];
00065 };
00066 
00067 
00068 }} // namespace qpid::log
00069 
00070 
00071 #endif  

Qpid C++ API Reference
Generated on Mon Aug 22 2011 for Qpid C++ Client API by doxygen 1.7.4