LogService
libdadi: utility tools for distributed applications
SimpleFilterManager.hh
1 /****************************************************************************/
2 /* The SimpleFilterManager implements the FilterManagerInterface. This */
3 /* Implementation is complete, but it is not very efficient. */
4 /* */
5 /* Author(s): */
6 /* - Georg Hoesch (hoesch@in.tum.de) */
7 /* - Cyrille Pontvieux (cyrille.pontvieux@edu.univ-fcomte.fr) */
8 /* */
9 /* This file is part of DIET . */
10 /* */
11 /* Copyright (C) 2000-2003 ENS Lyon, LIFC, INSA, INRIA and SysFera (2000) */
12 /* */
13 /* - Frederic.Desprez@ens-lyon.fr (Project Manager) */
14 /* - Eddy.Caron@ens-lyon.fr (Technical Manager) */
15 /* - Tech@sysfera.com (Maintainer and Technical Support) */
16 /* */
17 /* This software is a computer program whose purpose is to provide an */
18 /* distributed logging services. */
19 /* */
20 /* */
21 /* This software is governed by the CeCILL license under French law and */
22 /* abiding by the rules of distribution of free software. You can use, */
23 /* modify and/ or redistribute the software under the terms of the CeCILL */
24 /* license as circulated by CEA, CNRS and INRIA at the following URL */
25 /* "http://www.cecill.info". */
26 /* */
27 /* As a counterpart to the access to the source code and rights to copy, */
28 /* modify and redistribute granted by the license, users are provided */
29 /* only with a limited warranty and the software's author, the holder */
30 /* of the economic rights, and the successive licensors have only */
31 /* limited liability. */
32 /* */
33 /* In this respect, the user's attention is drawn to the risks */
34 /* associated with loading, using, modifying and/or developing or */
35 /* reproducing the software by the user in light of its specific status */
36 /* of free software, that may mean that it is complicated to */
37 /* manipulate, and that also therefore means that it is reserved for */
38 /* developers and experienced professionals having in-depth computer */
39 /* knowledge. Users are therefore encouraged to load and test the */
40 /* software's suitability as regards their requirements in conditions */
41 /* enabling the security of their systems and/or data to be ensured and, */
42 /* more generally, to use and operate it in the same conditions as */
43 /* regards security. */
44 /* */
45 /* The fact that you are presently reading this means that you have had */
46 /* knowledge of the CeCILL license and that you accept its terms. */
47 /* */
48 /****************************************************************************/
49 /* $Id$
50  * $Log$
51  * Revision 1.1 2004/01/09 11:07:12 ghoesch
52  * Restructured the whole LogService source tree.
53  * Added autotools make process. Cleaned up code.
54  * Removed some testers. Ready to release.
55  *
56  ***************************************************************************/
57 
58 #ifndef _SIMPLEFILTERMANAGER_HH_
59 #define _SIMPLEFILTERMANAGER_HH_
60 
61 #include "LogTypes.hh"
62 #include "ToolList.hh"
63 #include "ComponentList.hh"
64 #include "FilterManagerInterface.hh"
65 #include "FullLinkedList.hh"
66 
70 struct ConfigElement {
71  CORBA::String_var componentName;
72  tag_list_t config;
73  tag_list_t oldConfig;
74 };
75 
80 
81 
87 public:
98  SimpleFilterManager(ToolList* toolList,
99  ComponentList* compList,
100  tag_list_t* stateTags);
101 
102  virtual
104 
111  void
112  toolConnect(const char* toolName, ToolList::ReadIterator* iter);
113 
122  void
123  toolDisconnect(const char* toolName, ToolList::ReadIterator* iter);
124 
130  void
131  addFilter(const char* toolName, const char* filterName,
132  ToolList::ReadIterator* iter);
133 
140  void
141  removeFilter(const char* toolName, const char* filterName,
142  ToolList::ReadIterator* iter);
143 
150  virtual void
151  flushAllFilters(const char* toolName, ToolList::ReadIterator* iter);
152 
158  tag_list_t*
159  componentConnect(const char* componentName,
161 
168  void
169  componentDisconnect(const char* componentName,
171 
177  void
178  sendMessageWithFilters(log_msg_t* message);
179 
180 private:
181  ToolList* toolList;
182  ComponentList* componentList;
183 
187  ConfigList configList;
188 
192  tag_list_t systemStateTags;
193 
198  bool
199  containsComponent(component_list_t* list, const char* name);
200 
206  bool
207  containsComponentName(component_list_t* list, const char* name);
208 
212  bool
213  containsComponentStar(component_list_t* list);
214 
219  bool
220  containsTag(tag_list_t* list, const char* name);
221 
227  bool
228  containsTagName(tag_list_t* list, const char* name);
229 
233  bool
234  containsTagStar(tag_list_t* list);
235 
241  void
242  addTagList(tag_list_t* destList, tag_list_t* srcList);
243 
248  void
249  addFilter(filter_t* filter);
250 
255  void
256  updateComponentConfigs();
257 };
258 
259 #endif
Definition: FullLinkedList.hh:263
Definition: LogTypes.hh:77
Definition: SimpleFilterManager.hh:86
Definition: LogTypes.hh:221
Definition: FilterManagerInterface.hh:73
Definition: LogTool.hh:73
Definition: SimpleFilterManager.hh:70
Definition: LogTypes.hh:335