Qpid Proton C++  0.17.0
common.hpp
1 #ifndef PROTON_CODEC_COMMON_HPP
2 #define PROTON_CODEC_COMMON_HPP
3 
4 /*
5  *
6  * Licensed to the Apache Software Foundation (ASF) under one
7  * or more contributor license agreements. See the NOTICE file
8  * distributed with this work for additional information
9  * regarding copyright ownership. The ASF licenses this file
10  * to you under the Apache License, Version 2.0 (the
11  * "License"); you may not use this file except in compliance
12  * with the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing,
17  * software distributed under the License is distributed on an
18  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19  * KIND, either express or implied. See the License for the
20  * specific language governing permissions and limitations
21  * under the License.
22  *
23  */
24 
25 #include "../type_id.hpp"
26 
27 namespace proton {
28 namespace codec {
29 
31 struct start {
34  start(type_id type_=NULL_TYPE, type_id element_=NULL_TYPE,
35  bool described_=false, size_t size_=0) :
36  type(type_), element(element_), is_described(described_), size(size_) {}
37 
38  type_id type;
39  type_id element;
40  bool is_described;
41  size_t size;
42 
46  static start array(type_id element, bool described=false) { return start(ARRAY, element, described); }
47  static start list() { return start(LIST); }
48  static start map() { return start(MAP); }
49  static start described() { return start(DESCRIBED, NULL_TYPE, true); }
51 };
52 
54 struct finish {};
55 
56 } // codec
57 } // proton
58 
59 #endif // PROTON_CODEC_COMMON_HPP
Experimental - Start encoding a complex type.
Definition: common.hpp:31
The null type, contains no data.
Definition: type_id.hpp:39
A descriptor and a value.
Definition: type_id.hpp:60
A sequence of values of the same type.
Definition: type_id.hpp:61
A sequence of key-value pairs.
Definition: type_id.hpp:63
type_id
An identifier for AMQP types.
Definition: type_id.hpp:38
Experimental - Finish inserting or extracting a complex type.
Definition: common.hpp:54
A sequence of values of mixed types.
Definition: type_id.hpp:62
The main Proton namespace.
Definition: annotation_key.hpp:30