Bayeux
3.4.1
Core Foundation library for SuperNEMO
bayeux
datatools
ocd_macros.h
Go to the documentation of this file.
1
/*
3
* Description :
4
*
5
* Some useful macros related to OCD features.
6
*
7
* Copyright (C) 2013 Francois Mauger <mauger@lpccaen.in2p3.fr>
8
*
9
* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; either version 3 of the License, or (at
12
* your option) any later version.
13
*
14
* This program is distributed in the hope that it will be useful, but
15
* WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
* General Public License for more details.
18
*
19
* You should have received a copy of the GNU General Public License
20
* along with this program; if not, write to the Free Software
21
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
22
* Boston, MA 02110-1301, USA.
23
*
24
*/
25
#ifndef DATATOOLS_OCD_MACROS_H
26
#define DATATOOLS_OCD_MACROS_H
27
28
// This project:
29
#include <
datatools/detail/ocd_utils.h
>
30
32
35
#define DOCD_CLASS_DECLARATION(ClassName) \
36
namespace datatools { \
37
namespace detail { \
38
namespace ocd { \
39
template<> \
40
void implement_load< ClassName >(::datatools::object_configuration_description & ocd_); \
41
template<> struct loader< ClassName > { \
42
static const bool value = true; \
43
struct load { \
44
void operator()(::datatools::object_configuration_description & ocd_) const { \
45
implement_load< ClassName >(ocd_); \
46
} \
47
}; \
48
}; \
49
}}} \
50
51
53
57
#define DOCD_CLASS_IMPLEMENT_LOAD_BEGIN(ClassType,OcdId) \
58
namespace datatools { \
59
namespace detail { \
60
namespace ocd { \
61
template<> void implement_load< ClassType >(::datatools::object_configuration_description & OcdId) { \
62
63
65
#define DOCD_CLASS_IMPLEMENT_LOAD_END() \
66
}}}} \
67
68
70
74
#define DOCD_CLASS_SYSTEM_REGISTRATION(ClassType,ClassId) \
75
namespace datatools { \
76
namespace detail { \
77
namespace ocd { \
78
template <> \
79
struct _ocd_sfr< ClassType > { \
80
static boost::scoped_ptr<base_system_factory_registrar> reg_; \
81
}; \
82
boost::scoped_ptr<base_system_factory_registrar> \
83
_ocd_sfr< ClassType >::reg_(new system_factory_registrar< ClassType >(ClassId)); \
84
}}} \
85
86
87
#define DOCD_GET_SYSTEM_REGISTRATION() \
88
::datatools::detail::ocd::ocd_registration::get_system_registration() \
89
90
91
#endif // DATATOOLS_OCD_MACROS_H
92
93
// Local Variables: --
94
// mode: c++ --
95
// c-file-style: "gnu" --
96
// tab-width: 2 --
97
// End: --
ocd_utils.h
Generated by
1.8.15