Kinetis Bootloader Host  2.0.0
Host Tools for Kinetis devices
elftosb::UnmappedDataSource Class Reference

Data source for data that is not memory mapped (has no natural address). More...

#include <DataSource.h>

+ Inheritance diagram for elftosb::UnmappedDataSource:
+ Collaboration diagram for elftosb::UnmappedDataSource:

Public Member Functions

 UnmappedDataSource ()
 Default constructor.
 
 UnmappedDataSource (const uint8_t *data, unsigned length)
 Constructor taking the data, which is copied.
 
void setData (const uint8_t *data, unsigned length)
 Sets the source's data. More...
 
virtual unsigned getSegmentCount ()
 There is only one segment.
 
virtual DataSource::SegmentgetSegmentAt (unsigned index)
 Returns this object, as it is its own segment.
 
Segment methods
virtual bool hasNaturalLocation ()
 Unmapped data sources have no natural address.
 
virtual unsigned getData (unsigned offset, unsigned maxBytes, uint8_t *buffer)
 Copies a portion of the data into buffer.
 
virtual unsigned getLength ()
 Returns the number of bytes of data managed by the source.
 
- Public Member Functions inherited from elftosb::DataSource
 DataSource ()
 Default constructor.
 
virtual ~DataSource ()
 Destructor.
 
void setTarget (DataTarget *target)
 Sets the associated data target.
 
DataTargetgetTarget () const
 Gets the associated data target.
 
- Public Member Functions inherited from elftosb::DataSource::Segment
 Segment (DataSource &source)
 Default constructor.
 
virtual ~Segment ()
 Destructor.
 
virtual uint32_t getBaseAddress ()
 Returns the address associated with the segment.
 

Protected Attributes

smart_array_ptr< uint8_t > m_data
 The data.
 
unsigned m_length
 Byte count of the data.
 
- Protected Attributes inherited from elftosb::DataSource
DataTargetm_target
 Corresponding target for this source.
 
- Protected Attributes inherited from elftosb::DataSource::Segment
DataSourcem_source
 The data source to which this segment belongs.
 

Detailed Description

Data source for data that is not memory mapped (has no natural address).

This data source can only manage a single block of data, which has no associated address. It acts as its own Segment.

Member Function Documentation

void UnmappedDataSource::setData ( const uint8_t *  data,
unsigned  length 
)

Sets the source's data.

Makes a copy of data that is freed when the data source is destroyed. The caller does not have to maintain data after this call returns.


The documentation for this class was generated from the following files: