Wiselib
wiselib.testing/algorithms/localization/distance_based/modules/localization_module.h
Go to the documentation of this file.
00001 /***************************************************************************
00002  ** This file is part of the generic algorithm library Wiselib.           **
00003  ** Copyright (C) 2008,2009 by the Wisebed (www.wisebed.eu) project.      **
00004  **                                                                       **
00005  ** The Wiselib is free software: you can redistribute it and/or modify   **
00006  ** it under the terms of the GNU Lesser General Public License as        **
00007  ** published by the Free Software Foundation, either version 3 of the    **
00008  ** License, or (at your option) any later version.                       **
00009  **                                                                       **
00010  ** The Wiselib is distributed in the hope that it will be useful,        **
00011  ** but WITHOUT ANY WARRANTY; without even the implied warranty of        **
00012  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         **
00013  ** GNU Lesser General Public License for more details.                   **
00014  **                                                                       **
00015  ** You should have received a copy of the GNU Lesser General Public      **
00016  ** License along with the Wiselib.                                       **
00017  ** If not, see <http://www.gnu.org/licenses/>.                           **
00018  ***************************************************************************/
00019 #ifndef __ALGORITHMS_LOCALIZATION_DISTANCE_BASED_LOCALIZATION_MODULE_H
00020 #define __ALGORITHMS_LOCALIZATION_DISTANCE_BASED_LOCALIZATION_MODULE_H
00021 
00022 #include "algorithms/localization/distance_based/neighborhood/localization_neighborhood.h"
00023 #include "algorithms/localization/distance_based/neighborhood/localization_local_coordinate_system.h"
00024 #include "algorithms/localization/distance_based/util/localization_shared_data.h"
00025 
00026 namespace wiselib
00027 {
00028 
00030 
00077    template<typename OsModel_P,
00078             typename Radio_P,
00079             typename SharedData_P>
00080    class LocalizationModule
00081    {
00082 
00083    public:
00084       typedef OsModel_P OsModel;
00085       typedef Radio_P Radio;
00086       typedef SharedData_P SharedData;
00087 
00088       typedef LocalizationModule<OsModel, Radio, SharedData> self_type;
00089 
00090       typedef typename Radio::size_t size_t;
00091       typedef typename Radio::node_id_t node_id_t;
00092       typedef typename Radio::block_data_t block_data_t;
00093 
00094       typedef typename SharedData::Neighborhood Neighborhood;
00095       typedef typename SharedData::LocalCoordinateSystem LocalCoordinateSystem;
00096 
00099 
00104       void set_shared_data( SharedData& shared_data )
00105       { shared_data_ = &shared_data; }
00108 //       const SharedData& shared_data( void ) const
00109 //       { return *shared_data_; }
00112       SharedData& shared_data( void )
00113       { return *shared_data_; }
00116       Neighborhood& neighborhood( void )
00117       { return shared_data_->neighborhood(); }
00120       LocalCoordinateSystem& local_coord_sys( void )
00121       { return shared_data_->local_coord_sys(); }
00123 
00124 
00125    private:
00126 
00127       SharedData* shared_data_;
00128    };
00129 
00130 }// namespace wiselib
00131 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines