Fawkes API Fawkes Development Version
gex_sender_thread.h
1
2/***************************************************************************
3 * gex_sender_thread.h - Gossip Example Plugin - Sender
4 *
5 * Created: Wed Mar 05 14:27:35 2014
6 * Copyright 2006-2014 Tim Niemueller [www.niemueller.de]
7 ****************************************************************************/
8
9/* This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
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 file in the doc directory.
20 */
21
22#ifndef _PLUGINS_GOSSIP_EXAMPLE_GEX_SENDER_THREAD_H_
23#define _PLUGINS_GOSSIP_EXAMPLE_GEX_SENDER_THREAD_H_
24
25#include <aspect/blocked_timing.h>
26#include <aspect/clock.h>
27#include <aspect/logging.h>
28#include <core/threading/thread.h>
29#include <plugins/gossip/aspect/gossip.h>
30
31namespace fawkes {
32class Time;
33}
34
40{
41public:
44
45 virtual void init();
46 virtual void loop();
47 virtual void finalize();
48
49 /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
50protected:
51 virtual void
53 {
54 Thread::run();
55 }
56
57private:
58 fawkes::Time *last_sent_;
59 unsigned int counter_;
60};
61
62#endif
Gossip Example Plugin Thread - Sender.
virtual void loop()
Code to execute in the thread.
virtual void finalize()
Finalize the thread.
virtual void run()
Stub to see name in backtrace for easier debugging.
virtual void init()
Initialize the thread.
virtual ~GossipExampleSenderThread()
Destructor.
GossipExampleSenderThread()
Constructor.
Thread aspect to use blocked timing.
Thread aspect that allows to obtain the current time from the clock.
Definition: clock.h:34
Thread aspect to communicate with a group of robots.
Definition: gossip.h:38
Thread aspect to log output.
Definition: logging.h:33
Thread class encapsulation of pthreads.
Definition: thread.h:46
A class for handling time.
Definition: time.h:93
Fawkes library namespace.