Class sh::base::ShallotProcess

class sh::base::ShallotProcess : public sh::base::Singleton

Provides parameters given from the user by command line and some more simple infos.

Public Functions

QString uiMode()

The ui mode (e.g. “qt”, “web”) specified on command line.

QMap<QString, QString> configurationValueAssignments()

The configuration value assignments set on command line.

QList<QString> configurationValueFiles()

The configuration value files set on command line.

QString parameterValue(QString key, QString deflt = QString())

Returns the command line parameter value for a key as string.

QStringList parameterValueList(QString key)

Returns the command line parameter value for a key as list of strings (for multiple parameter usage).

qint64 parameterValueInt(QString key, qint64 deflt = 0)

Returns the command line parameter value for a key as integer.

QStringList parameters()

Returns the list of keys of all specified command line parameter names.

QString initialWorkDirectory()

Returns the initial directory specified on command line.

QString logPrefix()

Returns the log prefix (i.e. an optional string all log output begins with) specified on command line.

QStringList lang()

Returns the ui language specified on command line.

QColor brandingColor()

Returns the Shallot branding color (typically a dark red).

int minport()

Return the minimal allowed port specified on command line (for web ui).

int maxport()

Return the maximal allowed port specified on command line (for web ui).

int workerminport()

Return the minimal allowed port specified on command line for spawing web workers with (for web ui).

int workermaxport()

Return the maximal allowed port specified on command line for spawing web workers with (for web ui).

int maxnumberworkers(int deflt)

Maximum number of workers specified on command line.

int maxnumberworkersperhost(int deflt)

Maximum number of workers per host specified on command line.

int maxmemorypercent(int deflt)

Maximum memory in percent specified on command line.

int maxmemorypercentglobal(int deflt)

Maximum memory in percent globally specified on command line.

int maxbrowserawayseconds(int deflt)

Maximum browser away time in seconds specified on command line.

int maxidlenessseconds(int deflt)

Maximum user idleness time in seconds specified on command line.

void doInitialize()

Executes singleton initialization.

void doShutdown()

Executes singleton shutdown.

void shutdown()

Shutdown down this singleton.

bool isAlive()

Returns if this singleton is alive (true until its shutdown begins).

Public Static Functions

QString userDataDir()

Returns the path to a storage for per-user data. It resides somewhere within the user home directory.

QString shallotDataDir()

Returns the directory of the Shallot program data. It contains the static files which are part of the Shallot program.

QString revisionString()

Returns the Shallot revision string, i.e. the exact version number. Note: This is only updated by a special build tool (anise) and not by directly compiling via qmake.

QString homepage()

Returns the url to the Shallot homepage.

QDateTime buildtime()

Returns the time when this Shallot build was created. Note: This is only updated by a special build tool (anise) and not by directly compiling via qmake.

Private Functions

ShallotProcess()

Private Members

QMutex _brandingcolormutex
QMap<QString, QStringList> _cmdlineargs
QString _workdir
QString _ui
QMap<QString, QString> _cfgvalassignments
QList<QString> _cfgvalfiles
QColor _brandingcolor
std::shared_ptr<sh::configuration::ConfigurationValue> cfgvalBrandingColor
int _minport = 0
int _maxport = 0
int _workerminport = 0
int _workermaxport = 0