srecord  1.65.0
writer.h
Go to the documentation of this file.
1 //
2 // srecord - manipulate eprom load files
3 // Copyright (C) 1998, 1999, 2002, 2003, 2006-2008, 2010 Peter Miller
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this program. If not, see
17 // <http://www.gnu.org/licenses/>.
18 //
19 
20 #ifndef SRECORD_MEMORY_WALKER_WRITER_H
21 #define SRECORD_MEMORY_WALKER_WRITER_H
22 
23 #include <srecord/memory/walker.h>
24 #include <srecord/output.h>
25 
26 namespace srecord {
27 
28 /**
29  * The srecord::memory_walker_writer class is used to write data to an
30  * output stream when a memory image is walked.
31  */
33  public memory_walker
34 {
35 public:
36  /**
37  * the destructor.
38  */
40 
41 private:
42  /**
43  * The constructor. It is private on purpose, use the #create
44  * class method instead.
45  *
46  * @param deeper
47  * where to write the output
48  */
50 
51 public:
52  /**
53  * The create class method is used to create new dynamically
54  * allocated instances of this class.
55  *
56  * @param deeper
57  * where to write the output
58  */
59  static pointer create(const output::pointer &deeper);
60 
61 protected:
62  // See base class for documentation.
63  virtual void observe(unsigned long, const void *, int);
64 
65  // See base class for documentation.
66  void notify_upper_bound(long unsigned);
67 
68  // See base class for documentation.
69  void observe_header(const record *);
70 
71  // See base class for documentation.
73 
74 private:
75  /**
76  * The op instance variabel is used to remember where to send
77  * the output.
78  */
79  output::pointer op;
80 
81  /**
82  * The default constructor. Do not use.
83  */
85 
86  /**
87  * The copy constructor. Do not use.
88  */
90 
91  /**
92  * The assignment operator. Do not use.
93  */
94  memory_walker_writer &operator=(const memory_walker_writer &);
95 };
96 
97 }
98 
99 #endif // SRECORD_MEMORY_WALKER_WRITER_H
The srecord::memory_walker_writer class is used to write data to an output stream when a memory image...
Definition: writer.h:34
void notify_upper_bound(long unsigned)
virtual ~memory_walker_writer()
the destructor.
void observe_header(const record *)
The observe_header method is used to inform the walker of the header record.
static pointer create(const output::pointer &deeper)
The create class method is used to create new dynamically allocated instances of this class.
virtual void observe(unsigned long, const void *, int)
The observe method is used by the memory walker to provide data.
void observe_start_address(const record *)
The observe_start_address method is used to inform the walker of the execution start address record.
The srecord::memory_walker class is used to represent an abstract handler for the action to perform w...
Definition: walker.h:34
std::shared_ptr< memory_walker > pointer
Definition: walker.h:36
std::shared_ptr< output > pointer
Definition: output.h:41
The srecord::record class is used to represent a data record read from a file.
Definition: record.h:35