Workspace 6.21.5
Namespaces | Classes | Typedefs | Enumerations | Functions
CSIRO::Application Namespace Reference

Application-level functionality for all workspace applications.

Namespaces

namespace  __ClassConstraintsPrivate
 
namespace  IndexBasedIteratorPrivate
 
namespace  Josuttis
 
namespace  PluginManagerImplPrivate
 
namespace  PrivateInheritanceTests
 
namespace  PrivateStreamableTests
 
namespace  Tag
 
namespace  Ui
 
namespace  Web
 
namespace  WorkflowTreeStr
 

Classes

class  AgentSettings
 
class  ArgumentsParser
 Abstract base class for dealing with command line arguments. More...
 
class  BasicTextLogger
 Convenience class for writing to the log using an object, rather than inheritance. More...
 
class  BuiltinPlugin
 This is the built-in plugin class. More...
 
class  ConditionalAlphaNumericCompare
 Functor for comparing two strings differently if they are alphabetic vs numeric. If both strings are numbers, they will be compared numerically. If one or the other is a string, they will be compared as strings. More...
 
class  ConfigurePluginsDialog
 Dialog for configuring the workspace plugins. More...
 
class  ConfigurePluginsWidget
 Widget for configuring the workspace plugins. More...
 
class  ConfigureRemoteWidget
 Widget for configuring remote authentication details. More...
 
class  ConvertToLegacy
 
class  DirectoryFilter
 Provides a platform-independent way to get a filtered directory listing. More...
 
class  DistributedLogManager
 Singleton for managing the logging streams associated with execution threads. More...
 
class  DownloaderWidget
 
class  EmptyPluginConfig
 Provides a configuration widget for plugins with no configurable parameters. More...
 
class  EmptyPluginMenu
 A default implementation of PluginMenu for plugins that do not supply a custom menu for the Workspace editor. More...
 
class  EnforceCondition
 Generic class which is only defined when the template parameter is true. More...
 
class  EnforceCondition< true >
 
class  ExecutedWorkspaceHistory
 
class  ExecutionInspectorWidget
 
class  FileNameNaturalLessThan
 Compares two QFileInfo's "naturally". Numbers will be compared as numbers, strings compared as strings etc. More...
 
class  Filter
 Filter elements with given expressions. More...
 
class  ForcedShutdownEvent
 This event is raised by something that wants to force the application to quit. More...
 
class  GlobalNotifications
 Singleton on which application-wide notifications can be observed. More...
 
struct  HasOperatorEqual
 Constraints class for whether or not a type can be compared to another with operator==. More...
 
struct  HasOperatorLessThan
 Constraints class for whether or not a type can be compared to another with operator<. More...
 
class  HelpImplementation
 Base class for a help implementation. More...
 
class  HelpNetworkAccessManager
 
class  HelpPlugin
 Plugin providing a help implementation. More...
 
class  HelpViewer
 
class  HelpWindow
 
class  IndexBasedIterator
 Generic base class for adding support for iteration to index-based container classes. More...
 
class  IntegerRangeString
 Allow a user to use a range string in the form "-6, -3--1, 1-2, 3, 6" etc. Empty range string will match all. More...
 
class  IpcClient
 Local inter-process communication client. This client is part of a local inter-process communication (IPC) client-server architecture providing two-way communications between the workspace-server process and the child process spawned by workspace-server in remote execution. The IpcClient use QLocalSocket to communicate with IpcServer. Currently there is only one IpcClient per child process. But the code supports multiple IpcClients per IpcServer. The IpcClient connects to IpcServer on a port keyed by the workspace label that is executed in the child process. The connection IpcClient-IpcServer remains open as long as the child process is running. The IpcClient receives OperationUpdateEvent notifications from WorkspaceBatch (which runs the child process) and sends messages to IpcServer. More...
 
class  IpcServer
 Local inter-process communication server. This server is part of a local inter-process communication (IPC) client-server architecture providing two-way communications between the workspace-server process and the child process spawned by workspace-server in remote execution. The IpcServer use IpcServerSocket which wraps QLocalSocket to communicate with its possibly many connected IpcClients. There will be one IpcServer per WorkspaceObserver (hence per child process). The IpcServer listens on a port keyed by the workspace label that is executed in the child process. The connections IpcClients-IpcServer remains open as long as the child process is running. The IpcServer receives messages from IpcClients and notifies WorkspaceObserver about OperationUpdateEvent. More...
 
class  IpcServerSocket
 IpcServerSocket wraps QLocalSocket and represents a connection from IpcServer to one single IpcClient. More...
 
struct  IsContainer
 Constraints class for whether or not a type is a container. The determination is based on whether the type has a const_iterator type and begin() and end() functions that return that type. More...
 
