proton/codec/deque.hpp

Go to the documentation of this file.
00001 #ifndef PROTON_CODEC_DEQUE_HPP
00002 #define PROTON_CODEC_DEQUE_HPP
00003 
00004 /*
00005  * Licensed to the Apache Software Foundation (ASF) under one
00006  * or more contributor license agreements.  See the NOTICE file
00007  * distributed with this work for additional information
00008  * regarding copyright ownership.  The ASF licenses this file
00009  * to you under the Apache License, Version 2.0 (the
00010  * "License"); you may not use this file except in compliance
00011  * with the License.  You may obtain a copy of the License at
00012  *
00013  *   http://www.apache.org/licenses/LICENSE-2.0
00014  *
00015  * Unless required by applicable law or agreed to in writing,
00016  * software distributed under the License is distributed on an
00017  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00018  * KIND, either express or implied.  See the License for the
00019  * specific language governing permissions and limitations
00020  * under the License.
00021  */
00022 
00025 
00026 #include "./encoder.hpp"
00027 #include "./decoder.hpp"
00028 
00029 #include <deque>
00030 #include <utility>
00031 
00032 namespace proton {
00033 namespace codec {
00034 
00036 template <class T, class A>
00037 encoder& operator<<(encoder& e, const std::deque<T, A>& x) {
00038     return e << encoder::array(x, internal::type_id_of<T>::value);
00039 }
00040 
00042 template <class A>
00043 encoder& operator<<(encoder& e, const std::deque<value, A>& x) { return e << encoder::list(x); }
00044 
00046 template <class A>
00047 encoder& operator<<(encoder& e, const std::deque<scalar, A>& x) { return e << encoder::list(x); }
00048 
00051 template <class A, class K, class T>
00052 encoder& operator<<(encoder& e, const std::deque<std::pair<K,T>, A>& x) { return e << encoder::map(x); }
00053 
00055 template <class T, class A> decoder& operator>>(decoder& d, std::deque<T, A>& x) { return d >> decoder::sequence(x); }
00056 
00058 template <class A, class K, class T> decoder& operator>>(decoder& d, std::deque<std::pair<K, T> , A>& x) { return d >> decoder::pair_sequence(x); }
00059 
00060 } // codec
00061 } // proton
00062 
00063 #endif // PROTON_CODEC_DEQUE_HPP

Generated on 29 Mar 2018 for Qpid Proton C++ by  doxygen 1.6.1