Qpid Proton C++ API 0.39.0
 
Loading...
Searching...
No Matches
common.hpp
Go to the documentation of this file.
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
29
30namespace proton {
31namespace codec {
32
34struct start {
37 start(type_id type_=NULL_TYPE, type_id element_=NULL_TYPE,
38 bool described_=false, size_t size_=0) :
39 type(type_), element(element_), is_described(described_), size(size_) {}
40
41 type_id type;
42 type_id element;
43 bool is_described;
44 size_t size;
46
49 static start array(type_id element, bool described=false) { return start(ARRAY, element, described); }
50 static start list() { return start(LIST); }
51 static start map() { return start(MAP); }
52 static start described() { return start(DESCRIBED, NULL_TYPE, true); }
54};
55
57struct finish {};
58
59} // codec
60} // proton
61
62#endif // PROTON_CODEC_COMMON_HPP
A collection of key-value pairs.
Definition: map.hpp:69
Unsettled API - Finish inserting or extracting a complex type.
Definition: common.hpp:57
Unsettled API - Start encoding a complex type.
Definition: common.hpp:34
The main Proton namespace.
Definition: annotation_key.hpp:33
type_id
An identifier for AMQP types.
Definition: type_id.hpp:37
@ ARRAY
A sequence of values of the same type.
Definition: type_id.hpp:60
@ LIST
A sequence of values of mixed types.
Definition: type_id.hpp:61
@ MAP
A sequence of key-value pairs.
Definition: type_id.hpp:62
@ DESCRIBED
A descriptor and a value.
Definition: type_id.hpp:59
@ NULL_TYPE
The null type, contains no data.
Definition: type_id.hpp:38