OpenStudioCore:utilities
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Protected Types | Protected Member Functions | List of all members
openstudio::WorkspaceExtensibleGroup Class Reference

#include <WorkspaceExtensibleGroup.hpp>

+ Inheritance diagram for openstudio::WorkspaceExtensibleGroup:

Public Member Functions

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

Protected Types

typedef
detail::WorkspaceObject_Impl 
ImplType
 

Protected Member Functions

 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

typedef detail::WorkspaceObject_Impl openstudio::WorkspaceExtensibleGroup::ImplType
protected

Constructor & Destructor Documentation

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

Member Function Documentation

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.

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.

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

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

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

Returns all objects pointed to by this object.

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.

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