Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation
Selector.h
Go to the documentation of this file.
1 #ifndef SELECTOR_H
2 #define SELECTOR_H
3 
4 /*
5  *
6  * Copyright (c) 2006 The Apache Software Foundation
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21 
22 #include "qpid/log/Statement.h"
24 #include <vector>
25 
26 namespace qpid {
27 namespace log {
28 struct Options;
29 
35  QPID_COMMON_EXTERN SelectorElement(const std::string cliEntry);
36  std::string levelStr;
37  std::string patternStr;
40  bool isDisable;
41  bool isCategory;
44 };
45 
51 class Selector {
52  public:
55 
58 
60  QPID_COMMON_EXTERN Selector(Level l, const std::string& s=std::string());
61 
63  QPID_COMMON_EXTERN Selector(const std::string& selector);
64 
66  QPID_COMMON_EXTERN void enable(const std::string& enableStr);
67  QPID_COMMON_EXTERN void disable(const std::string& disableStr);
68 
73  QPID_COMMON_EXTERN void enable(Level level, const std::string& substring=std::string());
74  QPID_COMMON_EXTERN void disable(Level level, const std::string& substring=std::string());
75 
77  QPID_COMMON_EXTERN bool isEnabled(Level level, const char* function);
78  QPID_COMMON_EXTERN bool isDisabled(Level level, const char* function);
79 
81  QPID_COMMON_EXTERN bool isEnabled(Level level, const char* function, Category category);
82 
83  private:
84  typedef std::vector<std::string> FunctionNameTable [LevelTraits::COUNT];
85  FunctionNameTable enabledFunctions; // log function names explicitly enabled
86  FunctionNameTable disabledFunctions; // log function names explicitly disabled
87  bool enableFlags[LevelTraits::COUNT][CategoryTraits::COUNT];
88  bool disableFlags[LevelTraits::COUNT][CategoryTraits::COUNT];
89 
90  bool lookupFuncName(Level level, const char* function, FunctionNameTable& table);
92  QPID_COMMON_EXTERN void reset();
93 };
94 
95 
96 }} // namespace qpid::log
97 
98 
99 #endif

Qpid C++ API Reference
Generated on Thu Jun 5 2014 for Qpid C++ Client API by doxygen 1.8.3.1