Safir SDK Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Serialization.h
Go to the documentation of this file.
1 /******************************************************************************
2 *
3 * Copyright Saab AB, 2006-2013 (http://safir.sourceforge.net)
4 *
5 * Created by: Lars Hagström / stlrha
6 *
7 *******************************************************************************
8 *
9 * This file is part of Safir SDK Core.
10 *
11 * Safir SDK Core is free software: you can redistribute it and/or modify
12 * it under the terms of version 3 of the GNU General Public License as
13 * published by the Free Software Foundation.
14 *
15 * Safir SDK Core is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with Safir SDK Core. If not, see <http://www.gnu.org/licenses/>.
22 *
23 ******************************************************************************/
24 
25 #ifndef __DOTS_SERIALIZATION_H__
26 #define __DOTS_SERIALIZATION_H__
27 
28 #include <boost/shared_ptr.hpp>
31 
32 namespace Safir
33 {
34 namespace Dob
35 {
36 namespace Typesystem
37 {
38  //forward declarations
39  class Object;
40 
42  typedef boost::shared_ptr<Object> ObjectPtr;
43 
47  class DOTS_API Serialization
48  {
49  public:
57  static const std::wstring ToXml(const Dob::Typesystem::ObjectPtr object);
58 
71  static Dob::Typesystem::ObjectPtr ToObject(const std::wstring & xml);
72 
79  static const std::wstring ToXml(const BinarySerialization & bin);
80 
87  static const std::wstring ToXml(const char * const blob);
88 
100  static void ToBinary(const Dob::Typesystem::ObjectPtr object, Dob::Typesystem::BinarySerialization & binary);
101 
102 
116 
117  };
118 }
119 }
120 }
121 
122 
123 #endif
124 
std::vector< char > BinarySerialization
A type to contain binary serializations of DOB objects.
Definition: Dob/Typesystem/Defs.h:289
Functions for serializing objects to binary and XML forms.
Definition: Serialization.h:47
boost::shared_ptr< Object > ObjectPtr
A smart pointer to an Object.
Definition: Object.h:41