class  IsDerivedFrom
 Define a constraints base class with a testable value. More...
 
struct  IsSortable
 Constraints class for whether or not a type is sortable; i.e. whether or not it can be compared against another using operator<(). More...
 
struct  IsSortableContainer
 Constraints class for whether or not a type is a sortable container; i.e. a container that can be compared using operator<(). This requires that its elements are also able to be sorted using operator<. More...
 
class  LicenseManager
 
class  LoggingThread
 Thread for modifying the log - writing to it, adding streams etc. More...
 
class  LogManager
 Singleton for managing the logging streams associated with execution threads. More...
 
class  LogManagerImplThreaded
 Implementation of the LogManager that supports logging from mulitiple threads simultaneously. More...
 
class  LogManagerImplUnthreaded
 Implementation of the LogManager that supports logging from a single thread only. More...
 
class  LogWorkflow
 LogStream subclass for directing a log stream to file. More...
 
class  Memento
 Utility class implementing a Memento design pattern. More...
 
class  OOPScheduleeArgumentsParser
 Helper class for dealing with command line arguments supplied to an OOP schedulee application. More...
 
class  OperationHelpGenerator
 Generates doxygen files for each operation registered with Workspace. More...
 
class  PerThreadNetworkAccessManager
 
class  PluginConfig
 Provider of a QWidget for configuring a plugin. You can use the Developer wizard to generate a stub implementation of this class. See Integrating a custom plugin settings widget into the Workspace Editor. More...
 
class  PluginManager
 Singleton responsible for tracking all operation factories in the application. More...
 
class  PluginMenu
 An interface for integrating a custom plugin menu into the Workspace editor. More...
 
class  ProcessWorkflows
 
class  QMyApplication
 
class  QProcessRobust
 Safer implementation of a subset of what QProcess tries to achieve. More...
 
class  QtDebugCapture
 Captures Qt debug messages. More...
 
class  RefCountedObject
 Base class for reference-counted objects. More...
 
class  RefCountedObjectPtr
 Template class for smart pointers-to-T objects (requires modification to T). More...
 
class  RefCountedPtr
 Template class for reference-counted pointers-to-T (T requires no special modification). More...
 
class  RemoteManager
 Singleton for handling network requests. More...
 
class  RemoteSchedulerDialog
 Widget for modifying the remote scheduler settings. More...
 
class  RemoteSchedulerService
 
class  RemoteSchedulerServiceBase
 
class  RemoteSchedulerWidget
 Widget for controlling the remote scheduler. More...
 
class  ScopedElapsedTimeLogger
 Measure and trace elapsed time during lifetime of object. More...
 
class  ScopeGuard
 Generic scopeguard to simplify RAII where cleanup is needed. More...
 
class  SessionHandler
 
class  SessionManager
 
class  Settings
 Singleton class holding the settings for the Workspace. More...
 
class  SettingsMap
 This abstract class stores settings information and current value. It wraps around QMap that maps some type of settings Enum to a QVariant. More...
 
class  SettingsVariables
 Singleton class for storing settings variables. More...
 
class  ShutdownEvent
 Event raised when the main application event loop stops. More...
 
class  Smtp
 
class  SoundEffectRegistry
 Sound effect registry. More...
 
class  StandAloneWindow
 
struct  Streamable
 Traits class to determine if a type T supports output and input streaming. More...
 
struct  StreamableIn
 Traits class to determine if a type T supports input streaming. More...
 
struct  StreamableOut
 Traits class to determine if a type T supports output streaming. More...
 
class  TestIfDerivedFrom
 Define a constraints base class with a testable value. More...
 
class  TestIfDerivedFuncs
 
class  TextLogger
 Convenience base class for anything associated with an operation that needs to write text to the log manager. More...
 
class  TextTemplate
 Represents a template (or set of templates) that can be rendered using a supplied context. More...
 
class  TypeT
 Type classification template. More...
 
class  UdpBroadcast
 Local broadcast helper This class implements a broadcast helper on the local interface using UDP diagrams. Listener apps can also use this class to receive the broadcast messages on shared socket SO_REUSEADDR. More...
 
class  UserInterfaceMap
 
class  VariableLengthArray
 An array class similar to std::vector or QVector. More...
 
class  WorkflowAnalyseBatchArgumentsParser
 Command line argument parser for workspace-analyse-batch. More...
 
class  WorkspaceAgent
 
class  WorkspaceAgentWorkflows
 
class  WorkspaceAgentWorkflowWidget
 
class  WorkspaceArgumentsParser
 Helper class for dealing with command line arguments supplied to a workspace application. More...
 
class  WorkspaceContainer
 
