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 <plugins/gossip/aspect/gossip.h>
26 
27 #include <core/threading/thread.h>
28 #include <aspect/clock.h>
29 #include <aspect/logging.h>
30 #include <aspect/blocked_timing.h>
31 
32 namespace fawkes {
33  class Time;
34 }
35 
37 : public fawkes::Thread,
38  public fawkes::ClockAspect,
39  public fawkes::LoggingAspect,
42 {
43  public:
45  virtual ~GossipExampleSenderThread();
46 
47  virtual void init();
48  virtual void loop();
49  virtual void finalize();
50 
51  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
52  protected: virtual void run() { Thread::run(); }
53 
54  private:
55  fawkes::Time *last_sent_;
56  unsigned int counter_;
57 };
58 
59 #endif
Thread aspect that allows to obtain the current time from the clock.
Definition: clock.h:36
Gossip Example Plugin Thread - Sender.
Fawkes library namespace.
virtual void run()
Code to execute in the thread.
Definition: thread.cpp:939
A class for handling time.
Definition: time.h:91
Thread class encapsulation of pthreads.
Definition: thread.h:42
Thread aspect to communicate with a group of robots.
Definition: gossip.h:39
Thread aspect to use blocked timing.
Thread aspect to log output.
Definition: logging.h:35
virtual void run()
Stub to see name in backtrace for easier debugging.