Fawkes API  Fawkes Development Version
f2p_thread.cpp
00001 
00002 /***************************************************************************
00003  *  f2p_thread.cpp - Thread that calls mappers to sync Fawkes to Player
00004  *
00005  *  Created: Tue Sep 30 13:13:50 2008
00006  *  Copyright  2006-2008  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU Library General Public License for more details.
00019  *
00020  *  Read the full text in the LICENSE.GPL file in the doc directory.
00021  */
00022 
00023 #include "f2p_thread.h"
00024 #include "playerc_thread.h"
00025 
00026 using namespace fawkes;
00027 
00028 /** @class PlayerF2PThread "playerc_thread.h"
00029  * Player Fawkes-To-Player Thread.
00030  * This thread is called in the ACT_EXEC hook to post any outstanding
00031  * Fawkes interface data to the Player proxies via mappers.
00032  * @author Tim Niemueller
00033  */
00034 
00035 
00036 /** Constructor.
00037  * @param client_thread PlayerClientThread to use for syncing Fawkes interfaces
00038  * to Player proxies.
00039  */
00040 PlayerF2PThread::PlayerF2PThread(PlayerClientThread *client_thread)
00041   : Thread("PlayerF2PThread", Thread::OPMODE_WAITFORWAKEUP),
00042     BlockedTimingAspect(BlockedTimingAspect::WAKEUP_HOOK_ACT_EXEC)
00043 {
00044   __client_thread = client_thread;
00045 }
00046 
00047 
00048 void
00049 PlayerF2PThread::init()
00050 {
00051 }
00052 
00053 
00054 void
00055 PlayerF2PThread::finalize()
00056 {
00057 }
00058 
00059 
00060 void
00061 PlayerF2PThread::loop()
00062 {
00063   __client_thread->sync_fawkes_to_player();
00064 }