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

#include <IdfExtensibleGroup.hpp>

+ Inheritance diagram for openstudio::IdfExtensibleGroup:

Public Member Functions

Constructors and Destructors
virtual ~IdfExtensibleGroup ()=default
 
Getters
std::vector< std::string > fields (bool returnDefault=false) const
 Returns this extensible group's fields.
 
std::vector< std::string > fieldsWithHandles (bool returnDefault=false) const
 Returns this extensible group's fields.
 
std::vector< std::string > fieldComments (bool returnDefault=false) const
 Returns the comments associated with this extensible group's fields.
 
boost::optional< std::string > fieldComment (unsigned fieldIndex, bool returnDefault=false) const
 Returns the comment associated with this extensible group's field fieldIndex.
 
boost::optional< std::string > getString (unsigned fieldIndex, bool returnDefault=false) const
 Returns the string value of this extensible group's field fieldIndex, if that field exists (isValid(fieldIndex)).
 
boost::optional< std::string > getField (unsigned index, bool returnDefault=false) const
 Like getString except for reference fields getString will return the name of the referenced object.
 
bool isEmpty (unsigned fieldIndex) const
 Returns true if the field is empty.
 
boost::optional< double > getDouble (unsigned fieldIndex, bool returnDefault=false) const
 Returns the value, converted to type double, of this extensible group's field fieldIndex, if possible.
 
boost::optional< unsigned > getUnsigned (unsigned fieldIndex, bool returnDefault=false) const
 Returns the value, converted to type unsigned, of this extensible group's field fieldIndex, if possible.
 
boost::optional< intgetInt (unsigned fieldIndex, bool returnDefault=false) const
 Returns the value, converted to type int, of this extensible group's field fieldIndex, if possible.
 
Setters
bool setFieldComment (unsigned fieldIndex, const std::string &cmnt)
 Sets the comment associated with this extensible group's field fieldIndex, if possible.
 
bool setFields (const std::vector< std::string > &values)
 Set all the fields in this IdfExtensibleGroup, if possible.
 
bool setString (unsigned fieldIndex, const std::string &value)
 Set this extensible group's field fieldIndex to value, if possible.
 
bool setString (unsigned fieldIndex, const std::string &value, bool checkValidity)
 setString that can delay signal emits.
 
bool setDouble (unsigned fieldIndex, double value)
 Set this extensible group's field fieldIndex to value, if possible.
 
bool setUnsigned (unsigned fieldIndex, unsigned value)
 Set this extensible group's field fieldIndex to value, if possible.
 
bool setInt (unsigned fieldIndex, int value)
 Set this extensible group's field fieldIndex to value, if possible.
 
IdfExtensibleGroup pushClone () const
 Clones the data in this extensible group, and pushes the new extensible group onto the end of the enclosing object.
 
IdfExtensibleGroup insertClone (unsigned groupIndex) const
 Clones the data in this extensible group, and inserts the new extensible group at groupIndex within the enclosing object.
 
Queries
bool empty () const
 Returns true if this ExtensibleGroup holds no data.
 
unsigned groupIndex () const
 Returns the (group) index of this ExtensibleGroup.
 
unsigned numFields () const
 Returns the number of fields in this ExtensibleGroup.
 
bool isValid (unsigned fieldIndex) const
 Returns true if fieldIndex is valid for this extensible group.
 
std::vector< unsigned > objectListFields () const
 Returns the indices of all fields that can point to other objects.
 
std::vector< unsigned > dataFields () const
 Returns the indices of all fields that are not objectListFields() (and are therefore plain alpha or numeric data).
 
std::vector< unsigned > requiredFields () const
 Returns the indices of all fields in this ExtensibleGroup that are required, as defined by the IddObject.
 
bool operator== (const IdfExtensibleGroup &other) const
 Equality comparator for IdfExtensibleGroups.
 
bool operator!= (const IdfExtensibleGroup &other) const
 Negation of operator==.
 

Related Symbols

