OpenStudio:model
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Related Functions | List of all members
openstudio::model::ScheduleTypeRegistrySingleton Class Reference

#include <ScheduleTypeRegistry.hpp>

Public Member Functions

std::vector< std::string > classNames () const
 Returns the names of classes that have ScheduleTypes registered with the ScheduleTypeRegistry. More...
 
std::string getDefaultName (const ScheduleType &scheduleType) const
 
ScheduleTypeLimits getOrCreateScheduleTypeLimits (const ScheduleType &scheduleType, Model &model) const
 Finds and returns a compatible ScheduleTypeLimits already in model, or creates and returns a new one. More...
 
ScheduleType getScheduleType (const std::string &className, const std::string &scheduleDisplayName) const
 Returns a particular ScheduleType, based on the className and scheduleDisplayName keys. More...
 
std::vector< ScheduleTypegetScheduleTypesByClassName (const std::string &className) const
 Returns all the ScheduleTypes registered for className. More...
 

Related Functions

(Note that these are not member functions.)

bool checkOrAssignScheduleTypeLimits (const std::string &className, const std::string &scheduleDisplayName, Schedule &schedule)
 If schedule.scheduleTypeLimtis(), returns true if that ScheduleTypeLimits isCompatible and otherwise returns false. More...
 
std::vector< ScheduleTypeLimitsgetCompatibleScheduleTypeLimits (const Model &model, const std::string &className, const std::string &scheduleDisplayName)
 Returns all of the ScheduleTypeLimtis already in model that are compatible with className and scheduleDisplayName. More...
 
bool isCompatible (const std::string &className, const std::string &scheduleDisplayName, const ScheduleTypeLimits &candidate)
 Returns true if candidate is consistent with the ScheduleType that corresponds to className and scheduleRelationshipName. More...
 
typedef openstudio::Singleton
< ScheduleTypeRegistrySingleton
ScheduleTypeRegistry
 

Detailed Description

Singleton class that contains a registry of all types of schedules that can exist in a Model.

Do not use directly, but rather, use the ScheduleTypeRegistry typedef (e.g.

ScheduleType st = ScheduleTypeRegistry::instance().getScheduleType("Lights","Lighting")

).

Member Function Documentation

std::vector<std::string> openstudio::model::ScheduleTypeRegistrySingleton::classNames ( ) const

Returns the names of classes that have ScheduleTypes registered with the ScheduleTypeRegistry.

std::string openstudio::model::ScheduleTypeRegistrySingleton::getDefaultName ( const ScheduleType scheduleType) const
ScheduleTypeLimits openstudio::model::ScheduleTypeRegistrySingleton::getOrCreateScheduleTypeLimits ( const ScheduleType scheduleType,
Model model 
) const

Finds and returns a compatible ScheduleTypeLimits already in model, or creates and returns a new one.

If the scheduleType is not fully specified, that is, if at least one of lowerLimitValue and upperLimitValue are not fixed, a new ScheduleTypeLimits is always created so the user can change those limits at will.

ScheduleType openstudio::model::ScheduleTypeRegistrySingleton::getScheduleType ( const std::string &  className,
const std::string &  scheduleDisplayName 
) const

Returns a particular ScheduleType, based on the className and scheduleDisplayName keys.

Throws if there is no such ScheduleType registered.

std::vector<ScheduleType> openstudio::model::ScheduleTypeRegistrySingleton::getScheduleTypesByClassName ( const std::string &  className) const

Returns all the ScheduleTypes registered for className.

Friends And Related Function Documentation

bool checkOrAssignScheduleTypeLimits ( const std::string &  className,
const std::string &  scheduleDisplayName,
Schedule schedule 
)
related

If schedule.scheduleTypeLimtis(), returns true if that ScheduleTypeLimits isCompatible and otherwise returns false.

Otherwise, uses ScheduleTypeRegistrySingleton::getOrCreateScheduleTypeLimits to find an appropriate ScheduleTypeLimits and then calls Schedule::setScheduleTypeLimtis, which should succeed in this case. This method is used by all of the ModelObject methods that set schedules.

std::vector< ScheduleTypeLimits > getCompatibleScheduleTypeLimits ( const Model model,
const std::string &  className,
const std::string &  scheduleDisplayName 
)
related

Returns all of the ScheduleTypeLimtis already in model that are compatible with className and scheduleDisplayName.

May be used instead of ScheduleTypeRegistrySingleton::getOrCreateScheduleTypeLimits to reduce the number of ScheduleTypeLimits that are ultimately created and present in a model.

bool isCompatible ( const std::string &  className,
const std::string &  scheduleDisplayName,
const ScheduleTypeLimits candidate 
)
related

Returns true if candidate is consistent with the ScheduleType that corresponds to className and scheduleRelationshipName.

Throws if there is no such ScheduleType.

typedef openstudio::Singleton<ScheduleTypeRegistrySingleton> ScheduleTypeRegistry
related