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 
31 namespace fawkes {
32 class Time;
33 }
34 
36  public fawkes::ClockAspect,
37  public fawkes::LoggingAspect,
40 {
41 public:
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() */
50 protected:
51  virtual void
52  run()
53  {
54  Thread::run();
55  }
56 
57 private:
58  fawkes::Time *last_sent_;
59  unsigned int counter_;
60 };
61 
62 #endif
GossipExampleSenderThread::~GossipExampleSenderThread
virtual ~GossipExampleSenderThread()
Destructor.
Definition: gex_sender_thread.cpp:44
GossipExampleSenderThread::loop
virtual void loop()
Code to execute in the thread.
Definition: gex_sender_thread.cpp:62
fawkes::GossipAspect
Thread aspect to communicate with a group of robots.
Definition: gossip.h:38
GossipExampleSenderThread::init
virtual void init()
Initialize the thread.
Definition: gex_sender_thread.cpp:49
GossipExampleSenderThread::GossipExampleSenderThread
GossipExampleSenderThread()
Constructor.
Definition: gex_sender_thread.cpp:36
GossipExampleSenderThread::finalize
virtual void finalize()
Finalize the thread.
Definition: gex_sender_thread.cpp:56
fawkes::BlockedTimingAspect
Thread aspect to use blocked timing.
Definition: blocked_timing.h:51
GossipExampleSenderThread
Gossip Example Plugin Thread - Sender.
Definition: gex_sender_thread.h:40
fawkes
Fawkes library namespace.
fawkes::LoggingAspect
Thread aspect to log output.
Definition: logging.h:33
GossipExampleSenderThread::run
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition: gex_sender_thread.h:52
fawkes::Time
A class for handling time.
Definition: time.h:93
fawkes::Thread
Thread class encapsulation of pthreads.
Definition: thread.h:46
fawkes::ClockAspect
Thread aspect that allows to obtain the current time from the clock.
Definition: clock.h:34