OpenStudio:utilities
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Related Functions | List of all members
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. More...
 
std::vector< std::string > fieldsWithHandles (bool returnDefault=false) const
 Returns this extensible group's fields. More...
 
std::vector< std::string > fieldComments (bool returnDefault=false) const
 Returns the comments associated with this extensible group's fields. More...
 
boost::optional< std::string > fieldComment (unsigned fieldIndex, bool returnDefault=false) const
 Returns the comment associated with this extensible group's field fieldIndex. More...
 
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)). More...
 
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. More...
 
bool isEmpty (unsigned fieldIndex) const
 Returns true if the field is empty. More...
 
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. More...
 
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. More...
 
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. More...
 
Setters
bool setFieldComment (unsigned fieldIndex, const std::string &cmnt)
 Sets the comment associated with this extensible group's field fieldIndex, if possible. More...
 
bool setFields (const std::vector< std::string > &values)
 Set all the fields in this IdfExtensibleGroup, if possible. More...
 
bool setString (unsigned fieldIndex, const std::string &value)
 Set this extensible group's field fieldIndex to value, if possible. More...
 
bool setString (unsigned fieldIndex, const std::string &value, bool checkValidity)
 setString that can delay signal emits. More...
 
bool setDouble (unsigned fieldIndex, double value)
 Set this extensible group's field fieldIndex to value, if possible. More...
 
bool setUnsigned (unsigned fieldIndex, unsigned value)
 Set this extensible group's field fieldIndex to value, if possible. More...
 
bool setInt (unsigned fieldIndex, int value)
 Set this extensible group's field fieldIndex to value, if possible. More...
 
IdfExtensibleGroup pushClone () const
 Clones the data in this extensible group, and pushes the new extensible group onto the end of the enclosing object. More...
 
IdfExtensibleGroup insertClone (unsigned groupIndex) const
 Clones the data in this extensible group, and inserts the new extensible group at groupIndex within the enclosing object. More...
 
Queries
bool empty () const
 Returns true if this ExtensibleGroup holds no data. More...
 
unsigned groupIndex () const
 Returns the (group) index of this ExtensibleGroup. More...
 
unsigned numFields () const
 Returns the number of fields in this ExtensibleGroup. More...
 
bool isValid (unsigned fieldIndex) const
 Returns true if fieldIndex is valid for this extensible group. More...
 
std::vector< unsigned > objectListFields () const
 Returns the indices of all fields that can point to other objects. More...
 
std::vector< unsigned > dataFields () const
 Returns the indices of all fields that are not objectListFields() (and are therefore plain alpha or numeric data). More...
 
std::vector< unsigned > requiredFields () const
 Returns the indices of all fields in this ExtensibleGroup that are required, as defined by the IddObject. More...
 
bool operator== (const IdfExtensibleGroup &other) const
 Equality comparator for IdfExtensibleGroups. More...
 
bool operator!= (const IdfExtensibleGroup &other) const
 Negation of operator==. More...
 
Type Casting
template<typename T >
cast () const
 cast to type T, can throw std::bad_cast More...
 
template<typename T >
boost::optional< T > optionalCast () const
 cast to optional of type T More...
 
template<typename T >
getObject () const
 Get the parent object. More...
 
template<typename T >
boost::optional< T > getOptionalObject () const
 Get the parent object. More...
 

Related Functions

(Note that these are not member functions.)

using IdfExtensibleGroupVector = std::vector< IdfExtensibleGroup >
 

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

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

Member Function Documentation

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

cast to type T, can throw std::bad_cast

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).

bool openstudio::IdfExtensibleGroup::empty ( ) const

Returns true if this ExtensibleGroup holds no data.

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

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

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

Returns the comments associated with this extensible group's 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().

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

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.

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.

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.

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

Get the parent object.

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

Get the parent object.

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)).

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.

unsigned openstudio::IdfExtensibleGroup::groupIndex ( ) const

Returns the (group) index of this ExtensibleGroup.

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

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.

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

Returns true if the field is empty.

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

Returns true if fieldIndex is valid for this extensible group.

unsigned openstudio::IdfExtensibleGroup::numFields ( ) const

Returns the number of fields in this ExtensibleGroup.

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

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

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

Negation of operator==.

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

Equality comparator for IdfExtensibleGroups.

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

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

cast to optional of type T

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.

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

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

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.

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.

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.

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.

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.

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

setString that can delay signal emits.

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 Function Documentation

using IdfExtensibleGroupVector = std::vector<IdfExtensibleGroup>
related