Kinetis Bootloader Host  2.0.0
Host Tools for Kinetis devices
OutputSection.h
1 /*
2  * File: OutputSection.h
3  *
4  * Copyright (c) Freescale Semiconductor, Inc. All rights reserved.
5  * See included license file for license details.
6  */
7 #if !defined(_OutputSection_h_)
8 #define _OutputSection_h_
9 
10 #include "Operation.h"
11 #include "smart_ptr.h"
12 #include "Blob.h"
13 #include "OptionContext.h"
14 
15 namespace elftosb
16 {
21 {
22 public:
24  : m_id(0)
25  , m_options(0)
26  {
27  }
28  OutputSection(uint32_t identifier)
29  : m_id(identifier)
30  , m_options(0)
31  {
32  }
33  virtual ~OutputSection() {}
34  void setIdentifier(uint32_t identifier) { m_id = identifier; }
35  uint32_t getIdentifier() const { return m_id; }
40  inline void setOptions(OptionContext *context) { m_options = context; }
42  inline const OptionContext *getOptions() const { return m_options; }
43 protected:
44  uint32_t m_id;
46 };
47 
52 {
53 public:
55  : OutputSection()
56  {
57  }
58  OperationSequenceSection(uint32_t identifier)
59  : OutputSection(identifier)
60  {
61  }
62 
63  OperationSequence &getSequence() { return m_sequence; }
64 protected:
65  OperationSequence m_sequence;
66 };
67 
71 class BinaryDataSection : public OutputSection, public Blob
72 {
73 public:
75  : OutputSection()
76  , Blob()
77  {
78  }
79  BinaryDataSection(uint32_t identifier)
80  : OutputSection(identifier)
81  , Blob()
82  {
83  }
84 };
85 
86 }; // namespace elftosb
87 
88 #endif // _OutputSection_h_
Ordered sequence of operations.
Definition: Operation.h:323
A section of the output that contains boot operations.
Definition: OutputSection.h:51
uint32_t m_id
Unique identifier.
Definition: OutputSection.h:44
smart_ptr< OptionContext > m_options
Options associated with just this section.
Definition: OutputSection.h:45
Simple, standard smart pointer class.
Definition: apps/elftosb/common/smart_ptr.h:18
A section of the output file that contains arbitrary binary data.
Definition: OutputSection.h:71
void setOptions(OptionContext *context)
Set the option context.
Definition: OutputSection.h:40
Definition: BootImage.h:13
Pure abstract interface class to a table of options.
Definition: apps/elftosb/common/OptionContext.h:18
Manages a binary object of arbitrary length.
Definition: apps/elftosb/common/Blob.h:18
Base class for data model of sections of the output file.
Definition: OutputSection.h:20
const OptionContext * getOptions() const
Return the option context.
Definition: OutputSection.h:42