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 class Selector {
36  public:
39  reset();
40  }
41 
44 
46  Selector(Level l, const std::string& s=std::string()) {
47  reset();
48  enable(l,s);
49  }
50 
51  Selector(const std::string& enableStr) {
52  reset();
53  enable(enableStr);
54  }
55 
60  void enable(Level level, const std::string& substring=std::string()) {
61  substrings[level].push_back(substring);
62  }
63 
67  void enable(Level level, Category category) {
68  catFlags[level][category] = true;
69  }
70 
72  QPID_COMMON_EXTERN void enable(const std::string& enableStr);
73 
75  QPID_COMMON_EXTERN bool isEnabled(Level level, const char* function);
76  QPID_COMMON_EXTERN bool isEnabled(Level level, const char* function, Category category);
77 
80  for (int lt = 0; lt < LevelTraits::COUNT; ++lt)
81  for (int ct = 0; ct < CategoryTraits::COUNT; ++ct)
82  catFlags[lt][ct] = false;
83  }
84 
85  private:
86  std::vector<std::string> substrings[LevelTraits::COUNT];
88 };
89 
90 
91 }} // namespace qpid::log
92 
93 
94 #endif

Qpid C++ API Reference
Generated on Mon Jul 15 2013 for Qpid C++ Client API by doxygen 1.8.3.1