(Note that these are not member symbols.)

using IdfExtensibleGroupVector = std::vector<IdfExtensibleGroup>
 

Type Casting

template<typename T >
cast () const
 cast to type T, can throw std::bad_cast
 
template<typename T >
boost::optional< T > optionalCast () const
 cast to optional of type T
 
template<typename T >
getObject () const
 Get the parent object.
 
template<typename T >
boost::optional< T > getOptionalObject () const
 Get the parent object.
 

Detailed Description

IdfExtensibleGroup wraps a single set of extensible fields in an IdfObject.

For instance, many geometric objects have extensible groups each of which represents a single vertex (one three-dimensional point). (Also see the documentation for IddObject, IddObjectProperties, and ExtensibleIndex.)

Constructor & Destructor Documentation

◆ ~IdfExtensibleGroup()

virtual openstudio::IdfExtensibleGroup::~IdfExtensibleGroup ( )
virtualdefault

Member Function Documentation

◆ cast()

template<typename T >
T openstudio::IdfExtensibleGroup::cast ( ) const
inline

cast to type T, can throw std::bad_cast

◆ dataFields()

std::vector< unsigned > openstudio::IdfExtensibleGroup::dataFields ( ) const

Returns the indices of all fields that are not objectListFields() (and are therefore plain alpha or numeric data).

◆ empty()

bool openstudio::IdfExtensibleGroup::empty ( ) const

Returns true if this ExtensibleGroup holds no data.

◆ fieldComment()

boost::optional< std::string > openstudio::IdfExtensibleGroup::fieldComment ( unsigned fieldIndex,
bool returnDefault = false ) const

Returns the comment associated with this extensible group's field fieldIndex.

◆ fieldComments()

std::vector< std::string > openstudio::IdfExtensibleGroup::fieldComments ( bool returnDefault = false) const

Returns the comments associated with this extensible group's fields.

◆ fields()

std::vector< std::string > openstudio::IdfExtensibleGroup::fields ( bool returnDefault = false) const

Returns this extensible group's fields.

Return value will be empty() if this group is empty().

◆ fieldsWithHandles()

std::vector< std::string > openstudio::IdfExtensibleGroup::fieldsWithHandles ( bool returnDefault = false) const

Returns this extensible group's fields.

Return value will be empty() if this group is empty(). Unlike fields(), in the case it's a WorkspaceObject_Impl, it uses handles as string and not the name of the target object

◆ getDouble()

boost::optional< double > openstudio::IdfExtensibleGroup::getDouble ( unsigned fieldIndex,
bool returnDefault = false ) const

Returns the value, converted to type double, of this extensible group's field fieldIndex, if possible.

◆ getField()

boost::optional< std::string > openstudio::IdfExtensibleGroup::getField ( unsigned index,
bool returnDefault = false ) const

Like getString except for reference fields getString will return the name of the referenced object.

This method, getField, will always return the string value of the field.

◆ getInt()

boost::optional< int > openstudio::IdfExtensibleGroup::getInt ( unsigned fieldIndex,
bool returnDefault = false ) const

Returns the value, converted to type int, of this extensible group's field fieldIndex, if possible.

◆ getObject()

template<typename T >
T openstudio::IdfExtensibleGroup::getObject ( ) const
inline

Get the parent object.

◆ getOptionalObject()

template<typename T >
boost::optional< T > openstudio::IdfExtensibleGroup::getOptionalObject ( ) const
inline

Get the parent object.

◆ getString()

boost::optional< std::string > openstudio::IdfExtensibleGroup::getString ( unsigned fieldIndex,
bool returnDefault = false ) const

Returns the string value of this extensible group's field fieldIndex, if that field exists (isValid(fieldIndex)).

◆ getUnsigned()

boost::optional< unsigned > openstudio::IdfExtensibleGroup::getUnsigned ( unsigned fieldIndex,
bool returnDefault = false ) const

Returns the value, converted to type unsigned, of this extensible group's field fieldIndex, if possible.

