OpenStudio:utilities/idd
 AllClasses Namespaces Functions Variables Typedefs Enumerations Enumerator Pages

#include "IddObject.hpp"

Public Member Functions

 IddObject ()
 IddObject (const IddObject &other)
std::string name () const
IddObjectType type () const
std::string group () const
const IddObjectPropertiesproperties () const
const std::vector< IddField > & nonextensibleFields () const
const std::vector< IddField > & extensibleGroup () const
boost::optional< IddFieldgetField (unsigned index) const
boost::optional< IddFieldgetField (const std::string &fieldName) const
boost::optional< int > getFieldIndex (const std::string &fieldName) const
void insertHandleField ()
unsigned numFields () const
unsigned numFieldsInDefaultObject () const
bool isVersionObject () const
bool isNonextensibleField (unsigned index) const
bool isExtensibleField (unsigned index) const
bool hasHandleField () const
bool hasNameField () const
boost::optional< unsigned > nameFieldIndex () const
bool isRequiredField (unsigned index) const
bool hasURL () const
std::vector< unsigned > urlFields () const
ExtensibleIndex extensibleIndex (unsigned index) const
unsigned index (ExtensibleIndex extensibleIndex) const
std::vector< std::string > references () const
std::set< std::string > objectLists () const
std::set< std::string > objectLists (unsigned index) const
std::vector< unsigned > objectListFields () const
bool operator== (const IddObject &other) const
bool operator!= (const IddObject &other) const

Related Functions

std::vector< std::string > getIddKeyNames (const IddObject &object, unsigned index)
std::set< IddObjectTypegetIddObjectTypeSet (const std::vector< IddObject > &objects)
std::vector< IddObjectTypegetIddObjectTypeVector (const std::vector< IddObject > &objects)
typedef std::vector< IddObjectIddObjectVector
std::ostream & operator<< (std::ostream &os, const IddObject &iddObject)
typedef boost::optional
< IddObject
OptionalIddObject

Serialization

std::ostream & print (std::ostream &os) const
static boost::optional< IddObjectload (const std::string &name, const std::string &group, const std::string &text, IddObjectType type)
static boost::optional< IddObjectload (const std::string &name, const std::string &group, const std::string &text)

Detailed Description

IddObject represents an object in the Idd.

IddObject is a shared object.

Constructor & Destructor Documentation

openstudio::IddObject::IddObject ( )

Default constructor returns Catchall object.

This object is provided to help users correct typos in their object names.

openstudio::IddObject::IddObject ( const IddObject other)

Copy constructor returns an IddObject that shares its data with other.

Member Function Documentation

const std::vector<IddField>& openstudio::IddObject::extensibleGroup ( ) const

Get this object's extensible group, that is, the vector of extensible IddFields that may be repeated indefinitely (except as capped by properties().maxFields) at the end of an IdfObject following this schema.

ExtensibleIndex openstudio::IddObject::extensibleIndex ( unsigned  index) const

Returns the ExtensibleIndex(groupIndex,fieldIndex) that corresponds to field index.

Throws if !isExtensibleField(index).

boost::optional<IddField> openstudio::IddObject::getField ( unsigned  index) const

Get the IddField at index, if it exists.

Returns fields in extensible groups using the assumption that extensible groups repeat indefinitely.

boost::optional<IddField> openstudio::IddObject::getField ( const std::string &  fieldName) const

Get the IddField in this object named fieldName.

Extensible fields are included, but they are not named uniquely.

boost::optional<int> openstudio::IddObject::getFieldIndex ( const std::string &  fieldName) const

Get the index of the IddField named fieldName.

std::string openstudio::IddObject::group ( ) const

Get the name of the IDD group to which this object belongs.

bool openstudio::IddObject::hasHandleField ( ) const

Returns true if first IddField is of type handle.

This should be true for every OpenStudio IddObject and false for every EnergyPlus IddObject.

bool openstudio::IddObject::hasNameField ( ) const

Returns true if the first IddField after the handle field, if present, is a name IddField.

bool openstudio::IddObject::hasURL ( ) const

Returns true if this object has any url fields.

unsigned openstudio::IddObject::index ( ExtensibleIndex  extensibleIndex) const

Returns the overall IddObject index equivalent to extensibleIndex.

