OpenStudio:utilities
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | List of all members
openstudio::ApplicationSingleton Class Reference

#include <Application.hpp>

Public Member Functions

QCoreApplication * application (bool gui=true)
 get the QApplication, if no QApplication has been set this will create a default one More...
 
boost::optional< bool > getSettingValueAsBool (const std::string &key)
 Get the value of setting as given type, be careful when using getSettingValueAsBool you must first check if the optional is set and then check its value. More...
 
boost::optional< double > getSettingValueAsDouble (const std::string &key)
 
boost::optional< intgetSettingValueAsInt (const std::string &key)
 
boost::optional< std::string > getSettingValueAsString (const std::string &key)
 
bool hasApplication () const
 check if the application has been initialized More...
 
bool hasGUI () const
 check if the application has GUI enabled More...
 
bool hasSetting (const std::string &key)
 Check if application has given setting. More...
 
bool isDefaultInstance ()
 Check if the application is headless. More...
 
bool processEvents ()
 Process pending Qt events returns true if some work was done. More...
 
bool processEvents (int maxTime)
 
void removeSetting (const std::string &key)
 Remove setting. More...
 
bool setApplication (QCoreApplication *qApplication)
 set the QApplication, this should be done before calling application(), no op if it has already been set. More...
 
void setSettingValue (const std::string &key, bool value)
 Set application value to given value. More...
 
void setSettingValue (const std::string &key, int value)
 
void setSettingValue (const std::string &key, double value)
 
void setSettingValue (const std::string &key, const std::string &value)
 
sketchUpWidget ()
 get the QWidget wrapper around SketchUp window initialized by call to application, only implemented for windows More...
 
 ~ApplicationSingleton ()
 

Detailed Description

Singleton application wide configuration management.

Constructor & Destructor Documentation

openstudio::ApplicationSingleton::~ApplicationSingleton ( )

Member Function Documentation

QCoreApplication* openstudio::ApplicationSingleton::application ( bool  gui = true)

get the QApplication, if no QApplication has been set this will create a default one

boost::optional<bool> openstudio::ApplicationSingleton::getSettingValueAsBool ( const std::string &  key)

Get the value of setting as given type, be careful when using getSettingValueAsBool you must first check if the optional is set and then check its value.

boost::optional<double> openstudio::ApplicationSingleton::getSettingValueAsDouble ( const std::string &  key)
boost::optional<int> openstudio::ApplicationSingleton::getSettingValueAsInt ( const std::string &  key)
boost::optional<std::string> openstudio::ApplicationSingleton::getSettingValueAsString ( const std::string &  key)
bool openstudio::ApplicationSingleton::hasApplication ( ) const

check if the application has been initialized

bool openstudio::ApplicationSingleton::hasGUI ( ) const

check if the application has GUI enabled

bool openstudio::ApplicationSingleton::hasSetting ( const std::string &  key)

Check if application has given setting.

bool openstudio::ApplicationSingleton::isDefaultInstance ( )

Check if the application is headless.

bool openstudio::ApplicationSingleton::processEvents ( )

Process pending Qt events returns true if some work was done.

bool openstudio::ApplicationSingleton::processEvents ( int  maxTime)
void openstudio::ApplicationSingleton::removeSetting ( const std::string &  key)

Remove setting.

bool openstudio::ApplicationSingleton::setApplication ( QCoreApplication *  qApplication)

set the QApplication, this should be done before calling application(), no op if it has already been set.

Returns true if set succeeded.

void openstudio::ApplicationSingleton::setSettingValue ( const std::string &  key,
bool  value 
)

Set application value to given value.

void openstudio::ApplicationSingleton::setSettingValue ( const std::string &  key,
int  value 
)
void openstudio::ApplicationSingleton::setSettingValue ( const std::string &  key,
double  value 
)
void openstudio::ApplicationSingleton::setSettingValue ( const std::string &  key,
const std::string &  value 
)
* openstudio::ApplicationSingleton::sketchUpWidget ( )

get the QWidget wrapper around SketchUp window initialized by call to application, only implemented for windows