class  WorkspaceObserver
 
class  WorkspacePlugin
 Base class for all workspace plugin classes. More...
 
class  WorkspaceQueue
 
class  XmlEntitiesHandler
 This class makes it easy to convert HTML strings back to plain texts. More...
 

Typedefs

using MessageCategory = Application::LogManager::MessageCategory
 
typedef CSIRO::Application::ReportExceptionsApp ParentApp
 
using WebPage = QWebEnginePage
 
typedef QWebEngineView WebView
 

Enumerations

enum class  SoundEffect { ExecutionComplete = 0 , ExecutionFailed , ConnectionMade , Size }
 
enum class  UiSetting { SetLabelOnNestedWorkflowAction = 0 , Unknown }
 

Functions

template<class Real >
bool approxEqual (Real a, Real b, Real eps=epsilon< Real >())
 
template<typename Real >
Real clamp (Real x, Real lowerlimit, Real upperlimit)
 
template<typename Real >
Real clampMinPrec (Real value, Real minPrec=std::numeric_limits< Real >::min())
 
template<typename T , typename F >
int compareContainers (const T &left, const T &right, const F &compareFunc)
 
template<typename Callable >
ScopeGuard< Callable > createScopeGuard (Callable rollback)
 
template<class Real >
bool definitelyGreaterThan (Real a, Real b, Real eps=epsilon< Real >())
 
template<class Real >
bool definitelyGreaterThanOrEqualTo (Real a, Real b, Real eps=epsilon< Real >())
 
template<class Real >
bool definitelyLessThan (Real a, Real b, Real eps=epsilon< Real >())
 
template<class Real >
bool definitelyLessThanOrEqualTo (Real a, Real b, Real eps=epsilon< Real >())
 
template<class Real >
bool definitelyWithinRangeInclusive (Real val, Real min, Real max, Real eps=epsilon< Real >())
 
template<typename T >
divideAndCeil (T numerator, T denominator)
 
template<typename T >
divideAndRound (T numerator, T denominator)
 
template<class Real >
constexpr Real epsilon ()
 
QString findExecutable (const QString &exeName)
 
void findLocalFiles (const QString &dirName, const QStringList &nameFilters, bool findRecursively, const QRegularExpression &excludeRegex, QStack< QString > &filesStack)
 
DataExecution::SerializedItem findWorkflowItem (const QString &workflowPath, const DataExecution::SerializedItem &top)
 
QString getDemangledName (const char *name)
 
template<typename T , size_t S>
constexpr size_t getFileNameOffset (const T(&str)[S], size_t i=S - 1)
 
template<typename T >
constexpr size_t getFileNameOffset (T(&str)[1])
 
QString getFirstWorkspaceInstallArea (const QString &suffix, bool traceInfo)
 
CSIRO_WORKSPACE_API QStringList getReferencedPlugins (const QString &workflowFileName)
 
QStringList getWorkspaceInstallAreas (const QString &pathSuffix, bool traceInfo)
 
CSIRO_WORKSPACE_API QString getWorkspaceRootDirectory ()
 
bool haveDisplayAvailable ()
 
bool haveExecutable (const QString &exeName)
 
bool haveGuiAvailable ()
 
template<class charT , class traits >
std::basic_istream< charT, traits > & ignoreLine (std::basic_istream< charT, traits > &strm)
 
bool initThreads ()
 
template<typename T1 , typename T2 >
bool isSameObject (T1 &obj1, T2 &obj2)
 
bool jsonFromString (const QString &jsonStr, QJsonDocument &result, bool logParseError=false)
 
bool keysMatch (const std::string &s1, const std::string &s2)
 
bool KeysMatch (const std::string &s1, const std::string &s2)
 
QString launchExecutable (const QString &exeName, const QStringList &arguments, const QString &launcher, const QStringList &launcherArgs)
 
QString launchExecutable (const QStringList &environment, const QStringList &exeNames, const QStringList &arguments)
 
QString launchExecutable (const QStringList &exeNames, const QStringList &arguments, const QString &launcher, const QStringList &launcherArgs)
 
bool loadTranslation (const QString &baseName, const QStringList &searchPaths)
 
CSIRO_WORKSPACE_API void matchGuiMinRequirementsOrPromptAndExit ()
 
template<class T >
max3 (const T &a, const T &b, const T &c)
 
template<class T >
min3 (const T &a, const T &b, const T &c)
 
const LogManager::MessageCategoryoperator<< (const LogManager::MessageCategory &category, const QString &message)
 
CSIRO_WORKSPACE_API bool operator== (const LogManager::MessageCategory &lhs, const LogManager::MessageCategory &rhs)
 