◆ groupIndex()

unsigned openstudio::IdfExtensibleGroup::groupIndex ( ) const

Returns the (group) index of this ExtensibleGroup.

Indexing starts at 0. Throws if ExtensibleGroup is empty().

◆ insertClone()

IdfExtensibleGroup openstudio::IdfExtensibleGroup::insertClone ( unsigned groupIndex) const

Clones the data in this extensible group, and inserts the new extensible group at groupIndex within the enclosing object.

The returned IdfExtensibleGroup will be empty() if the operation cannot be completed.

◆ isEmpty()

bool openstudio::IdfExtensibleGroup::isEmpty ( unsigned fieldIndex) const

Returns true if the field is empty.

◆ isValid()

bool openstudio::IdfExtensibleGroup::isValid ( unsigned fieldIndex) const

Returns true if fieldIndex is valid for this extensible group.

◆ numFields()

unsigned openstudio::IdfExtensibleGroup::numFields ( ) const

Returns the number of fields in this ExtensibleGroup.

◆ objectListFields()

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

Returns the indices of all fields that can point to other objects.

◆ operator!=()

bool openstudio::IdfExtensibleGroup::operator!= ( const IdfExtensibleGroup & other) const

Negation of operator==.

◆ operator==()

bool openstudio::IdfExtensibleGroup::operator== ( const IdfExtensibleGroup & other) const

Equality comparator for IdfExtensibleGroups.

Tests for strict identity (same IdfObject, same groupIndex()).

◆ optionalCast()

template<typename T >
boost::optional< T > openstudio::IdfExtensibleGroup::optionalCast ( ) const
inline

cast to optional of type T

◆ pushClone()

IdfExtensibleGroup openstudio::IdfExtensibleGroup::pushClone ( ) const

Clones the data in this extensible group, and pushes the new extensible group onto the end of the enclosing object.

The returned IdfExtensibleGroup will be empty() if the operation cannot be completed.

◆ requiredFields()

std::vector< unsigned > openstudio::IdfExtensibleGroup::requiredFields ( ) const

Returns the indices of all fields in this ExtensibleGroup that are required, as defined by the IddObject.

◆ setDouble()

bool openstudio::IdfExtensibleGroup::setDouble ( unsigned fieldIndex,
double value )

Set this extensible group's field fieldIndex to value, if possible.

Returns false if it cannot be set for any reason.

◆ setFieldComment()

bool openstudio::IdfExtensibleGroup::setFieldComment ( unsigned fieldIndex,
const std::string & cmnt )

Sets the comment associated with this extensible group's field fieldIndex, if possible.

Otherwise, returns false.

◆ setFields()

bool openstudio::IdfExtensibleGroup::setFields ( const std::vector< std::string > & values)

Set all the fields in this IdfExtensibleGroup, if possible.

Returns false if values is wrong size or setString fails on any individual fields.

◆ setInt()

bool openstudio::IdfExtensibleGroup::setInt ( unsigned fieldIndex,
int value )

Set this extensible group's field fieldIndex to value, if possible.

Returns false if it cannot be set for any reason.

◆ setString() [1/2]

bool openstudio::IdfExtensibleGroup::setString ( unsigned fieldIndex,
const std::string & value )

Set this extensible group's field fieldIndex to value, if possible.

Returns false if it cannot be set for any reason.

◆ setString() [2/2]

bool openstudio::IdfExtensibleGroup::setString ( unsigned fieldIndex,
const std::string & value,
bool checkValidity )

setString that can delay signal emits.

◆ setUnsigned()

bool openstudio::IdfExtensibleGroup::setUnsigned ( unsigned fieldIndex,
unsigned value )

Set this extensible group's field fieldIndex to value, if possible.

Returns false if it cannot be set for any reason.

Friends And Related Symbol Documentation

◆ IdfExtensibleGroupVector

using IdfExtensibleGroupVector = std::vector<IdfExtensibleGroup>
related