Time for a little redesign of the Visualizer.
[aesalon.git] / modules / memory / src / artisan / DataStore.cpp
blob397d98ca6ae2c965c94f2156a9d38599dfccc49c
1 #include "DataStore.h"
3 #include "util/MessageSystem.h"
4 #include "artisan/gviewport/RectObject.h"
6 DataStore::DataStore() {
7 m_data = new Artisan::GViewport::Data();
10 DataStore::~DataStore() {
14 void DataStore::process(Comm::Packet *packet) {
15 uint8_t type = packet->data()[0];
17 if(type == 0) Message(Warning, "Unknown memory packet type . . .");
18 else if(type == 1) {
19 Message(Debug, "calloc() packet . . .");
21 else if(type == 2) {
22 uint64_t *data = reinterpret_cast<uint64_t *>(packet->data() + 1);
23 Message(Debug, "malloc() packet . . .");
24 uint64_t timestamp = data[0];
25 uint64_t address = data[1];
26 uint64_t size = data[2];
27 Artisan::GViewport::Object *object = new Artisan::GViewport::RectObject(
28 Artisan::GViewport::Rect(timestamp, -1, address, address+size));
29 m_data->addObject(object);
31 else if(type == 3) {
32 Message(Debug, "free() packet . . .");
34 else if(type == 4) {
35 Message(Debug, "realloc() packet . . .");