00001 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ 00002 /* 00003 * Copyright (c) 2008 Drexel University 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License version 2 as 00007 * published by the Free Software Foundation; 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 * 00018 * Author: Joe Kopena (tjkopena@cs.drexel.edu) 00019 */ 00020 00021 #ifndef __DATA_COLLECTOR_H__ 00022 #define __DATA_COLLECTOR_H__ 00023 00024 #include <list> 00025 #include <string> 00026 00027 #include "ns3/object.h" 00028 00029 namespace ns3 { 00030 00031 class DataCalculator; 00032 00033 //------------------------------------------------------------ 00034 //-------------------------------------------- 00035 typedef std::list<Ptr<DataCalculator> > DataCalculatorList; 00036 typedef std::list<std::pair<std::string, std::string> > MetadataList; 00037 00038 class DataCollector : public Object { 00039 public: 00040 DataCollector(); 00041 virtual ~DataCollector(); 00042 00043 void DescribeRun(std::string experiment, 00044 std::string strategy, 00045 std::string input, 00046 std::string runID, 00047 std::string description = ""); 00048 00049 std::string GetExperimentLabel() const { return m_experimentLabel; } 00050 std::string GetStrategyLabel() const { return m_strategyLabel; } 00051 std::string GetInputLabel() const { return m_inputLabel; } 00052 std::string GetRunLabel() const { return m_runLabel; } 00053 std::string GetDescription() const { return m_description; } 00054 00055 void AddMetadata(std::string key, std::string value); 00056 void AddMetadata(std::string key, double value); 00057 void AddMetadata(std::string key, uint32_t value); 00058 MetadataList::iterator MetadataBegin(); 00059 MetadataList::iterator MetadataEnd(); 00060 00061 void AddDataCalculator(Ptr<DataCalculator> datac); 00062 DataCalculatorList::iterator DataCalculatorBegin(); 00063 DataCalculatorList::iterator DataCalculatorEnd(); 00064 00065 protected: 00066 virtual void DoDispose(); 00067 00068 private: 00069 std::string m_experimentLabel; 00070 std::string m_strategyLabel; 00071 std::string m_inputLabel; 00072 std::string m_runLabel; 00073 std::string m_description; 00074 00075 MetadataList m_metadata; 00076 DataCalculatorList m_calcList; 00077 00078 // end class DataCollector 00079 }; 00080 00081 // end namespace ns3 00082 }; 00083 00084 #endif // __DATA_COLLECTOR_H__