orca-robotics INTRODUCTION Overview Download and Install Quick Start Documentation Publications REPOSITORY Interfaces Components Libraries Utilities Software Map DEVELOPER Tutorials Examples Dev Guide Dashboard Wiki login/pass: orca/orca PEOPLE Contributors Users Project Download Mailing lists
|
latencypingerI.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp 00005 * 00006 * This copy of Orca is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef ORCA_LATENCY_PINGER_I_H 00012 #define ORCA_LATENCY_PINGER_I_H 00013 00014 #include <IceUtil/Time.h> 00015 00016 #include <vector> 00017 #include <string> 00018 #include <fstream> 00019 00020 #include "pingreply.h" 00021 #include <orcaice/context.h> 00022 00023 class LatencyPingerI : public orca::util::LatencyPinger 00024 { 00025 public: 00026 struct Config 00027 { 00028 int count; 00029 // sending period in [sec] 00030 double interval; 00031 int preload; 00032 // do we need deadline_? 00033 std::string filename; 00034 }; 00035 00036 LatencyPingerI( const orcaice::Context& context, orca::util::LatencyReplierPrx& replier, const Config& config ); 00037 00038 // from orca::util::LatencyPinger 00039 virtual void takeItBack(const orca::util::PingReplyData&, const Ice::Current&); 00040 00041 // local API 00042 // Return true if pass, false if fail 00043 bool sequencePing( int operationType ); 00044 // bool classPing(); 00045 // bool structPing(); 00046 bool icePing(); 00047 00048 private: 00049 void calcStats( const int size ); 00050 00051 // the server 00052 orca::util::LatencyReplierPrx& replier_; 00053 00054 // pointer to the log file, passed down from the calling function 00055 std::ofstream* logfile_; 00056 00057 // ping options 00058 Config config_; 00059 00060 std::vector<IceUtil::Time> sends_; 00061 std::vector<IceUtil::Time> receives_; 00062 std::vector<int> ids_; 00063 00064 IceUtil::Time stopWatch_; 00065 00066 orcaice::Context context_; 00067 }; 00068 00069 // define a smart pointer using Ice utilities 00070 typedef IceUtil::Handle<LatencyPingerI> LatencyPingerIPtr; 00071 00072 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)