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
clock.cpp
1
2
/***************************************************************************
3
* clock.cpp - Clock aspect for Fawkes
4
*
5
* Created: Tue Jun 12 22:30:33 2007
6
* Copyright 2007 Daniel Beck
7
* 2007-2010 Tim Niemueller [www.niemueller.de]
8
*
9
****************************************************************************/
10
11
/* This program is free software; you can redistribute it and/or modify
12
* it under the terms of the GNU General Public License as published by
13
* the Free Software Foundation; either version 2 of the License, or
14
* (at your option) any later version. A runtime exception applies to
15
* this software (see LICENSE.GPL_WRE file mentioned below for details).
16
*
17
* This program is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
* GNU Library General Public License for more details.
21
*
22
* Read the full text in the LICENSE.GPL_WRE file in the doc directory.
23
*/
24
25
#include <aspect/clock.h>
26
27
namespace
fawkes {
28
#if 0
/* just to make Emacs auto-indent happy */
29
}
30
#endif
31
32
/** @class ClockAspect <aspect/clock.h>
33
* Thread aspect that allows to obtain the current time from the clock.
34
* Threads that need to deal with the current time should have this aspect
35
* and not obtain the time by means of gettimeofday!
36
*
37
* @ingroup Aspects
38
* @author Daniel Beck
39
*/
40
41
42
/** @var Clock ClockAspect::clock
43
* By means of this member access to the clock is given.
44
*/
45
46
/** Constructor. */
47
ClockAspect::ClockAspect()
48
{
49
add_aspect(
"ClockAspect"
);
50
}
51
52
/** Virtual empty destructor. */
53
ClockAspect::~ClockAspect()
54
{
55
}
56
57
58
/** Set the clock.
59
* It is guaranteed that this is called for a clock thread before
60
* Thread::start() is called (when running regularly inside Fawkes).
61
* @param clock Clock instance to use.
62
*/
63
void
64
ClockAspect::init_ClockAspect(
Clock
*clock)
65
{
66
this->clock = clock;
67
}
68
69
}
// end namespace fawkes
fawkes::Clock
This is supposed to be the central clock in Fawkes.
Definition:
clock.h:34
src
libs
aspect
clock.cpp
Generated by
1.8.7