Throws if IddObject is not extensible or if extensibleIndex.field >= properties().numExtensible.

void openstudio::IddObject::insertHandleField ( )

If not already present, inserts a field of type handle at the top of the object.

Not for general use.

bool openstudio::IddObject::isExtensibleField ( unsigned  index) const

Returns true if index, as used in an IdfObject following this schema, corresponds to a field in an extensible group.

bool openstudio::IddObject::isNonextensibleField ( unsigned  index) const

Returns true if index, as used in an IdfObject following this schema, corresponds to a non-extensible field.

bool openstudio::IddObject::isRequiredField ( unsigned  index) const

Returns true if index, as used in an IdfObject following this schema, corresponds to a required field.

bool openstudio::IddObject::isVersionObject ( ) const

Returns true if name contains some form of "Version".

static boost::optional<IddObject> openstudio::IddObject::load ( const std::string &  name,
const std::string &  group,
const std::string &  text,
IddObjectType  type 
)
static

Load from name, group, type, and text.

The first string in the IddObject text, appearing immediately before the first comma, is the IddObject name. The group string comes from the IddFile. If not constructed by the IddFactory, or the IddObject does not otherwise come from the EnergyPlus or OpenStudio IDD files, type should be equal to UserCustom. The constructor also needs the full text of the object for parsing.

static boost::optional<IddObject> openstudio::IddObject::load ( const std::string &  name,
const std::string &  group,
const std::string &  text 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

std::string openstudio::IddObject::name ( ) const

Get this IddObject's name.

boost::optional<unsigned> openstudio::IddObject::nameFieldIndex ( ) const

Returns the index containing the name field, if hasNameField().

Otherwise, returns boost::none.

const std::vector<IddField>& openstudio::IddObject::nonextensibleFields ( ) const

Get all non-extensible IddFields.

unsigned openstudio::IddObject::numFields ( ) const

Returns the number of non-extensible fields in this object.

unsigned openstudio::IddObject::numFieldsInDefaultObject ( ) const

Returns the initial number of fields with which to populate an IdfObject constructed from IddObject or IddObjectType.

Accounts for properties().minFields, properties().numExtensibleGroupsRequired, and IddField::properties().required.

std::vector<unsigned> openstudio::IddObject::objectListFields ( ) const

Returns the indices of the IddFields in this object of object-list type.

Includes indices in the first extensible group.

std::set<std::string> openstudio::IddObject::objectLists ( ) const

Returns the union of all the object lists to which fields in this object can refer.

std::set<std::string> openstudio::IddObject::objectLists ( unsigned  index) const

Returns all the object lists to which IddField index refers.

bool openstudio::IddObject::operator!= ( const IddObject other) const

The negation of operator==.

bool openstudio::IddObject::operator== ( const IddObject other) const

Returns true if all underlying data is equal (either trivially or by exhaustive comparison).

std::ostream& openstudio::IddObject::print ( std::ostream &  os) const

Print this object to os, in standard IDD format.

const IddObjectProperties& openstudio::IddObject::properties ( ) const

Get the properties of this object.

std::vector<std::string> openstudio::IddObject::references ( ) const

Returns the reference lists to which this object belongs.

This method only returns reference lists explicitly attached the name field. (It does not include 'AllObjects', for instance.)

IddObjectType openstudio::IddObject::type ( ) const

Get object type, as specified by the OPENSTUDIO_ENUM IddObjectType.

Similar information to name() for IddObjects stored by the IddFactory , that is type() == IddObjectType(name()) and type().valueDescription() == name().

std::vector<unsigned> openstudio::IddObject::urlFields ( ) const

Returns the indices of all fields of url type.

Friends And Related Function Documentation

std::vector< std::string > getIddKeyNames ( const IddObject object,
unsigned  index 
)
related

Converts the vector of IddKeys associated with object.getField(index) to a vector of std::string.

std::set< IddObjectType > getIddObjectTypeSet ( const std::vector< IddObject > &  objects)
related
std::vector< IddObjectType > getIddObjectTypeVector ( const std::vector< IddObject > &  objects)
related
typedef std::vector<IddObject> IddObjectVector
related
std::ostream & operator<< ( std::ostream &  os,
const IddObject iddObject 
)
related
typedef boost::optional<IddObject> OptionalIddObject
related