Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
CLogicsAllowed Class Reference

#include <CLogicsAllowed.hpp>

Collaboration diagram for CLogicsAllowed:
[legend]

Classes

struct  SBlockData
 
struct  SPrvDBVersion
 

Public Types

typedef std::map< iv::logic::ParamId, std::string > TMapDBBlockParamNStr
 
typedef std::map< iv::logic::eDBBlockParamType, uint8_t > TMapDBBlockParamSize
 
typedef std::map< uint32_t, std::string > TMapBlockTypeDescription
 
typedef std::map< iv::logic::LogicBlockId, SBlockDataTMapBlockSubTypeData
 

Public Member Functions

uint8_t blockExtraSize (uint32_t blockType, uint32_t blockSubType) const
 
std::string blockName (uint32_t blockType, uint32_t blockSubType) const
 
TMapDBBlockParamNStr blockParamsDesc (uint32_t blockType, uint32_t blockSubType) const
 
uint8_t blockSize (uint32_t blockType, uint32_t blockSubType) const
 
std::string dbVersion () const
 
bool loadData ()
 
bool isAllowedSubtypeInLOM (uint32_t idLOM, uint32_t idSubtype)
 
bool isEmpty () const
 
TMapBlockSubTypeData getBlockSubTypes () const
 
TMapBlockTypeDescription getBlockTypesDesc () const
 
const std::string & getErrorText () const
 
const TMapDBBlockParamSizegetParamSizes () const
 
bool isDataLoadedOk () const
 
void eraseSubType (iv::logic::LogicBlockId pairTypeSubType)
 
void collapseTreeStructure ()
 
virtual ~CLogicsAllowed ()=default
 
 CLogicsAllowed ()
 

Static Public Member Functions

static iv::logic::eDBBlockParamType enumDBBlockParamType (std::string_view strType)
 
static std::string_view strDBBlockParamType (iv::logic::eDBBlockParamType type)
 
static std::string getDefaultParameterValue (iv::logic::eDBBlockParamType paramType)
 
static std::optional< std::string > getSpecificDefaultParameterValue (iv::logic::LogicBlockId blockId, iv::logic::ParamId paramId)
 
static bool isEditableDBBlockParam (iv::logic::eDBBlockParamType type)
 
static bool allowsExternalDescriptionDBBlockParam (iv::logic::eDBBlockParamType type)
 
static bool allowsParameterOnlineDBBlockParam (iv::logic::eDBBlockParamType type)
 
static CLogicsAllowedgetInstance ()
 

Private Member Functions

void prvReadTable (const std::string &tableName)
 
void prvExtractBlockParams ()
 
void prvExtractBlockParamsSize ()
 
void prvExtractBlockSubTypeParams (uint32_t blockType, uint32_t blockSubType)
 
void prvExtractBlockSubTypes ()
 
void prvExtractBlockTypes ()
 
void prvExtractVersion ()
 
void prvExtractBlockAllowedSubTypes ()
 
void prvCalculateAndStoreBlocksSize ()
 
void prvCalculateAndStoreData ()
 

Private Attributes

bool m_isDataLoadedOk {}
 
std::string m_errorText {}
 
SPrvDBVersion m_dbVersion {}
 
TMapDBBlockParamSize m_mapBlockParamSize {}
 
TMapBlockTypeDescription m_mapBlockTypesDesc {}
 
TMapBlockSubTypeData m_mapBlockSubTypesData {}
 
std::set< std::pair< uint32_t, uint32_t > > m_setIdTypeLOMIdSubtype {}
 

Detailed Description

Singleton class interface between the data source (CPathResources::getPathDefParamsDatabaseEditorDiamar() for the moment) and the logics editor. It will read the data needed by the editor and will provide methods to retrieve it. The data obtained from this class will limit the logic components allowed to be used in the editor.

NOTE: SQL syntax allowed by 'mdbtools' is very limited, thus more code than usual will be needed to obtain the information we need from the database.

Member Typedef Documentation

◆ TMapBlockSubTypeData

◆ TMapBlockTypeDescription

std::map<uint32_t, std::string> CLogicsAllowed::TMapBlockTypeDescription

◆ TMapDBBlockParamNStr

◆ TMapDBBlockParamSize

Constructor & Destructor Documentation

◆ ~CLogicsAllowed()

virtual CLogicsAllowed::~CLogicsAllowed ( )
virtualdefault

◆ CLogicsAllowed()

CLogicsAllowed::CLogicsAllowed ( )

Member Function Documentation

◆ allowsExternalDescriptionDBBlockParam()

bool CLogicsAllowed::allowsExternalDescriptionDBBlockParam ( iv::logic::eDBBlockParamType type)
static

◆ allowsParameterOnlineDBBlockParam()

bool CLogicsAllowed::allowsParameterOnlineDBBlockParam ( iv::logic::eDBBlockParamType type)
static

◆ blockExtraSize()

uint8_t CLogicsAllowed::blockExtraSize ( uint32_t blockType,
uint32_t blockSubType ) const
nodiscard

◆ blockName()

