Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PropertyMapSerializer.h
Go to the documentation of this file.
1 /* Copyright (c) 2014-2016 "Omnidome" by cr8tr
2  * Dome Mapping Projection Software (http://omnido.me).
3  * Omnidome was created by Michael Winkelmann aka Wilston Oreo (@WilstonOreo)
4  *
5  * This file is part of Omnidome.
6  *
7  * Omnidome is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Affero General Public License as
9  * published by the Free Software Foundation, either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU Affero General Public License for more details.
16  * You should have received a copy of the GNU Affero General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef OMNI_SERIALIZATION_PROPERTYMAPSERIALIZER_H_
20 #define OMNI_SERIALIZATION_PROPERTYMAPSERIALIZER_H_
21 
24 
25 namespace omni {
26  namespace serialization {
27  /// Interface for serializing data into a property map
29  public:
30  virtual void fromPropertyMap(PropertyMap const& _map) = 0;
31  virtual void toPropertyMap(PropertyMap& _map) const = 0;
32 
33  inline void fromStream(QDataStream& _is) {
34  PropertyMap _map;
35  _is >> _map;
36  fromPropertyMap(_map);
37  }
38 
39  inline void toStream(QDataStream& _os) const {
40  PropertyMap _map;
41  toPropertyMap(_map);
42  _os << _map;
43  }
44  };
45  }
46 
47  using serialization::PropertyMapSerializer;
48 }
49 
50 #endif /* OMNI_SERIALIZATION_PROPERTYMAPSERIALIZER_H_ */
void toStream(QDataStream &_os) const
Serialize to stream.
Definition: PropertyMapSerializer.h:39
virtual void toPropertyMap(PropertyMap &_map) const =0
Interface for serializing data into a property map.
Definition: PropertyMapSerializer.h:28
Abstract interface for serialization Holds two member functions for serialization and deserializatio...
Definition: Interface.h:31
void fromStream(QDataStream &_is)
Deserialize from stream.
Definition: PropertyMapSerializer.h:33
Property map to store properties in a QBuffer with an id.
Definition: PropertyMap.h:96
virtual void fromPropertyMap(PropertyMap const &_map)=0