Fawkes API  Fawkes Development Version
metrics.cpp
1 /***************************************************************************
2  * metrics.cpp - Metrics aspect for Fawkes
3  *
4  * Created: Fri Jul 28 20:10:20 2017
5  * Copyright 2006-2017 Tim Niemueller [www.niemueller.de]
6  ****************************************************************************/
7 
8 /* This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version. A runtime exception applies to
12  * this software (see LICENSE.GPL_WRE file mentioned below for details).
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU Library General Public License for more details.
18  *
19  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
20  */
21 
22 #include <plugins/metrics/aspect/metrics.h>
23 
24 namespace fawkes {
25 
26 /** @class MetricsAspect <plugins/metrics/aspect/metrics_supplier.h>
27  * Thread aspect to provide metrics.
28 
29  * @ingroup Aspects
30  * @author Tim Niemueller
31  */
32 
33 /** Constructor.
34  * @param metrics_supplier metrics supplier
35  */
37 {
38  add_aspect("MetricsAspect");
39  metrics_supplier_ = metrics_supplier;
40 }
41 
42 /** Virtual empty destructor. */
44 {
45 }
46 
47 /** Get metrics supplier of this thread.
48  * @return metrics supplier
49  */
51 MetricsAspect::get_metrics_supplier() const
52 {
53  return metrics_supplier_;
54 }
55 
56 } // end namespace fawkes
Fawkes library namespace.
void add_aspect(const char *name)
Add an aspect to a thread.
Definition: aspect.cpp:49
MetricsAspect(MetricsSupplier *metrics_supplier) __attribute__((nonnull))
Constructor.
Definition: metrics.cpp:36
Metrics supplier class.
virtual ~MetricsAspect()
Virtual empty destructor.
Definition: metrics.cpp:43