CSIRO_WORKSPACE_API void patchCommandLineArguments (int &argc, char **&argv, bool addToBegin)
 
int processServerCommandLine (int argc, char *argv[])
 
uint qHash (const CSIRO::Application::LogManager::MessageCategory &key, uint seed=0)
 
double randomInRange (double low, double high)
 
double RandomInRange (double low, double high)
 
double randomProb ()
 
double RandomProb ()
 
QStringList regexpSplit (const QRegExp &regexp, const QString &str)
 
bool runExecutable (const QString &exeName, const QStringList &arguments, const QString &launcher, const QStringList &launcherArgs)
 
bool runExecutable (const QStringList &exeNames, const QStringList &arguments, const QString &launcher, const QStringList &launcherArgs)
 
template<class Real >
Real safeACos (Real val)
 
void seedRandomGenerator (unsigned seed)
 
void SeedRandomGenerator (unsigned seed)
 
void serverCommandLineHelp (const char *command)
 
void SetConsoleColour (int type)
 
void setupTranslators ()
 
template<typename T >
int sign (T val)
 
QString sizeString (size_t bytes)
 
template<typename Real >
Real smoothstep (Real edge0, Real edge1, Real x)
 
CSIRO_WORKSPACE_API bool testGuiMinRequirements ()
 
template<typename T >
std::string ToString (const T &obj)
 
std::string & trimBlanks (std::string &s)
 
std::string & TrimBlanks (std::string &s)
 

Typedef Documentation

◆ MessageCategory

◆ ParentApp

typedef CSIRO::Application::ReportExceptionsApp ParentApp

◆ WebPage

using WebPage = QWebEnginePage

◆ WebView

typedef QWebEngineView WebView

Enumeration Type Documentation

◆ SoundEffect

enum class SoundEffect
strong
Enumerator
ExecutionComplete 
ExecutionFailed 
ConnectionMade 
Size 

◆ UiSetting

enum class UiSetting
strong
Enumerator
SetLabelOnNestedWorkflowAction 
Unknown 

Function Documentation

◆ approxEqual()

bool approxEqual ( Real  a,
Real  b,
Real  eps = epsilon<Real>() 
)
inline

Floating point comparison function (absolute / relative, depending upon the size of the values)s

◆ clamp()

Real clamp ( Real  x,
Real  lowerlimit,
Real  upperlimit 
)

Clamp a value to a lower/upper limit if needed.

Parameters
xThe value to clamp
lowerlimitThe lower limit of the clamp
upperlimitThe upper limit of the clamp

◆ clampMinPrec()

Real clampMinPrec ( Real  value,
Real  minPrec = std::numeric_limits<Real>::min() 
)
inline

Clamps value to a specific minimum precision (minPrec). If fabs(value) is less than minPrec, minPrec will be returned, otherwise value is returned.

Parameters
valueThe value to clamp
minPrecThe minimum precision allowed for value. If the fabs(value) is less than this value, minPrec will be returned.
Returns
If fabs(value) is less than minPrec, minPrec will be returned, otherwise value is returned.

◆ compareContainers()

int compareContainers ( const T &  left,
const T &  right,
const F &  compareFunc 
)

Compare containers based on some value. If the two containers are equal but one is shorter, the shorter one is considered less.

-1 means left < right 0 means left == right 1 means left > right

◆ createScopeGuard()

ScopeGuard< Callable > createScopeGuard ( Callable  rollback)
Parameters
rollbackRollback function to invoke when the guard is destroyed unless dismissed. The rollback function must not throw an exception, or it will result in the application terminating due to problems with destructor unwinding. Handle all exceptions within the rollback function.

Creates a guard, allowing us to use super-handy type inferencing and lambdas.

◆ definitelyGreaterThan()

bool definitelyGreaterThan ( Real  a,
Real  b,
Real  eps = epsilon<Real>() 
)
inline

Floating point comparison using relative tolerance (a > b).

◆ definitelyGreaterThanOrEqualTo()

bool definitelyGreaterThanOrEqualTo ( Real  a,
Real  b,
Real  eps = epsilon<Real>() 
)
inline

Floating point comparison using relative tolerance (a >= b).

◆ definitelyLessThan()

bool definitelyLessThan ( Real  a,
Real  b,
Real  eps = epsilon<Real>() 
)
inline

Floating point comparison using relative tolerance (a < b).

◆ definitelyLessThanOrEqualTo()

bool definitelyLessThanOrEqualTo ( Real  a,
Real  b,
Real  eps = epsilon<Real>() 
)
inline

Floating point comparison using relative tolerance (a <= b).

◆ definitelyWithinRangeInclusive()

bool definitelyWithinRangeInclusive ( Real  val,
Real  min,
Real  max,
Real  eps = epsilon<Real>() 
)
inline

