OpenStudio:utilities
Loading...
Searching...
No Matches
openstudio::RemoteBCL Class Reference

#include <RemoteBCL.hpp>

+ Inheritance diagram for openstudio::RemoteBCL:

Public Member Functions

Constructor
 RemoteBCL ()
 Default constructor.
 
Destructor
virtual ~RemoteBCL () override=default
 Virtual destructor.
 
Inherited members
virtual boost::optional< BCLComponentgetComponent (const std::string &uid, const std::string &versionId="") const override
 Get the component by uid.
 
virtual boost::optional< BCLMeasuregetMeasure (const std::string &uid, const std::string &versionId="") const override
 Get the measure by uid.
 
boost::optional< BCLMetaSearchResultmetaSearchComponentLibrary (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.
 
boost::optional< BCLMetaSearchResultmetaSearchComponentLibrary (const std::string &searchTerm, const unsigned componentTypeTID, const std::string &filterType="nrel_component") const
 
std::vector< BCLSearchResultsearchComponentLibrary (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< BCLSearchResultsearchComponentLibrary (const std::string &searchTerm, const unsigned componentTypeTID, const unsigned page=0) const
 
std::vector< BCLSearchResultsearchMeasureLibrary (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< BCLSearchResultsearchMeasureLibrary (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.
 
int checkForMeasureUpdates ()
 
std::vector< BCLSearchResultcomponentsWithUpdates () const
 Return the uids for components and measures respectively that have updates available.
 
std::vector< BCLSearchResultmeasuresWithUpdates () const
 
void updateComponents ()
 Replace local components and measures with the latest versions.
 
void updateMeasures ()
 
- Public Member Functions inherited from openstudio::BCL
virtual ~BCL ()=default
 Virtual destructor.
 

Non-blocking class members

Nano::Signal< void(const std::string &uid, const boost::optional< BCLComponent > &component)> componentDownloaded
 Emitted when a component download completes.
 
Nano::Signal< void(const std::string &uid, const boost::optional< BCLMeasure > &measure)> measureDownloaded
 Emitted when a measure download completes.
 
bool downloadComponent (const std::string &uid)
 Starts downloading an individual component by uid, if successful this will start a download.
 
bool downloadMeasure (const std::string &uid)
 Starts downloading an individual measure by uid, if successful this will start a download.
 
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.
 
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.
 
bool startComponentLibrarySearch (const std::string &searchTerm, const unsigned componentTypeTID, const std::string &filterType, const unsigned page=0)
 

Blocking class members

boost::optional< BCLComponentlastComponentDownload () const
 Returns the last downloaded component if there is one.
 
boost::optional< BCLMeasurelastMeasureDownload () const
 Returns the last downloaded measure if there is one.
 
boost::optional< BCLMetaSearchResultlastMetaSearch () const
 Returns the last meta search result if there is one.
 
std::vector< BCLSearchResultlastSearch () const
 Returns the last search results if there are any.
 
std::string remoteUrl () const
 Get the current remote url.
 
void useRemoteDevelopmentUrl ()
 Use the development production server url.
 
void useRemoteProductionUrl ()
 Use the development production server url.
 
std::string authKey () const
 Get the current OAuth key.
 
std::string prodAuthKey () const
 Return production OAuth key.
 
bool setProdAuthKey (const std::string &prodAuthKey)
 Set the production OAuth key.
 
std::string devAuthKey () const
 Return development OAuth key.
 
bool setDevAuthKey (const std::string &devAuthKey)
 Set the development OAuth key.
 
int resultsPerQuery () const
 Return the number of results per query.
 
int lastTotalResults () const
 Return the total number of results.
 
int numResultPages () const
 Return the number of pages of results.
 
unsigned timeOutSeconds () const
 
bool setTimeOutSeconds (unsigned timeOutSeconds)
 
boost::optional< BCLComponentwaitForComponentDownload () const
 Wait number of milliseconds for download to complete Returns the download if it completed in the allowable time.
 
OS_DEPRECATED boost::optional< BCLComponentwaitForComponentDownload (int) const
 
boost::optional< BCLMeasurewaitForMeasureDownload () const
 Wait number of milliseconds for download to complete Returns the download if it completed in the allowable time.
 
OS_DEPRECATED boost::optional< BCLMeasurewaitForMeasureDownload (int) const
 
boost::optional< BCLMetaSearchResultwaitForMetaSearch () const
 Wait number of milliseconds for download to complete Returns the download if it completed in the allowable time.
 
OS_DEPRECATED boost::optional< BCLMetaSearchResultwaitForMetaSearch (int) const
 
std::vector< BCLSearchResultwaitForSearch () const
 Wait number of milliseconds for download to complete Returns the download if it completed in the allowable time.
 
OS_DEPRECATED std::vector< BCLSearchResultwaitForSearch (int) const
 
static bool isOnline ()
 Returns true if there is an internet connection.
 
static std::string remoteProductionUrl ()
 Get the remote production url.
 
static std::string remoteDevelopmentUrl ()
 Get the remote development url.
 

Additional Inherited Members

- Protected Member Functions inherited from openstudio::BCL
 BCL ()
 Default constructor.
 

Detailed Description

Class for accessing the remote BCL.

Constructor & Destructor Documentation

◆ RemoteBCL()

openstudio::RemoteBCL::RemoteBCL ( )

Default constructor.

◆ ~RemoteBCL()

virtual openstudio::RemoteBCL::~RemoteBCL ( )
overridevirtualdefault

Virtual destructor.

Member Function Documentation

◆ authKey()

std::string openstudio::RemoteBCL::authKey ( ) const

Get the current OAuth key.

◆ checkForComponentUpdates()

int openstudio::RemoteBCL::checkForComponentUpdates ( )

Compare the versionIds of all downloaded components/measures to the published version online and return the number that have updates.

◆ checkForMeasureUpdates()

int openstudio::RemoteBCL::checkForMeasureUpdates ( )

◆ componentsWithUpdates()

std::vector< BCLSearchResult > openstudio::RemoteBCL::componentsWithUpdates ( ) const

Return the uids for components and measures respectively that have updates available.

◆ devAuthKey()

std::string openstudio::RemoteBCL::devAuthKey ( ) const

Return development OAuth key.

◆ downloadComponent()

bool openstudio::RemoteBCL::downloadComponent ( const std::string & uid)

Starts downloading an individual component by uid, if successful this will start a download.

◆ downloadMeasure()

bool openstudio::RemoteBCL::downloadMeasure ( const std::string & uid)

Starts downloading an individual measure by uid, if successful this will start a download.

◆ getComponent()

virtual boost::optional< BCLComponent > openstudio::RemoteBCL::getComponent ( const std::string & uid,
const std::string & versionId = "" ) const
overridevirtual

Get the component by uid.

Implements openstudio::BCL.

◆ getMeasure()

virtual boost::optional< BCLMeasure > openstudio::RemoteBCL::getMeasure ( const std::string & uid,
const std::string & versionId = "" ) const
overridevirtual

Get the measure by uid.

Implements openstudio::BCL.

◆ isOnline()

static bool openstudio::RemoteBCL::isOnline ( )
static

Returns true if there is an internet connection.

◆ lastComponentDownload()

boost::optional< BCLComponent > openstudio::RemoteBCL::lastComponentDownload ( ) const

Returns the last downloaded component if there is one.

◆ lastMeasureDownload()

boost::optional< BCLMeasure > openstudio::RemoteBCL::lastMeasureDownload ( ) const

Returns the last downloaded measure if there is one.

◆ lastMetaSearch()

boost::optional< BCLMetaSearchResult > openstudio::RemoteBCL::lastMetaSearch ( ) const

Returns the last meta search result if there is one.

◆ lastSearch()

std::vector< BCLSearchResult > openstudio::RemoteBCL::lastSearch ( ) const

Returns the last search results if there are any.

◆ lastTotalResults()

int openstudio::RemoteBCL::lastTotalResults ( ) const

Return the total number of results.

◆ measuresWithUpdates()

std::vector< BCLSearchResult > openstudio::RemoteBCL::measuresWithUpdates ( ) const

◆ metaSearchComponentLibrary() [1/2]

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.

◆ metaSearchComponentLibrary() [2/2]

boost::optional< BCLMetaSearchResult > openstudio::RemoteBCL::metaSearchComponentLibrary ( const std::string & searchTerm,
const unsigned componentTypeTID,
const std::string & filterType = "nrel_component" ) const

◆ numResultPages()

int openstudio::RemoteBCL::numResultPages ( ) const

Return the number of pages of results.

◆ prodAuthKey()

std::string openstudio::RemoteBCL::prodAuthKey ( ) const

Return production OAuth key.

◆ remoteDevelopmentUrl()

static std::string openstudio::RemoteBCL::remoteDevelopmentUrl ( )
static

Get the remote development url.

◆ remoteProductionUrl()

static std::string openstudio::RemoteBCL::remoteProductionUrl ( )
static

Get the remote production url.

◆ remoteUrl()

std::string openstudio::RemoteBCL::remoteUrl ( ) const

Get the current remote url.

◆ resultsPerQuery()

int openstudio::RemoteBCL::resultsPerQuery ( ) const

Return the number of results per query.

◆ searchComponentLibrary() [1/2]

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.

◆ searchComponentLibrary() [2/2]

std::vector< BCLSearchResult > openstudio::RemoteBCL::searchComponentLibrary ( const std::string & searchTerm,
const unsigned componentTypeTID,
const unsigned page = 0 ) const

◆ searchMeasureLibrary() [1/2]

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.

◆ searchMeasureLibrary() [2/2]

std::vector< BCLSearchResult > openstudio::RemoteBCL::searchMeasureLibrary ( const std::string & searchTerm,
const unsigned componentTypeTID,
const unsigned page = 0 ) const

◆ setDevAuthKey()

bool openstudio::RemoteBCL::setDevAuthKey ( const std::string & devAuthKey)

Set the development OAuth key.

◆ setProdAuthKey()

bool openstudio::RemoteBCL::setProdAuthKey ( const std::string & prodAuthKey)

Set the production OAuth key.

◆ setTimeOutSeconds()

bool openstudio::RemoteBCL::setTimeOutSeconds ( unsigned timeOutSeconds)

◆ startComponentLibraryMetaSearch() [1/2]

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.

◆ startComponentLibraryMetaSearch() [2/2]

bool openstudio::RemoteBCL::startComponentLibraryMetaSearch ( const std::string & searchTerm,
const unsigned componentTypeTID,
const std::string & filterType )

◆ startComponentLibrarySearch() [1/2]

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.

◆ startComponentLibrarySearch() [2/2]

bool openstudio::RemoteBCL::startComponentLibrarySearch ( const std::string & searchTerm,
const unsigned componentTypeTID,
const std::string & filterType,
const unsigned page = 0 )

◆ timeOutSeconds()

unsigned openstudio::RemoteBCL::timeOutSeconds ( ) const

◆ updateComponents()

void openstudio::RemoteBCL::updateComponents ( )

Replace local components and measures with the latest versions.

◆ updateMeasures()

void openstudio::RemoteBCL::updateMeasures ( )

◆ useRemoteDevelopmentUrl()

void openstudio::RemoteBCL::useRemoteDevelopmentUrl ( )

Use the development production server url.

◆ useRemoteProductionUrl()

void openstudio::RemoteBCL::useRemoteProductionUrl ( )

Use the development production server url.

◆ waitForComponentDownload() [1/2]

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.

◆ waitForComponentDownload() [2/2]

OS_DEPRECATED boost::optional< BCLComponent > openstudio::RemoteBCL::waitForComponentDownload ( int ) const

◆ waitForMeasureDownload() [1/2]

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.

◆ waitForMeasureDownload() [2/2]

OS_DEPRECATED boost::optional< BCLMeasure > openstudio::RemoteBCL::waitForMeasureDownload ( int ) const

◆ waitForMetaSearch() [1/2]

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.

◆ waitForMetaSearch() [2/2]

OS_DEPRECATED boost::optional< BCLMetaSearchResult > openstudio::RemoteBCL::waitForMetaSearch ( int ) const

◆ waitForSearch() [1/2]

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.

◆ waitForSearch() [2/2]

OS_DEPRECATED std::vector< BCLSearchResult > openstudio::RemoteBCL::waitForSearch ( int ) const

Member Data Documentation

◆ componentDownloaded

Nano::Signal<void(const std::string& uid, const boost::optional<BCLComponent>& component)> openstudio::RemoteBCL::componentDownloaded

Emitted when a component download completes.

◆ measureDownloaded

Nano::Signal<void(const std::string& uid, const boost::optional<BCLMeasure>& measure)> openstudio::RemoteBCL::measureDownloaded

Emitted when a measure download completes.