OpenStudio:utilities/idd
Loading...
Searching...
No Matches
openstudio::IddFactory Class Reference

#include <IddFactory.hxx>

Public Member Functions

 IddFactory (const IddFactory &other)=delete
 
 IddFactory (IddFactory &&other)=delete
 
IddFactoryoperator= (const IddFactory &)=delete
 
IddFactoryoperator= (IddFactory &&)=delete
 
Getters
std::string getVersion (IddFileType fileType) const
 Get the file version.
 
std::string getHeader (IddFileType fileType) const
 Get the file header.
 
std::vector< IddObjectobjects () const
 Return all IddObjects registered in factory.
 
std::vector< IddObjectgetObjects (IddFileType fileType) const
 Return all IddObjects in IddFileType type.
 
std::vector< std::string > groups () const
 Return all groups in the factory (e.g.
 
std::vector< std::string > getGroups (IddFileType fileType) const
 Return all groups in fileType.
 
std::vector< IddObjectgetObjectsInGroup (const std::string &group) const
 Return all IddObjects in group (e.g.
 
std::vector< IddObjectgetObjectsInGroup (const std::string &group, IddFileType fileType) const
 Return all IddObjects in group and fileType.
 
std::vector< IddObjectgetObjects (const boost::regex &objectRegex) const
 Return all IddObjects that match objectRegex.
 
std::vector< IddObjectgetObjects (const boost::regex &objectRegex, IddFileType fileType) const
 Return all IddObjects that match objectRegex and are in fileType.
 
IddObject getVersionObject (IddFileType fileType) const
 Returns the version IddObject for fileType.
 
boost::optional< IddObjectgetObject (const std::string &objectName) const
 Return the IddObject with .name() objectName, if it exists in the factory.
 
boost::optional< IddObjectgetObject (IddObjectType objectType) const
 Return the IddObject corresponding to objectType.
 
std::vector< IddObjectrequiredObjects () const
 Return all objects in the factory that are required.
 
std::vector< IddObjectgetRequiredObjects (IddFileType fileType) const
 Return all objects in IddFile fileType that are required.
 
std::vector< IddObjectuniqueObjects () const
 Return all objects in the factory that are unique.
 
std::vector< IddObjectgetUniqueObjects (IddFileType fileType) const
 Return all objects in IddFile fileType that are unique.
 
IddFile getIddFile (IddFileType fileType) const
 Return the (current) IddFile corresponding to type.
 
boost::optional< IddFilegetIddFile (IddFileType fileType, const VersionString &version) const
 Return the IddFile corresponding to type and version.
 

Static Public Member Functions

static IddFactoryinstance ()
 

Queries

bool isInFile (IddObjectType objectType, IddFileType fileType) const
 Returns true if IddObject of objectType belongs to IddFile of fileType.
 

Detailed Description

IddFactory is a Singleton can return IddObjects and IddFiles for the current version of EnergyPlus and OpenStudio.

It can return IddFiles only (no link with other methods in this class, for instance, no by-IddObjectType access to individual IddObjects) for previous versions of OpenStudio, back to version 0.7.0. It also supports the default IddObject type, Catchall, which is provided to enable the display of IdfObjects with misspelled type names, and a CommentOnly object. Its primary function is to establish a single set of IDD schema across all of OpenStudio, thereby ensuring consistency and reducing file I-O.

Constructor & Destructor Documentation

◆ IddFactory() [1/2]

openstudio::IddFactory::IddFactory ( const IddFactory & other)
delete

◆ IddFactory() [2/2]

openstudio::IddFactory::IddFactory ( IddFactory && other)
delete

Member Function Documentation

◆ getGroups()

std::vector< std::string > openstudio::IddFactory::getGroups ( IddFileType fileType) const

Return all groups in fileType.

◆ getHeader()

std::string openstudio::IddFactory::getHeader ( IddFileType fileType) const

Get the file header.

Throws if fileType == IddFileType::UserCustom or IddFileType::WholeFactory.

◆ getIddFile() [1/2]

IddFile openstudio::IddFactory::getIddFile ( IddFileType fileType) const

Return the (current) IddFile corresponding to type.

◆ getIddFile() [2/2]

boost::optional< IddFile > openstudio::IddFactory::getIddFile ( IddFileType fileType,
const VersionString & version ) const

Return the IddFile corresponding to type and version.

Unless version is equal to VersionString(getVersion(fileType)), files are loaded from disk and returned as IddFileType::UserCustom, to distinguish them from the IDD information wrapped by the IddFactory. At this time, only IddFileType::OpenStudio files are supported, and only for valid version identifiers >= VersionString("0.7.0"). Returns false in all other cases.

◆ getObject() [1/2]

boost::optional< IddObject > openstudio::IddFactory::getObject ( const std::string & objectName) const

Return the IddObject with .name() objectName, if it exists in the factory.

◆ getObject() [2/2]

boost::optional< IddObject > openstudio::IddFactory::getObject ( IddObjectType objectType) const

Return the IddObject corresponding to objectType.

Returns false if type == IddObjectType::UserCustom.

◆ getObjects() [1/3]

std::vector< IddObject > openstudio::IddFactory::getObjects ( const boost::regex & objectRegex) const

Return all IddObjects that match objectRegex.

◆ getObjects() [2/3]

std::vector< IddObject > openstudio::IddFactory::getObjects ( const boost::regex & objectRegex,
IddFileType fileType ) const

Return all IddObjects that match objectRegex and are in fileType.

◆ getObjects() [3/3]

std::vector< IddObject > openstudio::IddFactory::getObjects ( IddFileType fileType) const

Return all IddObjects in IddFileType type.

◆ getObjectsInGroup() [1/2]

std::vector< IddObject > openstudio::IddFactory::getObjectsInGroup ( const std::string & group) const

Return all IddObjects in group (e.g.

"Simulation Parameters").

◆ getObjectsInGroup() [2/2]

std::vector< IddObject > openstudio::IddFactory::getObjectsInGroup ( const std::string & group,
IddFileType fileType ) const

Return all IddObjects in group and fileType.

◆ getRequiredObjects()

std::vector< IddObject > openstudio::IddFactory::getRequiredObjects ( IddFileType fileType) const

Return all objects in IddFile fileType that are required.

◆ getUniqueObjects()

std::vector< IddObject > openstudio::IddFactory::getUniqueObjects ( IddFileType fileType) const

Return all objects in IddFile fileType that are unique.

◆ getVersion()

std::string openstudio::IddFactory::getVersion ( IddFileType fileType) const

Get the file version.

Throws if fileType == IddFileType::UserCustom or IddFileType::WholeFactory.

◆ getVersionObject()

IddObject openstudio::IddFactory::getVersionObject ( IddFileType fileType) const

Returns the version IddObject for fileType.

Throws if fileType == IddFileType::UserCustom or IddFileType::WholeFactory.

◆ groups()

std::vector< std::string > openstudio::IddFactory::groups ( ) const

Return all groups in the factory (e.g.

"" and "Simulation Parameters").

◆ instance()

static IddFactory & openstudio::IddFactory::instance ( )
static

◆ isInFile()

bool openstudio::IddFactory::isInFile ( IddObjectType objectType,
IddFileType fileType ) const

Returns true if IddObject of objectType belongs to IddFile of fileType.

IddObjectType::Catchall is in no IddFiles; IddObjectType::CommentOnly is in all IddFiles.

◆ objects()

std::vector< IddObject > openstudio::IddFactory::objects ( ) const

Return all IddObjects registered in factory.

◆ operator=() [1/2]

IddFactory & openstudio::IddFactory::operator= ( const IddFactory & )
delete

◆ operator=() [2/2]

IddFactory & openstudio::IddFactory::operator= ( IddFactory && )
delete

◆ requiredObjects()

std::vector< IddObject > openstudio::IddFactory::requiredObjects ( ) const

Return all objects in the factory that are required.

◆ uniqueObjects()

std::vector< IddObject > openstudio::IddFactory::uniqueObjects ( ) const

Return all objects in the factory that are unique.