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

#include <WorkspaceExtensibleGroup.hpp>

+ Inheritance diagram for openstudio::WorkspaceExtensibleGroup:

Public Member Functions

virtual ~WorkspaceExtensibleGroup () override=default
 
Getters
boost::optional< WorkspaceObjectgetTarget (unsigned fieldIndex) const
 Returns the object pointed to by field index, if it exists.
 
std::vector< WorkspaceObjectgetTargets () const
 Returns all objects pointed to by this object.
 
std::vector< unsigned > getSourceFieldIndices (const Handle &targetHandle) const
 Returns the fieldIndex of the field in this extensible group that points to targetHandle, if possible.
 
Setters
bool setPointer (unsigned fieldIndex, const Handle &targetHandle)
 Sets the pointer at fieldIndex to point to target, if possible.
 
bool setPointer (unsigned fieldIndex, const Handle &targetHandle, bool checkValidity)
 
- Public Member Functions inherited from openstudio::IdfExtensibleGroup
virtual ~IdfExtensibleGroup ()=default
 
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.
 
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.
 
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==.
 
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.
 

Queries

using ImplType = detail::WorkspaceObject_Impl
 
bool isSource () const
 Returns true if this ExtensibleGroup points to another object.
 
bool canBeSource () const
 Returns true if this object can point to another object.
 
 WorkspaceExtensibleGroup (std::shared_ptr< detail::WorkspaceObject_Impl > impl, unsigned index)
 

Additional Inherited Members

Detailed Description

WorkspaceExtensibleGroup wraps a set of extensible fields in a WorkspaceObject.

Member Typedef Documentation

◆ ImplType

using openstudio::WorkspaceExtensibleGroup::ImplType = detail::WorkspaceObject_Impl
protected

Constructor & Destructor Documentation

◆ ~WorkspaceExtensibleGroup()

virtual openstudio::WorkspaceExtensibleGroup::~WorkspaceExtensibleGroup ( )
overridevirtualdefault

◆ WorkspaceExtensibleGroup()

openstudio::WorkspaceExtensibleGroup::WorkspaceExtensibleGroup ( std::shared_ptr< detail::WorkspaceObject_Impl > impl,
unsigned index )
protected

Member Function Documentation

◆ canBeSource()

bool openstudio::WorkspaceExtensibleGroup::canBeSource ( ) const

Returns true if this object can point to another object.

To qualify, there must be at least one object-list field.

◆ getSourceFieldIndices()

std::vector< unsigned > openstudio::WorkspaceExtensibleGroup::getSourceFieldIndices ( const Handle & targetHandle) const

Returns the fieldIndex of the field in this extensible group that points to targetHandle, if possible.

◆ getTarget()

boost::optional< WorkspaceObject > openstudio::WorkspaceExtensibleGroup::getTarget ( unsigned fieldIndex) const

Returns the object pointed to by field index, if it exists.

◆ getTargets()

std::vector< WorkspaceObject > openstudio::WorkspaceExtensibleGroup::getTargets ( ) const

Returns all objects pointed to by this object.

◆ isSource()

bool openstudio::WorkspaceExtensibleGroup::isSource ( ) const

Returns true if this ExtensibleGroup points to another object.

To qualify, there must be at least one pointer field holding a non-null pointer.

◆ setPointer() [1/2]

bool openstudio::WorkspaceExtensibleGroup::setPointer ( unsigned fieldIndex,
const Handle & targetHandle )

Sets the pointer at fieldIndex to point to target, if possible.

The field must be of object-list type, and target must be valid (in the containing Workspace, and if the strictness is greater than enums::None, of a proper type).

◆ setPointer() [2/2]

bool openstudio::WorkspaceExtensibleGroup::setPointer ( unsigned fieldIndex,
const Handle & targetHandle,
bool checkValidity )