Fawkes API
Fawkes Development Version
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
rrd_inifin.cpp
1
2
/***************************************************************************
3
* rrd_inifin.cpp - Fawkes RRDAspect initializer/finalizer
4
*
5
* Created: Mon Dec 06 22:33:03 2010
6
* Copyright 2006-2010 Tim Niemueller [www.niemueller.de]
7
*
8
****************************************************************************/
9
10
/* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version. A runtime exception applies to
14
* this software (see LICENSE.GPL_WRE file mentioned below for details).
15
*
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU Library General Public License for more details.
20
*
21
* Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22
*/
23
24
#include <plugins/rrd/aspect/rrd_inifin.h>
25
#include <plugins/rrd/aspect/rrd.h>
26
#include <plugins/rrd/aspect/rrd_manager.h>
27
#include <core/threading/thread_finalizer.h>
28
29
namespace
fawkes {
30
#if 0
/* just to make Emacs auto-indent happy */
31
}
32
#endif
33
34
/** @class RRDAspectIniFin <plugins/rrd/aspect/rrd_inifin.h>
35
* RRDAspect initializer/finalizer.
36
* This initializer/finalizer will provide the RRDManager to threads with
37
* the RRDAspect.
38
* @author Tim Niemueller
39
*/
40
41
/** Constructor.
42
* @param rrd_manager RRD manager to pass on to threads
43
*/
44
RRDAspectIniFin::RRDAspectIniFin(
RRDManager
*rrd_manager)
45
:
AspectIniFin
(
"RRDAspect"
)
46
{
47
__rrd_manager = rrd_manager;
48
}
49
50
void
51
RRDAspectIniFin::init
(
Thread
*thread)
52
{
53
RRDAspect
*rrd_thread;
54
rrd_thread =
dynamic_cast<
RRDAspect
*
>
(thread);
55
if
(rrd_thread == NULL) {
56
throw
CannotInitializeThreadException
(
"Thread '%s' claims to have the "
57
"RRDAspect, but RTTI says it "
58
"has not. "
, thread->
name
());
59
}
60
61
rrd_thread->init_RRDAspect(__rrd_manager);
62
}
63
64
void
65
RRDAspectIniFin::finalize
(
Thread
*thread)
66
{
67
}
68
69
70
71
}
// end namespace fawkes
src
plugins
rrd
aspect
rrd_inifin.cpp
Generated by
1.8.3.1