filter factory in working shape, see example in test_filer_factory.cpp
[metaproxy-moved-to-github.git] / src / filter_log.hpp
1 /* $Id: filter_log.hpp,v 1.8 2005-10-29 22:23:36 marc Exp $
2    Copyright (c) 2005, Index Data.
3
4 %LICENSE%
5  */
6
7 #ifndef FILTER_LOG_HPP
8 #define FILTER_LOG_HPP
9
10 #include <stdexcept>
11 #include <vector>
12
13 #include "filter.hpp"
14
15 #include <boost/thread/mutex.hpp>
16
17
18 namespace yp2 {
19     namespace filter {
20         class Log : public Base {
21         public:
22             Log(const std::string &msg);
23             Log();
24             void process(yp2::Package & package) const;
25             const std::string type() const {
26                 return "Log";
27             };
28         private:
29             /// static mutex to lock Ostream during logging operation
30             static boost::mutex m_log_mutex;
31             std::string m_msg;
32         };
33     }
34 }
35
36 #endif
37 /*
38  * Local variables:
39  * c-basic-offset: 4
40  * indent-tabs-mode: nil
41  * c-file-style: "stroustrup"
42  * End:
43  * vim: shiftwidth=4 tabstop=8 expandtab
44  */