Convenience floating point comparison using relative / absolute tolerance.

◆ divideAndCeil()

T divideAndCeil ( numerator,
denominator 
)
inline

Integer division that rounds the result to the nearest integer higher than the result rather than just truncate

◆ divideAndRound()

T divideAndRound ( numerator,
denominator 
)
inline

Integer division that rounds the result to the nearest integer rather than just truncate

◆ epsilon()

constexpr Real epsilon ( )
inlineconstexpr

Custom epsilon that is several times the machines min precision.

◆ findExecutable()

CSIRO_WORKSPACE_API QString findExecutable ( const QString &  exeName)
Parameters
exeNameThe name of the executable to find. On Windows, this should not include the filename extension.

If exeName is not an absolute path, this function will attempt to find an executable on the current PATH which can be launched using the specified exeName. If exeName is already an absolute path, it is assumed that the path is correct.

The usefulness of the function is mostly due to its support for honouring the PATHEXT environment variable. Regardless of whether exeName has an absolute path or not, the function will search for exeName as is, and if that is not found it will also try appending each suffix specified in PATHEXT. This is generally only useful on Windows, but it allows the caller to specify an exeName in a more or less platform independent way and let the function handle filename extensions automatically.

Note
The file must be executable for it to be seen as a successful candidate, ie it is not enough for the file to simply exist.
Returns
The path to the matching executable or an empty string if no suitable match could be found.
See also
haveExecutable(), launchExecutable(), runExecutable()

◆ findLocalFiles()

void findLocalFiles ( const QString &  dirName,
const QStringList nameFilters,
bool  findRecursively,
const QRegularExpression &  excludeRegex,
QStack< QString > &  filesStack 
)

◆ findWorkflowItem()

DataExecution::SerializedItem findWorkflowItem ( const QString &  workflowPath,
const DataExecution::SerializedItem top 
)

◆ getDemangledName()

CSIRO_WORKSPACE_API QString getDemangledName ( const char *  name)

◆ getFileNameOffset() [1/2]

constexpr size_t getFileNameOffset ( const T(&)  str[S],
size_t  i = S - 1 
)
inlineconstexpr

◆ getFileNameOffset() [2/2]

constexpr size_t getFileNameOffset ( T(&)  str[1])
inlineconstexpr

◆ getFirstWorkspaceInstallArea()

CSIRO_WORKSPACE_API QString getFirstWorkspaceInstallArea ( const QString &  suffix,
bool  traceInfo 
)

Returns the first workspace install area with the provided suffix that exists.

See also
getWorkspaceInstallAreas

◆ getReferencedPlugins()

CSIRO_WORKSPACE_API QStringList getReferencedPlugins ( const QString &  workflowFileName)
Parameters
workflowFileNamename of the workflow file to parse.
Returns
The list of plugin identifiers referenced by this workflow file.

◆ getWorkspaceInstallAreas()

CSIRO_WORKSPACE_API QStringList getWorkspaceInstallAreas ( const QString &  pathSuffix,
bool  traceInfo 
)
Parameters
pathSuffixThe desired path below each candidate install area.
traceInfoWrite log messages
Returns
The list of install areas known to the workspace, with pathSuffix appended to each one. A path separator will be inserted between the install area and the pathSuffix automatically. The list will only contain those directories that actually exist and will contain no duplicates (although no attempt is made to resolve symbolic links on platforms that support them, so it may be possible for some paths to ultimately resolve to the same location). Path separators will be converted to the platform's native separators and any "." or ".." in the paths will be resolved.

Install areas are generally found from two sources:

  • The parent directory of where the application's executable is located.
  • The WORKSPACE_INSTALL_AREAS environment variable. This will be in the same form as the PATH environment variable for the current platform (ie paths separated by semi-colons on Windows, generally by colons on other platforms).

◆ getWorkspaceRootDirectory()

CSIRO_WORKSPACE_API QString getWorkspaceRootDirectory ( )
Returns
The root directory of Workspace. This will be one level up from the main workspace shared library location regardless of whether the calling code is in workspace itself, a derived product or a workspace-based test*.

