blob: d722028cf728491bd9677355b9279b5b10ef5933 [file] [log] [blame]
Alex Deymoaea4c1c2015-08-19 20:24:43 -07001//
2// Copyright (C) 2010 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//
Darin Petkov7a22d792010-11-08 14:10:00 -080016
Alex Vakulenko072359c2014-07-18 11:41:07 -070017#ifndef UPDATE_ENGINE_PAYLOAD_GENERATOR_FULL_UPDATE_GENERATOR_H_
18#define UPDATE_ENGINE_PAYLOAD_GENERATOR_FULL_UPDATE_GENERATOR_H_
Darin Petkov7a22d792010-11-08 14:10:00 -080019
Alex Vakulenko072359c2014-07-18 11:41:07 -070020#include <string>
21#include <vector>
22
Alex Deymo477aec22015-03-24 23:40:48 -070023#include <base/macros.h>
24
Sen Jiang8cc502d2015-08-10 10:04:54 -070025#include "update_engine/payload_generator/blob_file_writer.h"
Alex Deymo477aec22015-03-24 23:40:48 -070026#include "update_engine/payload_generator/operations_generator.h"
Alex Deymof1cbe172015-03-05 15:58:37 -080027#include "update_engine/payload_generator/payload_generation_config.h"
Darin Petkov7a22d792010-11-08 14:10:00 -080028
29namespace chromeos_update_engine {
30
Alex Deymo477aec22015-03-24 23:40:48 -070031class FullUpdateGenerator : public OperationsGenerator {
Darin Petkov7a22d792010-11-08 14:10:00 -080032 public:
Alex Deymo477aec22015-03-24 23:40:48 -070033 FullUpdateGenerator() = default;
34
Alex Deymo7fad7b72015-07-21 22:22:47 -070035 // OperationsGenerator override.
Alex Deymof1cbe172015-03-05 15:58:37 -080036 // Creates a full update for the target image defined in |config|. |config|
37 // must be a valid payload generation configuration for a full payload.
Sen Jiangebdf17d2015-08-19 11:53:27 -070038 // Populates |aops|, with data about the update operations, and writes
39 // relevant data to |blob_file|.
Alex Deymo477aec22015-03-24 23:40:48 -070040 bool GenerateOperations(
Alex Deymof1cbe172015-03-05 15:58:37 -080041 const PayloadGenerationConfig& config,
Sen Jiangebdf17d2015-08-19 11:53:27 -070042 const PartitionConfig& old_part,
Alex Deymo7fad7b72015-07-21 22:22:47 -070043 const PartitionConfig& new_part,
Sen Jiang8cc502d2015-08-10 10:04:54 -070044 BlobFileWriter* blob_file,
Sen Jiangebdf17d2015-08-19 11:53:27 -070045 std::vector<AnnotatedOperation>* aops) override;
Alex Deymo7fad7b72015-07-21 22:22:47 -070046
Darin Petkov7a22d792010-11-08 14:10:00 -080047 private:
Alex Deymo477aec22015-03-24 23:40:48 -070048 DISALLOW_COPY_AND_ASSIGN(FullUpdateGenerator);
Darin Petkov7a22d792010-11-08 14:10:00 -080049};
50
51} // namespace chromeos_update_engine
52
Alex Vakulenko072359c2014-07-18 11:41:07 -070053#endif // UPDATE_ENGINE_PAYLOAD_GENERATOR_FULL_UPDATE_GENERATOR_H_