stec-platform
PersistenceSettingRetention Class Reference

The PersistenceSettingRetention class retention of subscription data that is used within mutilverse for setup data. More...

#include <persistencesettingretention.h>

Inheritance diagram for PersistenceSettingRetention:
Collaboration diagram for PersistenceSettingRetention:

Public Member Functions

 PersistenceSettingRetention (QString project, QString path="", QObject *parent=0)
 PersistenceSettingRetention. More...
 
virtual bool ReadValues (Subscription *subscriber)
 reads the last saved values of a subscriber More...
 
virtual void WriteValues (Subscription *subscriber)
 method for writing More...
 
virtual bool ReadValues (QString name, VremVArray &i1)
 reads the last saved values of a subscriber More...
 
virtual void WriteValues (QString name, const VremVArray i1)
 
- Public Member Functions inherited from Retain
 Retain (QObject *parent=nullptr)
 Retain. More...
 
virtual QString MangledKey (QString subscriber)
 a name that can be used if // or . are in it
 
virtual QString MangledKeyType (QString subscriber)
 a key that can be used if // or . are in it
 
virtual bool RemoveTracking (Subscription *subscriber)
 stops the tracking of data changes for a subscriber
 
virtual bool TrackValues (Subscription *subscriber)
 tracks the values of a subscriber
 

Additional Inherited Members

- Static Public Member Functions inherited from Retain
static QVariantList ConvertToQVariantList (const VremVArray &varray)
 
static VremVArray ConvertToVremVAarray (QVariantList &lst)
 

Detailed Description

The PersistenceSettingRetention class retention of subscription data that is used within mutilverse for setup data.

We do not use any database, but rather buit in Qt settings for retaining data for setup data This class is thread safe so all subscribers in different plugin can use it

Constructor & Destructor Documentation

◆ PersistenceSettingRetention()

PersistenceSettingRetention::PersistenceSettingRetention ( QString  project,
QString  path = "",
QObject parent = 0 
)
explicit

PersistenceSettingRetention.

Parameters
projectProject name
pathpath for storing retention files
parentQObject parent

make a file for ini stuff... but put it in the home dir is nothing was passed

Member Function Documentation

◆ ReadValues() [1/2]

bool PersistenceSettingRetention::ReadValues ( QString  name,
VremVArray &  i1 
)
virtual

reads the last saved values of a subscriber

put this out of the locker scope to make it faster

never use the reg if windows, this would be nuts. always use a inifile

cast the QVariant to a list

if there was never a list, return false. IE if never stored before make it return false

Reimplemented from Retain.

◆ ReadValues() [2/2]

bool PersistenceSettingRetention::ReadValues ( Subscription subscriber)
virtual

reads the last saved values of a subscriber

lock the QSetting files

make a key out of the name, use a mangle name type so it could work later with MySQL or SQLIte

put this out of the locker scope to make it faster

never use the reg if windows, this would be nuts. always use a inifile

cast the QVariant to a list

if there was never a list, return false. IE if never stored before make it return false

no, there is a values stored

Reimplemented from Retain.

◆ WriteValues() [1/2]

void PersistenceSettingRetention::WriteValues ( QString  name,
const VremVArray  i1 
)
virtual

make a key out of the name, use a mangle name type so it could work later with MySQL or SQLIte

convert them to a QVariantList

lock the file

write the QVariantList as a QVariant

Reimplemented from Retain.

◆ WriteValues() [2/2]

void PersistenceSettingRetention::WriteValues ( Subscription subscriber)
virtual

method for writing

lock the file

make a key out of the name, use a mangle name type so it could work later with MySQL or SQLIte

get all the values from the subsriber

convert them to a QVariantList

write the QVariantList as a QVariant

Reimplemented from Retain.


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