*As long as this process was run using a Workspace launcher (which will have set the WORKSPACE_INSTALL_AREAS to include all install areas including the one containing the main workspace library.

◆ haveDisplayAvailable()

CSIRO_WORKSPACE_API bool haveDisplayAvailable ( )
Returns
True if a display is available, false otherwise.

This function has nothing to do with detecting a physical monitor attached to the host machine. Rather, it determines whether or not a display is available from a software perspective. A display could be a virtual off-screen buffer or it could be attached to a physical device, but this function does not distinguish between the two.

One of the main uses of this function is to pass the result as the GUIenabled parameter of a QApplication constructor. That parameter modifies how the application is initialized during startup.

A display is always available under Windows, but for most other platforms, a display is only present if the DISPLAY environment variable is set.

Note
This function does not indicate whether a GUI is supported. Client code should call haveGuiAvailable() for that.
See also
haveGuiAvailable()

◆ haveExecutable()

CSIRO_WORKSPACE_API bool haveExecutable ( const QString &  exeName)
Returns
True if exeName specifies an executable that can be launched based on the current PATH.

This function is a convenience. It merely returns whether the result of findExecutable() is an non-empty string.

See also
findExecutable(), launchExecutable(), runExecutable()

◆ haveGuiAvailable()

CSIRO_WORKSPACE_API bool haveGuiAvailable ( )
Returns
True if the application supports a GUI. For an application to support a GUI, three conditions must be met:
  • haveDisplayAvailable() must return true
  • A QApplication object (or a subclass of QApplication) must have been created
  • QApplication::type() must not return QApplication::Tty, or put another way, the QApplication object must have been created in such a way as to support a GUI (which it generally will for the way most people use QApplication).

The haveGuiAvailable() function is intended to be called after the main application object has been created. It is useful when the client code won't know in advance what type of application object will be used (ie QCoreApplication, QApplication or a subclass of either of these).

See also
haveDisplayAvailable()

◆ ignoreLine()

std::basic_istream< charT, traits > & ignoreLine ( std::basic_istream< charT, traits > &  strm)
inline

Ignore everything up to the end of this line. This code was taken from "The C++ Standard Library", by Nicolai M. Josuttis, p614 (with slight changes).

◆ initThreads()

bool initThreads ( )
inline
Returns
true if threading was initialised successfully, false otherwise.

Initialises threaded rendering support, which is required on X-based platforms in order to use multi-threaded OpenGL data processing and rendering. We can't make this part of the rendering plugin, as we need it for any application that potentially uses 3D visualisation, which includes Workspace-GUI itself.

For platforms other than X11, this function will simply return true. For X11, it will invoke the XInitThreads() function.

Note
This function must be called as early as possible in your application in order to guarantee robustness. Recommend invoking as the first line in your application's main() function.

◆ isSameObject()

bool isSameObject ( T1 &  obj1,
T2 &  obj2 
)

Function to return if two pointers refer to the same object. The pointers can be to different types, even totally unrelated types. Template specializations will transparently handle this and return true/false as necessary, even as compile-time constants if that can be ascertained (eg unrelated classes). If the classes are related by inheritance, then the test is done at run-time as a simple pointer equivalence test with the compiler providing appropriate conversion to a pointer to the common base class.

◆ jsonFromString()

bool jsonFromString ( const QString &  jsonStr,
QJsonDocument result,
bool  logParseError = false 
)
inline
Parameters
jsonStrString to convert to a JSON document
resultThe resulting JSON document
logParseErrorLogs any parse error details if true, silently returns false otherwise
Returns
If the sting was parsed as valid JSON

◆ keysMatch()

bool keysMatch ( const std::string &  s1,
const std::string &  s2 
)
inline
Returns
True if both strings are identical, ignoring case and leading/trailing whitespace.

◆ KeysMatch()

bool KeysMatch ( const std::string &  s1,
const std::string &  s2 
)
inline

◆ launchExecutable() [1/3]

CSIRO_WORKSPACE_API QString launchExecutable ( const QString &  exeName,
const QStringList arguments,
const QString &  launcher,
const QStringList launcherArgs 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

This overload exists to make it easy to pass a single exeName rather than a list of names. Without it, a single literal would need to be surrounded with QString().

◆ launchExecutable() [2/3]

CSIRO_WORKSPACE_API QString launchExecutable ( const QStringList environment,
const QStringList exeNames,
const QStringList arguments 
)
Parameters
environmentSpecify environments that should be passed to the executable
exeNamesA list of candidate executable names to find and launch. The first one found to match the criteria will be used. On Windows, these names should not include the filename extension.
argumentsThe arguments that should be passed to the executable. This function is conceptually similar to launching the result of findExecutable() with a few important differences. It will continue searching until it finds and successfully launches an executable. This can be useful if there are executables that fail to load for some reason (eg missing dependencies). If you don't want this behaviour, call findExecutable() and launch it using QProcess yourself.

A list of exeNames is typically used rather than a single name when a command has different names on different platforms or distributions (as is often the case under linux). The names will be tried in the specified order, checking the full set of paths before moving on to the next candidate name.

Returns
The path to the launched executable or an empty string if no executable could be suitably launched.
See also
runExecutable(), findExecutable(), haveExecutable()

◆ launchExecutable() [3/3]

CSIRO_WORKSPACE_API QString launchExecutable ( const QStringList exeNames,
const QStringList arguments,
const QString &  launcher,
const QStringList launcherArgs 
)
Parameters
exeNamesA list of candidate executable names to find and launch. The first one found to match the criteria will be used. On Windows, these names should not include the filename extension.
argumentsThe arguments that should be passed to the executable.
launcherIf non-empty, this specifies an executable to use to launch the exeName. (see below for details).
launcherArgsIf launcher is non-empty, this specifies an argument to pass to the launcher (see below for details).

This function is conceptually similar to launching the result of findExecutable() with a few important differences. It will continue searching until it finds and successfully launches an executable. This can be useful if there are executables that fail to load for some reason (eg missing dependencies). If you don't want this behaviour, call findExecutable() and launch it using QProcess yourself.

A list of exeNames is typically used rather than a single name when a command has different names on different platforms or distributions (as is often the case under linux). The names will be tried in the specified order, checking the full set of paths before moving on to the next candidate name.

The executable can be launched indirectly by another launcher. This is sometimes useful if you want to do things like modify environment variables, chain executables, etc. If launcher is a non-empty string, it is assumed to be a command that can be run (ie it must already be on the PATH or it must be an absolute path). The full command line in this case will be launcher followed by the launcherArgs (if any), the exeName that was found and after that the arguments.

The Workspace framework uses a special kind of launcher for all of its own executables. These launchers all support the use of –launch as the first parameter, which has the effect of treating the second parameter as another executable to launch and any subsequent arguments will be passed along unchanged to this executable. Before launching the executable, it will augment various environment variables such as PATH, LD_LIBRARY_PATH, DYLD_FRAMEWORK_PATH, QT_PLUGIN_PATH and WORKSPACE_INSTALL_AREAS. Any executable that was built using the launcher_for_executable CMake macro (provided by the Workspace framework) will also support this –launch option to launch another executable.

Note
Due to how the exeName executable is launched, it will not inherit the environment of the current process. Instead, it will typically receive the default system environment. This is where using the launcher feature can be particularly useful to force a particular environment.
Returns
The path to the launched executable or an empty string if no executable could be suitably launched. Note that if the launcher always fails to launch, this will also result in an empty string being returned, so it is the caller's responsibility to ensure the launcher is valid.
See also
runExecutable(), findExecutable(), haveExecutable()

◆ loadTranslation()

CSIRO_WORKSPACE_API bool loadTranslation ( const QString &  baseName,
const QStringList searchPaths 
)
Parameters
baseNameThe base name of the translation file to search for. As an example, the baseName for the Qt translation files is simply "qt", while for the workspace itself, it is "workspace". The actual translation files will typically be named something like "qt_de.qm", etc. See the documentation for QTranslator::load() for full details.
searchPathsA list of directories in which to look for translation files. This list will often be provided by a call to getWorkspaceInstallAreas().
Returns
True if an appropriate translation file was found and loaded, or if the current locale is an English-based or C locale. The rationale for the special cases for English and C locales is that the untranslated strings are assumed to be in English (they are for Qt and for the Workspace).

This function would not typically be called directly by client code. It is generally only used by WorkspacePlugin::addTranslation() as an implementation detail.

See also
setupTranslators()

◆ matchGuiMinRequirementsOrPromptAndExit()

CSIRO_WORKSPACE_API void matchGuiMinRequirementsOrPromptAndExit ( )

Check the hardware and software environment to see if that matches the minimum requirement for running Workspace. If does not match, it prompt a message box and exit the process.

◆ max3()

T max3 ( const T &  a,
const T &  b,
const T &  c 
)
inline

◆ min3()

T min3 ( const T &  a,
const T &  b,
const T &  c 
)
inline

◆ operator<<()

const LogManager::MessageCategory & operator<< ( const LogManager::MessageCategory category,
const QString &  message 
)
inline
Parameters
categoryThe category of message to write to the log
messageMessage to write to the log
Returns
The category object itself, to allow chaining.

Stream-like convenience method for writing messages to a particular log category, e.g:

LOG_DEBUG << tr("An error occurred in a debug build.") + "\n";

◆ operator==()

CSIRO_WORKSPACE_API bool operator== ( const LogManager::MessageCategory lhs,
const LogManager::MessageCategory rhs 
)

Required for comparison in hashable containers such as QSet

◆ patchCommandLineArguments()

CSIRO_WORKSPACE_API void patchCommandLineArguments ( int &  argc,
char **&  argv,
bool  addToBegin 
)

If we don't have a display available, we need to prepend two command line arguments to our application: -platform offscreen. This replaces the previous functionality in Qt4 where the third parameter of QApplication was the 'hasGuiAvailable' bool. To simplify the code, we always allocate a new argv regardless, and we always clean it up. The patched arguments argv use a newly allocated buffer and will be leaked till the end of the the process, hence this method should only be used to patch the main function's arguments once.

◆ processServerCommandLine()

int processServerCommandLine ( int  argc,
char *  argv[] 
)
Parameters
argcOne more than the number of arguments passed to the application. This must be the value of argc passed to main().
argvThis must be the value of argv passed to main().

Clients call this function if they want to process server command line options. Currently, only one option may be specified at a time. Supported options are:

–version –vendor –writesettings

It is assumed that clients will exit the application when this function returns. Therefore, clients should only call it if they have already determined that there are options to process and/or that they don't want to launch the application proper.

Returns
The exit code to use for the application.

◆ qHash()

uint qHash ( const CSIRO::Application::LogManager::MessageCategory key,
uint  seed = 0 
)
inline

Enables MessageCategory objects to be stored in hashable containers such as QSet.

◆ randomInRange()

double randomInRange ( double  low,
double  high 
)
inline

◆ RandomInRange()

double RandomInRange ( double  low,
double  high 
)
inline

◆ randomProb()

double randomProb ( )
inline
Returns
A random number in the range [0,1].

◆ RandomProb()

double RandomProb ( )
inline

◆ regexpSplit()

QStringList regexpSplit ( const QRegExp &  regexp,
const QString &  str 
)
inline
Parameters
regexpThe regular expression to delimit the split.
strThe string to split.

Splits a string, where the matched regular expression is the delimeter. Any captures in the regexp will be included in the resulting stringlist as separate strings, inserted appropriately.

Returns
A list of the components of the string.

◆ runExecutable() [1/2]

CSIRO_WORKSPACE_API bool runExecutable ( const QString &  exeName,
const QStringList arguments,
const QString &  launcher,
const QStringList launcherArgs 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

This overload exists to make it easy to pass a single exeName rather than a list of names. Without it, a single literal would need to be surrounded with QString().

◆ runExecutable() [2/2]

CSIRO_WORKSPACE_API bool runExecutable ( const QStringList exeNames,
const QStringList arguments,
const QString &  launcher,
const QStringList launcherArgs 
)

This function is entirely analogous to launchExecutable() except it waits for the process to finish before returning.

Returns
True if the executable was able to be run.
See also
launchExecutable(), findExecutable(), haveExecutable()

◆ safeACos()

Real safeACos ( Real  val)
inline

Function for safely computing acos of +1.0 or -1.0 where rounding errors may occur.

◆ seedRandomGenerator()

void seedRandomGenerator ( unsigned  seed)
inline

◆ SeedRandomGenerator()

void SeedRandomGenerator ( unsigned  seed)
inline

◆ serverCommandLineHelp()

void serverCommandLineHelp ( const char *  command)
Parameters
commandThe name of the command for which help should be shown.

Callers can append their own options to the output.

◆ SetConsoleColour()

void SetConsoleColour ( int  type)

◆ setupTranslators()

CSIRO_WORKSPACE_API void setupTranslators ( )

Installs the Qt and workspace translation files for the current default locale. For information on what the default locale is, see documentation for Qt's QLocale class.

This function would typically be called just after the main QApplication object has been created. It does not use PluginManager in any way and Workspace plugins should call WorkspacePlugin::addTranslation() in their own setup() function in order to make their translations available to the application.

See also
WorkspacePlugin::addTranslation()

◆ sign()

int sign ( val)
inline

Obtains the sign of a number.

Template Parameters
TThe numeric data type in question (or a type implicitly convertible to a numeric type)
Parameters
valThe value of which we're obtaining the sign.
Returns
-1 if the number is negative, or 1 if the number is positive.

◆ sizeString()

QString sizeString ( size_t  bytes)
inline
Returns
A string describing bytes using an appropriate unit

◆ smoothstep()

Real smoothstep ( Real  edge0,
Real  edge1,
Real  x 
)

Function to smoothly step between two floating point edges for interpolation purposes.

Parameters
edge0The lower edge limit
edge1The upper edge limit
xValue between limits

◆ testGuiMinRequirements()

CSIRO_WORKSPACE_API bool testGuiMinRequirements ( )

Check the hardware and software environment to see if that matches the minimum requirement for running Workspace.

Returns
If the hardware and software matches the minimum requirement for running Workspace

◆ ToString()

std::string ToString ( const T &  obj)
inline

◆ trimBlanks()

std::string & trimBlanks ( std::string &  s)
inline

◆ TrimBlanks()

std::string & TrimBlanks ( std::string &  s)
inline