Main Page · Modules · All Classes · Class Hierarchy
MACollectedData.hpp
1 /*
2  * This file is part of the AiBO+ project
3  *
4  * Copyright (C) 2005-2016 Csaba Kertész (csaba.kertesz@gmail.com)
5  *
6  * AiBO+ is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * AiBO+ is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
19  *
20  */
21 
22 #pragma once
23 
24 #include "core/MACoreTypes.hpp"
25 
26 #include <MCDataStorage.hpp>
27 #include <MCDefs.hpp>
28 
29 #include <string>
30 
31 #include <boost/scoped_ptr.hpp>
32 #include <boost/shared_ptr.hpp>
33 
34 class MACollectedData;
35 class MCBinaryData;
36 
42 namespace MA
43 {
45 typedef boost::shared_ptr<MACollectedData> CollectedDataSPtr;
46 }
47 
52 {
54 
55 public:
56 
67  MACollectedData(const int session_id, const std::string& name, const int id,
68  const std::string& variable_map);
69 
77  std::string GetName() const;
78 
86  int GetCollectionID();
87 
95  int GetSessionID();
96 
105  void SetCustomData(const std::string& data_name, const MCBinaryData& data_value);
106 
116  MCBinaryData* GetCustomData(const std::string& data_name);
117 
125  bool IsCompact() const;
126 
134  void MakeCompact();
135 
141  void PrintSummary();
142 
150  const std::string& GetRobotStateVariableMap() const;
151 
161  void AddNewData(const std::string& name, int cycle_id, const MCBinaryData& data);
162 
174  MA::BinaryDataPtrList GetAllDataByTypeName(const std::string& type_name);
175 
183  MCBinaryData* Encode() const;
184 
194  static MACollectedData* Decode(const MCBinaryData& data);
195 
196 protected:
198  boost::scoped_ptr<MCDataStorage> DataStorage;
199 };
200 
Collected data with portable storage functions.
Binary data class.
#define MC_DISABLE_COPY(class_name)
Helper macro to disable the copy constructor and assignment operator of a class (object copying) ...
Definition: MCDefs.hpp:604
boost::scoped_ptr< MCDataStorage > DataStorage
Data storage of all collected data.