Zigzag.hh

Go to the documentation of this file.
00001 /*
00002  * Licensed to the Apache Software Foundation (ASF) under one
00003  * or more contributor license agreements.  See the NOTICE file
00004  * distributed with this work for additional information
00005  * regarding copyright ownership.  The ASF licenses this file
00006  * to you under the Apache License, Version 2.0 (the
00007  * "License"); you may not use this file except in compliance
00008  * with the License.  You may obtain a copy of the License at
00009  *
00010  *     http://www.apache.org/licenses/LICENSE-2.0
00011  *
00012  * Unless required by applicable law or agreed to in writing, software
00013  * distributed under the License is distributed on an "AS IS" BASIS,
00014  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015  * See the License for the specific language governing permissions and
00016  * limitations under the License.
00017  */
00018 
00019 #ifndef avro_Encoding_hh__
00020 #define avro_Encoding_hh__
00021 
00022 #include <stdint.h>
00023 #include <boost/array.hpp>
00024 
00025 #include "Config.hh"
00028 
00029 namespace avro {
00030 
00031 AVRO_DECL uint64_t encodeZigzag64(int64_t input);
00032 AVRO_DECL int64_t decodeZigzag64(uint64_t input);
00033 
00034 AVRO_DECL uint32_t encodeZigzag32(int32_t input);
00035 AVRO_DECL int32_t decodeZigzag32(uint32_t input);
00036 
00037 AVRO_DECL size_t encodeInt32(int32_t input, boost::array<uint8_t, 5> &output);
00038 AVRO_DECL size_t encodeInt64(int64_t input, boost::array<uint8_t, 10> &output);
00039 
00040 } // namespace avro
00041 
00042 #endif