~comnets/openwns-rise/rise--main--1.0

« back to all changes in this revision

Viewing changes to src/scenario/fastfading/Freq2SubchannelCache.hpp

  • Committer: Maciej Muehleisen
  • Date: 2011-08-24 13:50:35 UTC
  • Revision ID: mue@mue-laptop-20110824135035-w4z816uyw53ogduj
Created PerLinkAndSubchannel FastFading base class.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*******************************************************************************
 
2
 * This file is part of openWNS (open Wireless Network Simulator)
 
3
 * _____________________________________________________________________________
 
4
 *
 
5
 * Copyright (C) 2004-2007
 
6
 * Chair of Communication Networks (ComNets)
 
7
 * Kopernikusstr. 5, D-52074 Aachen, Germany
 
8
 * phone: ++49-241-80-27910,
 
9
 * fax: ++49-241-80-22242
 
10
 * email: info@openwns.org
 
11
 * www: http://www.openwns.org
 
12
 * _____________________________________________________________________________
 
13
 *
 
14
 * openWNS is free software; you can redistribute it and/or modify it under the
 
15
 * terms of the GNU Lesser General Public License version 2 as published by the
 
16
 * Free Software Foundation;
 
17
 *
 
18
 * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY
 
19
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 
20
 * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
 
21
 * details.
 
22
 *
 
23
 * You should have received a copy of the GNU Lesser General Public License
 
24
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
25
 *
 
26
 ******************************************************************************/
 
27
 
 
28
#ifndef _RISE_SCENARIO_FREQ2SUBCHANNELCACHE_HPP
 
29
#define _RISE_SCENARIO_FREQ2SUBCHANNELCACHE_HPP
 
30
 
 
31
#include <WNS/container/Registry.hpp>
 
32
#include <WNS/Types.hpp>
 
33
#include <WNS/logger/Logger.hpp>
 
34
 
 
35
namespace rise { namespace scenario { namespace fastfading {
 
36
 
 
37
    class Freq2SubchannelCache
 
38
    {
 
39
        public:
 
40
            Freq2SubchannelCache(unsigned int numberOfSubchannels);
 
41
            ~Freq2SubchannelCache();
 
42
 
 
43
            unsigned int
 
44
            getSubchannelIndex(const wns::Frequency& frequency) const;
 
45
 
 
46
        private:
 
47
            /* Using double as key is dangerous, but should work */
 
48
            mutable wns::container::Registry<double, unsigned int> frequencyToSubchannel_;
 
49
 
 
50
            unsigned int numberOfSubchannels_;
 
51
 
 
52
            wns::logger::Logger logger_;
 
53
    };
 
54
 
 
55
} // fastfading
 
56
} // scenario
 
57
} // rise
 
58
 
 
59
#endif // NOT defined _RISE_SCENARIO_FREQ2SUBCHANNELCACHE_HPP