#include <RemoteBCL.hpp>
Public Member Functions | |
Constructor | |
RemoteBCL () | |
Default constructor. More... | |
Destructor | |
virtual | ~RemoteBCL () override=default |
Virtual destructor. More... | |
Inherited members | |
virtual boost::optional < BCLComponent > | getComponent (const std::string &uid, const std::string &versionId="") const override |
Get the component by uid. More... | |
virtual boost::optional < BCLMeasure > | getMeasure (const std::string &uid, const std::string &versionId="") const override |
Get the measure by uid. More... | |
boost::optional < BCLMetaSearchResult > | metaSearchComponentLibrary (const std::string &searchTerm, const std::string &componentType, const std::string &filterType="nrel_component") const |
Perform a meta search on the library to identify number and types of results available. More... | |
boost::optional < BCLMetaSearchResult > | metaSearchComponentLibrary (const std::string &searchTerm, const unsigned componentTypeTID, const std::string &filterType="nrel_component") const |
std::vector< BCLSearchResult > | searchComponentLibrary (const std::string &searchTerm, const std::string &componentType, const unsigned page=0) const |
Perform a component search of the library, results are returned in 'pages', the number of results per page is configurable and a metasearch should be performed to determine the total number of results pages available. More... | |
std::vector< BCLSearchResult > | searchComponentLibrary (const std::string &searchTerm, const unsigned componentTypeTID, const unsigned page=0) const |
std::vector< BCLSearchResult > | searchMeasureLibrary (const std::string &searchTerm, const std::string &componentType, const unsigned page=0) const |
Perform a measure search of the library, results are returned in 'pages', the number of results per page is configurable and a metasearch should be performed to determine the total number of results pages available. More... | |
std::vector< BCLSearchResult > | searchMeasureLibrary (const std::string &searchTerm, const unsigned componentTypeTID, const unsigned page=0) const |
int | checkForComponentUpdates () |
Compare the versionIds of all downloaded components/measures to the published version online and return the number that have updates. More... | |
int | checkForMeasureUpdates () |
std::vector< BCLSearchResult > | componentsWithUpdates () const |
Return the uids for components and measures respectively that have updates available. More... | |
std::vector< BCLSearchResult > | measuresWithUpdates () const |
void | updateComponents () |
Replace local components and measures with the latest versions. More... | |
void | updateMeasures () |
Non-blocking class members | |
bool | downloadComponent (const std::string &uid) |
Starts downloading an individual component by uid, if successful this will start a download. More... | |
bool | downloadMeasure (const std::string &uid) |
Starts downloading an individual measure by uid, if successful this will start a download. More... | |
bool | startComponentLibraryMetaSearch (const std::string &searchTerm, const std::string &componentType, const std::string &filterType) |
Start a meta search, if successful this will start a download. More... | |
bool | startComponentLibraryMetaSearch (const std::string &searchTerm, const unsigned componentTypeTID, const std::string &filterType) |
bool | startComponentLibrarySearch (const std::string &searchTerm, const std::string &componentType, const std::string &filterType, const unsigned page=0) |
Start a search, if successful this will start a download. More... | |
bool | startComponentLibrarySearch (const std::string &searchTerm, const unsigned componentTypeTID, const std::string &filterType, const unsigned page=0) |
Public Member Functions inherited from openstudio::BCL | |
virtual | ~BCL ()=default |
Virtual destructor. More... | |
Public Attributes | |
Nano::Signal< void(const std::string &uid, const boost::optional< BCLComponent > &component)> | componentDownloaded |
Emitted when a component download completes. More... | |
Nano::Signal< void(const std::string &uid, const boost::optional< BCLMeasure > &measure)> | measureDownloaded |
Emitted when a measure download completes. More... | |
Blocking class members | |
boost::optional< BCLComponent > | lastComponentDownload () const |
Returns the last downloaded component if there is one. More... | |
boost::optional< BCLMeasure > | lastMeasureDownload () const |
Returns the last downloaded measure if there is one. More... | |
boost::optional < BCLMetaSearchResult > | lastMetaSearch () const |
Returns the last meta search result if there is one. More... | |
std::vector< BCLSearchResult > | lastSearch () const |
Returns the last search results if there are any. More... | |
std::string | remoteUrl () const |
Get the current remote url. More... | |
void | useRemoteDevelopmentUrl () |
Use the development production server url. More... | |
void | useRemoteProductionUrl () |
Use the development production server url. More... | |
std::string | authKey () const |
Get the current OAuth key. More... | |
std::string | prodAuthKey () const |
Return production OAuth key. More... | |
bool | setProdAuthKey (const std::string &prodAuthKey) |
Set the production OAuth key. More... | |
std::string | devAuthKey () const |
Return development OAuth key. More... | |
bool | setDevAuthKey (const std::string &devAuthKey) |
Set the development OAuth key. More... | |
int | resultsPerQuery () const |
Return the number of results per query. More... | |
int | lastTotalResults () const |
Return the total number of results. More... | |
int | numResultPages () const |
Return the number of pages of results. More... | |
unsigned | timeOutSeconds () const |
bool | setTimeOutSeconds (unsigned timeOutSeconds) |
boost::optional< BCLComponent > | waitForComponentDownload () const |
Wait number of milliseconds for download to complete Returns the download if it completed in the allowable time. More... | |
OS_DEPRECATED boost::optional < BCLComponent > | waitForComponentDownload (int) const |
boost::optional< BCLMeasure > | waitForMeasureDownload () const |
Wait number of milliseconds for download to complete Returns the download if it completed in the allowable time. More... | |
OS_DEPRECATED boost::optional < BCLMeasure > | waitForMeasureDownload (int) const |
boost::optional < BCLMetaSearchResult > | waitForMetaSearch () const |
Wait number of milliseconds for download to complete Returns the download if it completed in the allowable time. More... | |
OS_DEPRECATED boost::optional < BCLMetaSearchResult > | waitForMetaSearch (int) const |
std::vector< BCLSearchResult > | waitForSearch () const |
Wait number of milliseconds for download to complete Returns the download if it completed in the allowable time. More... | |
OS_DEPRECATED std::vector < BCLSearchResult > | waitForSearch (int) const |
static bool | isOnline () |
Returns true if there is an internet connection. More... | |
static std::string | remoteProductionUrl () |
Get the remote production url. More... | |
static std::string | remoteDevelopmentUrl () |
Get the remote development url. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from openstudio::BCL | |
BCL () | |
Default constructor. More... | |
Class for accessing the remote BCL.
openstudio::RemoteBCL::RemoteBCL | ( | ) |
Default constructor.
|
overridevirtualdefault |
Virtual destructor.
std::string openstudio::RemoteBCL::authKey | ( | ) | const |
Get the current OAuth key.
int openstudio::RemoteBCL::checkForComponentUpdates | ( | ) |
Compare the versionIds of all downloaded components/measures to the published version online and return the number that have updates.
int openstudio::RemoteBCL::checkForMeasureUpdates | ( | ) |
std::vector<BCLSearchResult> openstudio::RemoteBCL::componentsWithUpdates | ( | ) | const |
Return the uids for components and measures respectively that have updates available.
std::string openstudio::RemoteBCL::devAuthKey | ( | ) | const |
Return development OAuth key.
bool openstudio::RemoteBCL::downloadComponent | ( | const std::string & | uid | ) |
Starts downloading an individual component by uid, if successful this will start a download.
bool openstudio::RemoteBCL::downloadMeasure | ( | const std::string & | uid | ) |
Starts downloading an individual measure by uid, if successful this will start a download.
|
overridevirtual |
Get the component by uid.
Implements openstudio::BCL.
|
overridevirtual |
Get the measure by uid.
Implements openstudio::BCL.
|
static |
Returns true if there is an internet connection.
boost::optional<BCLComponent> openstudio::RemoteBCL::lastComponentDownload | ( | ) | const |
Returns the last downloaded component if there is one.
boost::optional<BCLMeasure> openstudio::RemoteBCL::lastMeasureDownload | ( | ) | const |
Returns the last downloaded measure if there is one.
boost::optional<BCLMetaSearchResult> openstudio::RemoteBCL::lastMetaSearch | ( | ) | const |
Returns the last meta search result if there is one.
std::vector<BCLSearchResult> openstudio::RemoteBCL::lastSearch | ( | ) | const |
Returns the last search results if there are any.
int openstudio::RemoteBCL::lastTotalResults | ( | ) | const |
Return the total number of results.
std::vector<BCLSearchResult> openstudio::RemoteBCL::measuresWithUpdates | ( | ) | const |
boost::optional<BCLMetaSearchResult> openstudio::RemoteBCL::metaSearchComponentLibrary | ( | const std::string & | searchTerm, |
const std::string & | componentType, | ||
const std::string & | filterType = "nrel_component" |
||
) | const |
Perform a meta search on the library to identify number and types of results available.
The total number of search results available can be used in the search method which requires a page number.
boost::optional<BCLMetaSearchResult> openstudio::RemoteBCL::metaSearchComponentLibrary | ( | const std::string & | searchTerm, |
const unsigned | componentTypeTID, | ||
const std::string & | filterType = "nrel_component" |
||
) | const |
int openstudio::RemoteBCL::numResultPages | ( | ) | const |
Return the number of pages of results.
std::string openstudio::RemoteBCL::prodAuthKey | ( | ) | const |
Return production OAuth key.
|
static |
Get the remote development url.
|
static |
Get the remote production url.
std::string openstudio::RemoteBCL::remoteUrl | ( | ) | const |
Get the current remote url.
int openstudio::RemoteBCL::resultsPerQuery | ( | ) | const |
Return the number of results per query.
std::vector<BCLSearchResult> openstudio::RemoteBCL::searchComponentLibrary | ( | const std::string & | searchTerm, |
const std::string & | componentType, | ||
const unsigned | page = 0 |
||
) | const |
Perform a component search of the library, results are returned in 'pages', the number of results per page is configurable and a metasearch should be performed to determine the total number of results pages available.
std::vector<BCLSearchResult> openstudio::RemoteBCL::searchComponentLibrary | ( | const std::string & | searchTerm, |
const unsigned | componentTypeTID, | ||
const unsigned | page = 0 |
||
) | const |
std::vector<BCLSearchResult> openstudio::RemoteBCL::searchMeasureLibrary | ( | const std::string & | searchTerm, |
const std::string & | componentType, | ||
const unsigned | page = 0 |
||
) | const |
Perform a measure search of the library, results are returned in 'pages', the number of results per page is configurable and a metasearch should be performed to determine the total number of results pages available.
std::vector<BCLSearchResult> openstudio::RemoteBCL::searchMeasureLibrary | ( | const std::string & | searchTerm, |
const unsigned | componentTypeTID, | ||
const unsigned | page = 0 |
||
) | const |
bool openstudio::RemoteBCL::setDevAuthKey | ( | const std::string & | devAuthKey | ) |
Set the development OAuth key.
bool openstudio::RemoteBCL::setProdAuthKey | ( | const std::string & | prodAuthKey | ) |
Set the production OAuth key.
bool openstudio::RemoteBCL::setTimeOutSeconds | ( | unsigned | timeOutSeconds | ) |
bool openstudio::RemoteBCL::startComponentLibraryMetaSearch | ( | const std::string & | searchTerm, |
const std::string & | componentType, | ||
const std::string & | filterType | ||
) |
Start a meta search, if successful this will start a download.
bool openstudio::RemoteBCL::startComponentLibraryMetaSearch | ( | const std::string & | searchTerm, |
const unsigned | componentTypeTID, | ||
const std::string & | filterType | ||
) |
bool openstudio::RemoteBCL::startComponentLibrarySearch | ( | const std::string & | searchTerm, |
const std::string & | componentType, | ||
const std::string & | filterType, | ||
const unsigned | page = 0 |
||
) |
Start a search, if successful this will start a download.
bool openstudio::RemoteBCL::startComponentLibrarySearch | ( | const std::string & | searchTerm, |
const unsigned | componentTypeTID, | ||
const std::string & | filterType, | ||
const unsigned | page = 0 |
||
) |
unsigned openstudio::RemoteBCL::timeOutSeconds | ( | ) | const |
void openstudio::RemoteBCL::updateComponents | ( | ) |
Replace local components and measures with the latest versions.
void openstudio::RemoteBCL::updateMeasures | ( | ) |
void openstudio::RemoteBCL::useRemoteDevelopmentUrl | ( | ) |
Use the development production server url.
void openstudio::RemoteBCL::useRemoteProductionUrl | ( | ) |
Use the development production server url.
boost::optional<BCLComponent> openstudio::RemoteBCL::waitForComponentDownload | ( | ) | const |
Wait number of milliseconds for download to complete Returns the download if it completed in the allowable time.
OS_DEPRECATED boost::optional<BCLComponent> openstudio::RemoteBCL::waitForComponentDownload | ( | int | ) | const |
boost::optional<BCLMeasure> openstudio::RemoteBCL::waitForMeasureDownload | ( | ) | const |
Wait number of milliseconds for download to complete Returns the download if it completed in the allowable time.
OS_DEPRECATED boost::optional<BCLMeasure> openstudio::RemoteBCL::waitForMeasureDownload | ( | int | ) | const |
boost::optional<BCLMetaSearchResult> openstudio::RemoteBCL::waitForMetaSearch | ( | ) | const |
Wait number of milliseconds for download to complete Returns the download if it completed in the allowable time.
OS_DEPRECATED boost::optional<BCLMetaSearchResult> openstudio::RemoteBCL::waitForMetaSearch | ( | int | ) | const |
std::vector<BCLSearchResult> openstudio::RemoteBCL::waitForSearch | ( | ) | const |
Wait number of milliseconds for download to complete Returns the download if it completed in the allowable time.
OS_DEPRECATED std::vector<BCLSearchResult> openstudio::RemoteBCL::waitForSearch | ( | int | ) | const |
Nano::Signal<void(const std::string& uid, const boost::optional<BCLComponent>& component)> openstudio::RemoteBCL::componentDownloaded |
Emitted when a component download completes.
Nano::Signal<void(const std::string& uid, const boost::optional<BCLMeasure>& measure)> openstudio::RemoteBCL::measureDownloaded |
Emitted when a measure download completes.