Android-cuttlefish cvd tool
composite_serialization.h
Go to the documentation of this file.
1//
2// Copyright (C) 2020 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16#pragma once
17
18#include <vector>
19
20#include "keymaster/serializable.h"
21
22namespace cuttlefish {
23
32class CompositeSerializable : public keymaster::Serializable {
33public:
34 CompositeSerializable(const std::vector<keymaster::Serializable*>&);
35
36 size_t SerializedSize() const override;
37 uint8_t* Serialize(uint8_t* buf, const uint8_t* end) const override;
38 bool Deserialize(const uint8_t** buf_ptr, const uint8_t* end) override;
39private:
40 std::vector<keymaster::Serializable*> members_;
41};
42
43} // namespace cuttlefish
Definition: composite_serialization.h:32
CompositeSerializable(const std::vector< keymaster::Serializable * > &)
Definition: composite_serialization.cpp:22
std::vector< keymaster::Serializable * > members_
Definition: composite_serialization.h:40
size_t SerializedSize() const override
Definition: composite_serialization.cpp:26
uint8_t * Serialize(uint8_t *buf, const uint8_t *end) const override
Definition: composite_serialization.cpp:34
bool Deserialize(const uint8_t **buf_ptr, const uint8_t *end) override
Definition: composite_serialization.cpp:42
Definition: alloc_utils.cpp:23