std::string CLogicsAllowed::blockName ( uint32_t blockType,
uint32_t blockSubType ) const
nodiscard

◆ blockParamsDesc()

CLogicsAllowed::TMapDBBlockParamNStr CLogicsAllowed::blockParamsDesc ( uint32_t blockType,
uint32_t blockSubType ) const
nodiscard

◆ blockSize()

uint8_t CLogicsAllowed::blockSize ( uint32_t blockType,
uint32_t blockSubType ) const
nodiscard

◆ collapseTreeStructure()

void CLogicsAllowed::collapseTreeStructure ( )

◆ dbVersion()

std::string CLogicsAllowed::dbVersion ( ) const
nodiscard

◆ enumDBBlockParamType()

iv::logic::eDBBlockParamType CLogicsAllowed::enumDBBlockParamType ( std::string_view strType)
static

◆ eraseSubType()

void CLogicsAllowed::eraseSubType ( iv::logic::LogicBlockId pairTypeSubType)

◆ getBlockSubTypes()

CLogicsAllowed::TMapBlockSubTypeData CLogicsAllowed::getBlockSubTypes ( ) const
nodiscard

Obtains a map whose key is a pair holding the block's type and subtype, and whose value is the name of the block.

◆ getBlockTypesDesc()

CLogicsAllowed::TMapBlockTypeDescription CLogicsAllowed::getBlockTypesDesc ( ) const
nodiscard

◆ getDefaultParameterValue()

std::string CLogicsAllowed::getDefaultParameterValue ( iv::logic::eDBBlockParamType paramType)
static

◆ getErrorText()

const std::string & CLogicsAllowed::getErrorText ( ) const
nodiscard

◆ getInstance()

CLogicsAllowed & CLogicsAllowed::getInstance ( )
static

◆ getParamSizes()

const CLogicsAllowed::TMapDBBlockParamSize & CLogicsAllowed::getParamSizes ( ) const
nodiscard

◆ getSpecificDefaultParameterValue()

std::optional< std::string > CLogicsAllowed::getSpecificDefaultParameterValue ( iv::logic::LogicBlockId blockId,
iv::logic::ParamId paramId )
static

◆ isAllowedSubtypeInLOM()

bool CLogicsAllowed::isAllowedSubtypeInLOM ( uint32_t idLOM,
uint32_t idSubtype )

◆ isDataLoadedOk()

bool CLogicsAllowed::isDataLoadedOk ( ) const
nodiscard

◆ isEditableDBBlockParam()

bool CLogicsAllowed::isEditableDBBlockParam ( iv::logic::eDBBlockParamType type)
static

◆ isEmpty()

bool CLogicsAllowed::isEmpty ( ) const

◆ loadData()

bool CLogicsAllowed::loadData ( )

Returns true if data loaded successfully; false otherwise. Updates status (m_isOk and m_errorText).

◆ prvCalculateAndStoreBlocksSize()

void CLogicsAllowed::prvCalculateAndStoreBlocksSize ( )
private

◆ prvCalculateAndStoreData()

void CLogicsAllowed::prvCalculateAndStoreData ( )
private

◆ prvExtractBlockAllowedSubTypes()

void CLogicsAllowed::prvExtractBlockAllowedSubTypes ( )
private

◆ prvExtractBlockParams()

void CLogicsAllowed::prvExtractBlockParams ( )
private

◆ prvExtractBlockParamsSize()

void CLogicsAllowed::prvExtractBlockParamsSize ( )
private

◆ prvExtractBlockSubTypeParams()

void CLogicsAllowed::prvExtractBlockSubTypeParams ( uint32_t blockType,
uint32_t blockSubType )
private

◆ prvExtractBlockSubTypes()

void CLogicsAllowed::prvExtractBlockSubTypes ( )
private

◆ prvExtractBlockTypes()

void CLogicsAllowed::prvExtractBlockTypes ( )
private

◆ prvExtractVersion()

void CLogicsAllowed::prvExtractVersion ( )
private

◆ prvReadTable()

void CLogicsAllowed::prvReadTable ( const std::string & tableName)
private

◆ strDBBlockParamType()

std::string_view CLogicsAllowed::strDBBlockParamType ( iv::logic::eDBBlockParamType type)
static

Member Data Documentation

◆ m_dbVersion

SPrvDBVersion CLogicsAllowed::m_dbVersion {}
private

◆ m_errorText

std::string CLogicsAllowed::m_errorText {}
private

◆ m_isDataLoadedOk

bool CLogicsAllowed::m_isDataLoadedOk {}
private

◆ m_mapBlockParamSize

TMapDBBlockParamSize CLogicsAllowed::m_mapBlockParamSize {}
private

◆ m_mapBlockSubTypesData

TMapBlockSubTypeData CLogicsAllowed::m_mapBlockSubTypesData {}
private

◆ m_mapBlockTypesDesc

TMapBlockTypeDescription CLogicsAllowed::m_mapBlockTypesDesc {}
private

◆ m_setIdTypeLOMIdSubtype

std::set<std::pair<uint32_t, uint32_t> > CLogicsAllowed::m_setIdTypeLOMIdSubtype {}
private

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