Alchemy  1.0
A framework to robustly process network messages and structured data
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
opaque_proxy.h
1 /// @file detail/opaque_proxy.h
2 ///
3 /// The declaration and definition of the Opaque DataProxy.
4 ///
5 /// A parameterized type that provides an opaque buffer of bytes.
6 /// The user can then associate an unbuffered message with the type to
7 /// directly manipulate the data.
8 ///
9 /// The MIT License(MIT)
10 /// @copyright 2014 Paul M Watt
11 // ****************************************************************************
12 #ifndef OPAQUE_PROXY_H_INCLUDED
13 #define OPAQUE_PROXY_H_INCLUDED
14 // Includes ******************************************************************
15 
16 #include <Pb/meta_fwd.h>
17 #include <Pb/type_list.h>
18 #include <Pb/type_at.h>
19 #include <Hg/datum/datum.h>
20 #include <Hg/storage_policy.h>
21 
22 #include <vector>
23 
24 namespace Hg
25 {
26 
27 namespace detail
28 {
29 
30 // ****************************************************************************
31 /// A template to provide access to sequences of data fields.
32 ///
33 /// This version derives from the Vector Proxy.
34 /// Additional functionality is defined for obtaining views of the data buffers.
35 ///
36 /// @paramt IdxT
37 /// @paramt FormatType
38 ///
39 template< size_t IdxT,
40  typename FormatT
41  >
42 struct DataProxy <opaque_vector_trait, IdxT, FormatT>
43  : public DataProxy <vector_trait, IdxT, FormatT>
44 {
45  // Typedefs *****************************************************************
46  typedef DataProxy < opaque_trait,
47  IdxT,
48  FormatT
49  > this_type;
50  typedef DataProxy < vector_trait,
51  IdxT,
52  FormatT
53  > base_type;
54 
55  typedef FormatT format_type;
56 
57  typedef typename
59 
60  typedef typename
62  ///< Type mapping for the message format
63  /// type to the actual value_type.
64  typedef typename
66  ///< The raw type extracted at the current
67  /// index defined in the parent TypeList.
68  typedef typename
69  index_type::value_type data_type;
70  ///< The value type of the element extracted
71  /// at the current index defined in the
72  /// parent TypeList.
73 
74  // Typedefs *****************************************************************
75  typedef typename
76  base_type::value_type value_type;
77 
78  typedef typename /// Reference to an element in the vector.
79  value_type::reference reference;
80 
81  typedef typename /// Const Reference to an element in the vector.
82  value_type::const_reference const_reference;
83 
84  typedef typename /// An iterator to a value_type index.
85  value_type::iterator iterator;
86 
87  typedef typename /// A const iterator to a value_type index.
88  value_type::const_iterator const_iterator;
89 
90  typedef typename /// A reverse iterator to a value_type index.
91  value_type::reverse_iterator reverse_iterator;
92 
93  typedef typename /// A const reverse iterator to a value_type index.
94  value_type::const_reverse_iterator const_reverse_iterator;
95 
96 
97  // Forward Declarations *****************************************************
98  // Bring all of these type into this namespace from the base template.
99  //
100  using base_type::clear;
101  using base_type::empty;
102  using base_type::reserve;
103  using base_type::capacity;
104  using base_type::size;
105  using base_type::resize;
106  using base_type::set;
107  using base_type::assign;
108  using base_type::at;
109  using base_type::front;
110  using base_type::back;
111  using base_type::begin;
112  using base_type::end;
113  using base_type::cend;
114  using base_type::rbegin;
115  using base_type::crbegin;
116  using base_type::rend;
117  using base_type::crend;
118  using base_type::erase;
119  using base_type::push_back;
120  using base_type::pop_back;
121  using base_type::swap;
122 
123  // **************************************************************************
124  ///
125  ///
126  DataProxy()
127  { }
128 
129 };
130 
131 
132 
133 //// ****************************************************************************
134 ///// A template to provide access to sequences of data fields (fixed-size).
135 /////
136 ///// This version derives from the Array Proxy.
137 ///// Additional functionality is defined for obtaining views of the data buffers.
138 /////
139 ///// @paramt IdxT
140 ///// @paramt FormatType
141 /////
142 //template< size_t IdxT,
143 // typename FormatT
144 // >
145 //struct DataProxy <opaque_trait, IdxT, FormatT>
146 // : public DataProxy <array_trait, IdxT, FormatT>
147 //{
148 // // Typedefs *****************************************************************
149 // typedef DataProxy < opaque_trait,
150 // IdxT,
151 // FormatT
152 // > this_type;
153 // typedef DataProxy < array_trait,
154 // IdxT,
155 // FormatT
156 // > base_type;
157 //
158 // typedef FormatT format_type;
159 //
160 // typedef typename
161 // base_type::datum_type datum_type;
162 //
163 // typedef typename
164 // base_type::field_type field_type;
165 // ///< Type mapping for the message format
166 // /// type to the actual value_type.
167 // typedef typename
168 // field_type::index_type index_type;
169 // ///< The raw type extracted at the current
170 // /// index defined in the parent TypeList.
171 // typedef typename
172 // index_type::value_type data_type;
173 // ///< The value type of the element extracted
174 // /// at the current index defined in the
175 // /// parent TypeList.
176 //
177 // // Typedefs *****************************************************************
178 // typedef typename
179 // base_type::value_type value_type;
180 //
181 // typedef typename /// Reference to an element in the vector.
182 // value_type::reference reference;
183 //
184 // typedef typename /// Const Reference to an element in the vector.
185 // value_type::const_reference const_reference;
186 //
187 // typedef typename /// An iterator to a value_type index.
188 // value_type::iterator iterator;
189 //
190 // typedef typename /// A const iterator to a value_type index.
191 // value_type::const_iterator const_iterator;
192 //
193 // typedef typename /// A reverse iterator to a value_type index.
194 // value_type::reverse_iterator reverse_iterator;
195 //
196 // typedef typename /// A const reverse iterator to a value_type index.
197 // value_type::const_reverse_iterator const_reverse_iterator;
198 //
199 // // Forward Declarations *****************************************************
200 // // Bring all of these type into this namespace from the base template.
201 // //
202 // using base_type::clear;
203 // using base_type::empty;
204 // using base_type::reserve;
205 // using base_type::capacity;
206 // using base_type::size;
207 // using base_type::set;
208 // using base_type::assign;
209 // using base_type::at;
210 // using base_type::front;
211 // using base_type::back;
212 // using base_type::begin;
213 // using base_type::end;
214 // using base_type::cend;
215 // using base_type::rbegin;
216 // using base_type::crbegin;
217 // using base_type::rend;
218 // using base_type::crend;
219 // using base_type::erase;
220 // using base_type::push_back;
221 // using base_type::pop_back;
222 // using base_type::swap;
223 //
224 // // **************************************************************************
225 // ///
226 // ///
227 // DataProxy()
228 // { }
229 //
230 //};
231 
232 } // namespace detail
233 } // namespace Hg
234 
235 #endif