simulavr  1.1.0
RWWriteToFile Class Reference

FIFO write memory. More...

#include <specialmem.h>

Inheritance diagram for RWWriteToFile:

Public Member Functions

 RWWriteToFile (TraceValueRegister *registry, const std::string &tracename, const std::string &filename)
 
- Public Member Functions inherited from RWMemoryMember
 RWMemoryMember (TraceValueRegister *registry, const std::string &tracename="", const int index=-1)
 
 RWMemoryMember (void)
 
 operator unsigned char () const
 Read access on memory. More...
 
unsigned char operator= (unsigned char val)
 Write access on memory. More...
 
unsigned char operator= (const RWMemoryMember &mm)
 Write access on memory. More...
 
virtual ~RWMemoryMember ()
 
virtual void set_bit (unsigned int bitaddr)
 
virtual void clear_bit (unsigned int bitaddr)
 
const std::string & GetTraceName (void)
 
bool IsInvalid (void) const
 

Protected Member Functions

unsigned char get () const
 
void set (unsigned char)
 

Protected Attributes

std::ostream & os
 
std::ofstream ofs
 
- Protected Attributes inherited from RWMemoryMember
TraceValuetv
 
TraceValueRegisterregistry
 
const std::string tracename
 
const bool isInvalid
 

Private Attributes

unsigned char value
 

Detailed Description

FIFO write memory.

Memory register which will redirect all write accesses to the given (FIFO) file. The output format in the file is binary.

Definition at line 39 of file specialmem.h.

Constructor & Destructor Documentation

◆ RWWriteToFile()

RWWriteToFile::RWWriteToFile ( TraceValueRegister registry,
const std::string &  tracename,
const std::string &  filename 
)

The output filename can be '-' which will make this object use cout then.

Definition at line 33 of file specialmem.cpp.

References ofs.

Member Function Documentation

◆ get()

unsigned char RWWriteToFile::get ( ) const
protectedvirtual

This function as the oppposite to get() is expected to read the real byte.

Implements RWMemoryMember.

Definition at line 50 of file specialmem.cpp.

References avr_warning, global_suppress_memory_warnings, and value.

◆ set()

void RWWriteToFile::set ( unsigned  nv)
protectedvirtual

This function is the function which will be called by the above access operators and is expected to do the real work when writing a byte.

Implements RWMemoryMember.

Definition at line 44 of file specialmem.cpp.

References os, and value.

Member Data Documentation

◆ ofs

std::ofstream RWWriteToFile::ofs
protected

Definition at line 53 of file specialmem.h.

Referenced by RWWriteToFile().

◆ os

std::ostream& RWWriteToFile::os
protected

Definition at line 52 of file specialmem.h.

Referenced by set().

◆ value

unsigned char RWWriteToFile::value
private

Definition at line 56 of file specialmem.h.

Referenced by get(), and set().


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