#include "Component.hpp"
Public Member Functions | |
Component (const openstudio::IdfFile &idfFile) | |
virtual | ~Component () |
ComponentData | componentData () const |
ModelObject | primaryObject () const |
Protected Member Functions | |
Component (const std::vector< ModelObject > &contents) |
Related Functions | |
typedef std::vector< Component > | ComponentVector |
typedef boost::optional < Component > | OptionalComponent |
Serialization | |
virtual bool | save (const openstudio::path &p, bool overwrite=false) |
static boost::optional< Component > | load (const path &p) |
Component is a Model that contains exactly one ComponentData object.
All objects other than the ComponentData object and the version object are the Component contents. There is a primary ModelObject that provides the Component's type. There are no public constructors, as Components are to be constructed through the ModelObject method createComponent. Similarly, Model-level object addition and removal, and SqlFile functionality, has been disabled.
|
explicit |
Construct from an IdfFile.
Must contain exactly one ComponentData object, and contents list in ComponentData must exactly match the contents of idfFile.
|
virtual |
|
protected |
Construct from a vector of ModelObjects, all in the same .model().
The primary object must be listed first. Throws if contents.empty() or if more than one .model() is found. StrictnessLevel is always set to Draft. Not for general use; used by ModelObject::createComponent.
ComponentData openstudio::model::Component::componentData | ( | ) | const |
Returns the object that contains the contents list, unique identifiers, and timestamps for this Component.
|
static |
Load Component from path p, if possible.
ModelObject openstudio::model::Component::primaryObject | ( | ) | const |
Returns the primary ModelObject of this Component.
Can be used to access the Component type by using .optionalCast or iddObjectType().
|
virtual |
Save Component to path p.
Will construct the parent folder if its parent folder exists. An existing file will only be overwritten if if overwrite==true. If no extension is provided, componentFileExtension() will be used.
|
related |
|
related |