RASCSI/cpp/monitor/sm_core.h
Uwe Seimet 41bdcd4aed
Issues 1179 and 1182 (#1232)
* Update logging

* Remove duplicate code

* Update unit tests

* Clean up includes

* Merge ProtobufSerializer into protobuf_util namespace

* Precompile regex

* Add const

* Add Split() convenience method, update log level/ID parsing

* Move log.h to legacy folder

* Elimininate gotos

* Fixes for gcc 13

* Update compiler flags

* Update default folder handling

* Use references instead of pointers

* Move code for better encapsulation

* Move code

* Remove unused method argument

* Move device logger

* Remove redundant to_string

* Rename for consistency

* Update handling of protobuf pointers

* Simplify protobuf usage

* Memory handling update

* Add hasher
2023-10-15 08:38:15 +02:00

61 lines
1.2 KiB
C++

//---------------------------------------------------------------------------
//
// SCSI Target Emulator PiSCSI
// for Raspberry Pi
//
// Copyright (C) 2022-2023 Uwe Seimet
//
//---------------------------------------------------------------------------
#pragma once
#include "hal/bus.h"
#include "hal/data_sample.h"
#include <memory>
#include <vector>
#include <atomic>
using namespace std;
// TODO Make static fields/methods non-static
class ScsiMon
{
public:
ScsiMon() = default;
~ScsiMon() = default;
int run(const vector<char *> &);
inline static double ns_per_loop;
private:
void ParseArguments(const vector<char *> &);
void PrintHelpText(const vector<char *> &) const;
void Banner() const;
bool Init();
void Cleanup() const;
void Reset() const;
static void KillHandler(int);
static inline atomic<bool> running;
shared_ptr<BUS> bus;
uint32_t buff_size = 1000000;
vector<shared_ptr<DataSample>> data_buffer;
uint32_t data_idx = 0;
bool print_help = false;
bool import_data = false;
string file_base_name = "log";
string vcd_file_name;
string json_file_name;
string html_file_name;
string input_file_name;
};