OutputSection.h
/*
* File: OutputSection.h
*
* Copyright (c) Freescale Semiconductor, Inc. All rights reserved.
* See included license file for license details.
*/
#if !defined(_OutputSection_h_)
#define _OutputSection_h_
#include "Operation.h"
#include "smart_ptr.h"
#include "Blob.h"
#include "OptionContext.h"
namespace elftosb
{
class OutputSection
{
public:
OutputSection()
: m_id(0)
, m_options(0)
{
}
OutputSection(uint32_t identifier)
: m_id(identifier)
, m_options(0)
{
}
virtual ~OutputSection() {}
void setIdentifier(uint32_t identifier) { m_id = identifier; }
uint32_t getIdentifier() const { return m_id; }
inline void setOptions(OptionContext *context) { m_options = context; }
inline const OptionContext *getOptions() const { return m_options; }
protected:
uint32_t m_id;
smart_ptr<OptionContext> m_options;
};
class OperationSequenceSection : public OutputSection
{
public:
OperationSequenceSection()
: OutputSection()
{
}
OperationSequenceSection(uint32_t identifier)
: OutputSection(identifier)
{
}
OperationSequence &getSequence() { return m_sequence; }
protected:
OperationSequence m_sequence;
};
class BinaryDataSection : public OutputSection, public Blob
{
public:
BinaryDataSection()
: OutputSection()
, Blob()
{
}
BinaryDataSection(uint32_t identifier)
: OutputSection(identifier)
, Blob()
{
}
};
}; // namespace elftosb
#endif // _OutputSection_h_
elftosb::OperationSequence
Ordered sequence of operations.
Definition: Operation.h:323
elftosb::OperationSequenceSection
A section of the output that contains boot operations.
Definition: OutputSection.h:51
elftosb::OutputSection::m_id
uint32_t m_id
Unique identifier.
Definition: OutputSection.h:44
elftosb::OutputSection::m_options
smart_ptr< OptionContext > m_options
Options associated with just this section.
Definition: OutputSection.h:45
smart_ptr
Simple, standard smart pointer class.
Definition: apps/elftosb/common/smart_ptr.h:18
elftosb::BinaryDataSection
A section of the output file that contains arbitrary binary data.
Definition: OutputSection.h:71
elftosb::OutputSection::setOptions
void setOptions(OptionContext *context)
Set the option context.
Definition: OutputSection.h:40
elftosb
Definition: BootImage.h:13
elftosb::OptionContext
Pure abstract interface class to a table of options.
Definition: apps/elftosb/common/OptionContext.h:18
Blob
Manages a binary object of arbitrary length.
Definition: apps/elftosb/common/Blob.h:18
elftosb::OutputSection
Base class for data model of sections of the output file.
Definition: OutputSection.h:20
elftosb::OutputSection::getOptions
const OptionContext * getOptions() const
Return the option context.
Definition: OutputSection.h:42