![]() |
User Manual, Developers Guide and API Documentation |
![]() |
00001 /******************************************************************************* 00002 * This file is part of openWNS (open Wireless Network Simulator) 00003 * _____________________________________________________________________________ 00004 * 00005 * Copyright (C) 2004-2007 00006 * Chair of Communication Networks (ComNets) 00007 * Kopernikusstr. 16, D-52074 Aachen, Germany 00008 * phone: ++49-241-80-27910, 00009 * fax: ++49-241-80-22242 00010 * email: info@openwns.org 00011 * www: http://www.openwns.org 00012 * _____________________________________________________________________________ 00013 * 00014 * openWNS is free software; you can redistribute it and/or modify it under the 00015 * terms of the GNU Lesser General Public License version 2 as published by the 00016 * Free Software Foundation; 00017 * 00018 * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY 00019 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 00020 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00021 * details. 00022 * 00023 * You should have received a copy of the GNU Lesser General Public License 00024 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00025 * 00026 ******************************************************************************/ 00027 00028 #ifndef WNS_PROBE_BUS_DETAIL_MEASUREMENTFUNCTOR_HPP 00029 #define WNS_PROBE_BUS_DETAIL_MEASUREMENTFUNCTOR_HPP 00030 00031 #include <WNS/simulator/Time.hpp> 00032 #include <WNS/probe/bus/Context.hpp> 00033 00034 namespace wns { namespace probe { namespace bus { namespace detail { 00035 00042 class MeasurementFunctor 00043 { 00044 typedef void (IProbeBusNotification::*fPtr)(const wns::simulator::Time&, 00045 const double&, 00046 const IContext&); 00047 public: 00048 MeasurementFunctor(fPtr f, 00049 const wns::simulator::Time& time, 00050 const double& value, 00051 const IContext& reg): 00052 f_(f), 00053 time_(time), 00054 value_(value), 00055 registry_(reg) 00056 {} 00057 00058 void 00059 operator()(IProbeBusNotification* observer) 00060 { 00061 (*observer.*f_)(time_, value_, registry_); 00062 } 00063 00064 private: 00065 fPtr f_; 00066 const wns::simulator::Time& time_; 00067 const double& value_; 00068 const IContext& registry_; 00069 }; 00070 00071 } 00072 } 00073 } 00074 } 00075 00076 #endif // WNS_PROBE_BUS_DETAIL_MEASUREMENTFUNCTOR_HPP
1.5.5