Go to the documentation of this file.00001 #ifndef SELECTOR_H
00002 #define SELECTOR_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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 }}
00069
00070
00071 #endif