0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Append.cc
Go to the documentation of this file.
1 /* -*- c++ -*-
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 3
9  * of the License, or any later version.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
27 
28 #include <Common/Compat.h>
29 
30 #include "Append.h"
31 
32 #include <Common/Logger.h>
33 #include <Common/Serialization.h>
34 
35 using namespace Hypertable;
37 
38 uint8_t Append::encoding_version() const {
39  return 1;
40 }
41 
43  return 12;
44 }
45 
46 void Append::encode_internal(uint8_t **bufp) const {
49 }
50 
51 void Append::decode_internal(uint8_t version, const uint8_t **bufp,
52  size_t *remainp) {
53  (void)version;
54  m_offset = Serialization::decode_i64(bufp, remainp);
55  m_amount = Serialization::decode_i32(bufp, remainp);
56 }
void decode_internal(uint8_t version, const uint8_t **bufp, size_t *remainp) override
Reads serialized representation of object from a buffer.
Definition: Append.cc:51
uint64_t m_offset
Offset at which data was appended.
Definition: Append.h:82
size_t encoded_length_internal() const override
Returns internal serialized length.
Definition: Append.cc:42
uint8_t encoding_version() const override
Returns encoding version.
Definition: Append.cc:38
Declarations for Append response parameters.
uint32_t decode_i32(const uint8_t **bufp, size_t *remainp)
Decode a 32-bit integer in little-endian order.
uint64_t decode_i64(const uint8_t **bufp, size_t *remainp)
Decode a 64-bit integer in little-endian order.
Logging routines and macros.
void encode_i32(uint8_t **bufp, uint32_t val)
Encode a 32-bit integer in little-endian order.
Compatibility Macros for C/C++.
void encode_i64(uint8_t **bufp, uint64_t val)
Encode a 64-bit integer in little-endian order.
Functions to serialize/deserialize primitives to/from a memory buffer.
Hypertable definitions
void encode_internal(uint8_t **bufp) const override
Writes serialized representation of object to a buffer.
Definition: Append.cc:46
uint32_t m_amount
Amount of data appended.
Definition: Append.h:85