Kinetis Bootloader Host  2.0.0
Host Tools for Kinetis devices
BootImageGenerator.h
1 /*
2  * File: BootImageGenerator.h
3  *
4  * Copyright (c) Freescale Semiconductor, Inc. All rights reserved.
5  * See included license file for license details.
6  */
7 #if !defined(_BootImageGenerator_h_)
8 #define _BootImageGenerator_h_
9 
10 #include "OutputSection.h"
11 #include "BootImage.h"
12 #include "OptionContext.h"
13 
14 namespace elftosb
15 {
34 {
35 public:
39  virtual ~BootImageGenerator() {}
41  void addOutputSection(OutputSection *section) { m_sections.push_back(section); }
43  void setOptionContext(OptionContext *context) { m_options = context; }
45  virtual BootImage *generate() = 0;
46 
47 protected:
49  typedef std::vector<OutputSection *> section_vector_t;
50 
51  section_vector_t m_sections;
53 
55  void processVersionOptions(BootImage *image);
56 
58  void processDriveTagOption(BootImage *image);
59 };
60 
61 }; // namespace elftosb
62 
63 #endif // _BootImageGenerator_h_
virtual ~BootImageGenerator()
Destructor.
Definition: BootImageGenerator.h:39
void processDriveTagOption(BootImage *image)
Handle the common option which sets the system drive tag.
Definition: BootImageGenerator.cpp:65
void addOutputSection(OutputSection *section)
Add another section to the output.
Definition: BootImageGenerator.h:41
std::vector< OutputSection * > section_vector_t
Type for a list of model output sections.
Definition: BootImageGenerator.h:49
section_vector_t m_sections
Requested output sections.
Definition: BootImageGenerator.h:51
Definition: BootImage.h:13
Pure abstract interface class to a table of options.
Definition: apps/elftosb/common/OptionContext.h:18
OptionContext * m_options
Global option context.
Definition: BootImageGenerator.h:52
void processVersionOptions(BootImage *image)
Handle common product and component version options.
Definition: BootImageGenerator.cpp:23
void setOptionContext(OptionContext *context)
Set the global option context.
Definition: BootImageGenerator.h:43
Abstract base class for all boot image format classes.
Definition: BootImage.h:25
virtual BootImage * generate()=0
Pure virtual method to generate the output BootImage from input sections.
Abstract base class for generators of specific boot image formats.
Definition: BootImageGenerator.h:33
BootImageGenerator()
Constructor.
Definition: BootImageGenerator.h:37
Base class for data model of sections of the output file.
Definition: OutputSection.h:20