Files

82 lines
1.5 KiB
C++

/*
* Copyright (c) 2025 Fraunhofer IESE. All rights reserved.
*
* Authors:
* Iron Prando da Silva
*/
#pragma once
#include "QStringComparator.h"
#include <map>
class StringMapper
{
public:
enum Identifier
{
None,
CMD_BUS,
RAS_BUS,
CAS_BUS,
NAW,
FAW,
_32AW,
FAW_LOGICAL,
FAW_PHYSICAL,
REFAB,
PREAB,
PDEP,
PDXP,
SREFEN,
SREFEX,
PDEA,
PDXA,
SRPDEN,
SRPDEX,
ACT,
RD,
WR,
PREPB,
RDA,
WRA,
REFPB,
REFP2B,
PRESB,
RFMAB,
REFSB,
RFMSB
};
public:
StringMapper() = default;
StringMapper(const QString& id);
StringMapper(const char* str) : StringMapper(std::forward<QString>(str)) {}
~StringMapper() = default;
Identifier getIDEnum() const { return mIDEnum; }
const QString getIDStr() const { return mIDStr; }
bool isPool() const { return mIsPool; }
static QString getIDStr(Identifier);
static Identifier getIDEnum(const QString&);
bool operator==(const StringMapper&) const;
bool operator!=(const StringMapper&) const;
bool operator<(const StringMapper&) const;
bool operator==(const Identifier&) const;
bool operator!=(const Identifier&) const;
static bool compare(const StringMapper&, const StringMapper&);
protected:
Identifier mIDEnum = None;
QString mIDStr = "";
bool mIsPool = false;
protected:
static bool mAuxIsPool(Identifier);
};