framework
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
framework
serializable
mutators
fixed_container.hpp
Go to the documentation of this file.
1
// Copyright (C) 2012 iwg molw5
2
// For conditions of distribution and use, see copyright notice in COPYING
3
13
#pragma once
14
15
#include <
framework/serializable/mutator_type.hpp
>
16
#include <
framework/serializable/base_types.hpp
>
17
18
namespace
framework
19
{
20
namespace
serializable
21
{
30
template
<
typename
Value,
typename
Container>
31
struct
fixed_container
:
public
mutator_type
<Container>
32
{
33
};
34
42
template
<
43
typename
Value,
44
typename
Container,
45
typename
Input,
46
typename
Output>
47
bool
read_dispatch
(
48
fixed_container <Value, Container>
*,
49
Input& in, Output& out)
50
{
51
Container result;
52
for
(
auto
& x : result)
53
if
(!dispatch_read <Value> (in, x))
54
return
false
;
55
56
out = std::move(result);
57
return
true
;
58
}
59
67
template
<
68
typename
Value,
69
typename
Container,
70
typename
Input,
71
typename
Output>
72
bool
write_dispatch
(
73
fixed_container <Value, Container>
*,
74
Input
const
& in, Output& out)
75
{
76
for
(
auto
const
& x : in)
77
if
(!dispatch_write <Value> (x, out))
78
return
false
;
79
80
return
true
;
81
}
82
}
83
}
Generated on Wed Apr 10 2013 20:49:42 for framework by
1.8.3.1-20130402