#include <traceval.h>
Public Member Functions | |
void | SetSingleDeviceApp (void) |
Tell DumpManager, that we have only one device. | |
void | addDumper (Dumper *dump, const TraceSet &vals) |
void | start () |
void | stopApplication (void) |
Stop processing on all dumpers and removes it from dumpers list. | |
void | cycle () |
~DumpManager () | |
Destroys the DumpManager instance and shut down all dumpers. | |
void | save (std::ostream &os) const |
TraceSet | load (std::istream &is) |
TraceSet | load (const std::string &istr) |
const TraceSet & | all () |
Static Public Member Functions | |
static DumpManager * | Instance (void) |
Singleton class access. | |
Private Member Functions | |
DumpManager () | |
Private instance constructor. | |
void | appendDeviceName (std::string &s) |
append a unique device name to a string | |
void | registerAvrDevice (AvrDevice *dev) |
Add a device to devicelist. | |
void | unregisterAvrDevice (AvrDevice *dev) |
Remove a device from devicelist. | |
TraceValue * | seekValueByName (const std::string &name) |
Seek value by name in all devices. | |
Private Attributes | |
bool | singleDeviceApp |
Flag, if we use only one device, e.g. assign no device name. | |
TraceSet | active |
Set of active tracing values. | |
TraceSet | _all |
Set of all traceable values (placeholder instance for all() method). | |
std::vector< Dumper * > | dumps |
All dumpers, which we want to use. | |
std::vector< AvrDevice * > | devices |
Device list. | |
Friends | |
class | TraceValueRegister |
class | AvrDevice |
Manages all active Dumper instances for a given AvrDevice. It also manages all trace values and sets them active as necessary.
Definition at line 329 of file traceval.h.
DumpManager::~DumpManager | ( | ) | [inline] |
Destroys the DumpManager instance and shut down all dumpers.
Definition at line 361 of file traceval.h.
References stopApplication().
DumpManager::DumpManager | ( | ) | [private] |
Private instance constructor.
Definition at line 530 of file traceval.cpp.
References singleDeviceApp.
Referenced by Instance().
Add a dumper to the list. The vector vals contains all the values this dumper should trace.
Definition at line 581 of file traceval.cpp.
References active, avr_error, dumps, and Dumper::setActiveSignals().
Referenced by SetDumpTraceArgs().
const TraceSet & DumpManager::all | ( | ) |
Gives all available tracers as a set.
Definition at line 598 of file traceval.cpp.
Referenced by SetDumpTraceArgs().
void DumpManager::appendDeviceName | ( | std::string & | s | ) | [private] |
append a unique device name to a string
Definition at line 534 of file traceval.cpp.
References avr_error, int2str(), and singleDeviceApp.
Referenced by TraceValueRegister::TraceValueRegister().
void DumpManager::cycle | ( | ) |
Process one AVR clock cycle. Must be done after the AVR did all processing so that changed values etc. can be collected.
Definition at line 626 of file traceval.cpp.
Referenced by AvrDevice::Step().
DumpManager * DumpManager::Instance | ( | void | ) | [static] |
Singleton class access.
Definition at line 523 of file traceval.cpp.
References DumpManager().
Referenced by avr_dump_start_tf(), avr_dump_stop_tf(), AvrDevice::AvrDevice(), main(), SetDumpTraceArgs(), ShowRegisteredTraceValues(), and TraceValueRegister::TraceValueRegister().
TraceSet DumpManager::load | ( | const std::string & | istr | ) |
Load a list of tracing values from the given input string. Checks whether the values are part of the set of traceable values.
Definition at line 724 of file traceval.cpp.
References load().
TraceSet DumpManager::load | ( | std::istream & | is | ) |
Load a list of tracing values from the given input stream. Checks whether the values are part of the set of traceable values.
Definition at line 680 of file traceval.cpp.
References avr_error, int2str(), readline(), seekValueByName(), and split().
Referenced by load(), and SetDumpTraceArgs().
void DumpManager::registerAvrDevice | ( | AvrDevice * | dev | ) | [private] |
Add a device to devicelist.
Definition at line 543 of file traceval.cpp.
References devices.
Referenced by AvrDevice::AvrDevice().
void DumpManager::save | ( | std::ostream & | os | ) | const |
Write a list of all tracing value names into the given output stream.
Definition at line 649 of file traceval.cpp.
References TraceValue::barename(), devices, and TraceValue::index().
Referenced by ShowRegisteredTraceValues().
TraceValue * DumpManager::seekValueByName | ( | const std::string & | name | ) | [private] |
Seek value by name in all devices.
Definition at line 557 of file traceval.cpp.
References devices, and singleDeviceApp.
Referenced by load().
void DumpManager::SetSingleDeviceApp | ( | void | ) |
Tell DumpManager, that we have only one device.
In normal simulavr application we have only one device aka processor. But it's possible to make a simulation with 2 or more devices together. For that, we have to assign a unique name for every device to identify a device and to get a unique namespace in trace output.
This method has to be called *before* the device instance will be created in single device application! Default is multi device application.
Definition at line 575 of file traceval.cpp.
References avr_error, devices, and singleDeviceApp.
Referenced by main().
void DumpManager::start | ( | ) |
Start processing on all dumpers. They will be stopped when stopApplication method will be called or the dump manager gets destroyed.
Definition at line 620 of file traceval.cpp.
References dumps.
Referenced by avr_dump_start_tf(), and main().
void DumpManager::stopApplication | ( | void | ) |
Stop processing on all dumpers and removes it from dumpers list.
Definition at line 641 of file traceval.cpp.
References dumps.
Referenced by avr_dump_stop_tf(), main(), and ~DumpManager().
void DumpManager::unregisterAvrDevice | ( | AvrDevice * | dev | ) | [private] |
Remove a device from devicelist.
Definition at line 547 of file traceval.cpp.
References devices.
Referenced by AvrDevice::~AvrDevice().
friend class AvrDevice [friend] |
Definition at line 384 of file traceval.h.
friend class TraceValueRegister [friend] |
Definition at line 383 of file traceval.h.
TraceSet DumpManager::_all [private] |
Set of all traceable values (placeholder instance for all() method).
Definition at line 407 of file traceval.h.
Referenced by all().
TraceSet DumpManager::active [private] |
Set of active tracing values.
Definition at line 405 of file traceval.h.
Referenced by addDumper(), and cycle().
std::vector<AvrDevice*> DumpManager::devices [private] |
Device list.
Definition at line 413 of file traceval.h.
Referenced by all(), registerAvrDevice(), save(), seekValueByName(), SetSingleDeviceApp(), and unregisterAvrDevice().
std::vector<Dumper*> DumpManager::dumps [private] |
All dumpers, which we want to use.
Definition at line 410 of file traceval.h.
Referenced by addDumper(), cycle(), start(), and stopApplication().
bool DumpManager::singleDeviceApp [private] |
Flag, if we use only one device, e.g. assign no device name.
Definition at line 402 of file traceval.h.
Referenced by appendDeviceName(), DumpManager(), seekValueByName(), and SetSingleDeviceApp().