OpenStudioCore:ruleset
 All Classes Namespaces Functions Typedefs Enumerations Enumerator Pages
Related Functions | List of all members
openstudio::ruleset::OSResult Class Reference

#include <OSResult.hpp>

Public Member Functions

Constructors and Destructors
 OSResult ()
 Default constructor sets value() to OSResultValue::Success. More...
 
 OSResult (const QDomElement &element)
 Construct from XML content. More...
 
Getters
OSResultValue value () const
 
std::vector< LogMessage > errors () const
 
std::vector< LogMessage > warnings () const
 
std::vector< LogMessage > info () const
 
boost::optional< LogMessage > initialCondition () const
 
boost::optional< LogMessage > finalCondition () const
 
std::vector< Attribute > attributes () const
 
Setters

Typically, these methods are not used directly, but are called by OSRunner methods such as OSRunner::registerError, OSRunner::registerAsNotApplicable.

void setValue (const OSResultValue &value)
 Set the result value. More...
 
void addError (const std::string &channel, const std::string &message)
 
void addWarning (const std::string &channel, const std::string &message)
 
void addInfo (const std::string &channel, const std::string &message)
 
void setInitialCondition (const std::string &channel, const std::string &message)
 
void setFinalCondition (const std::string &channel, const std::string &message)
 
void appendAttribute (const Attribute &attribute)
 

Related Functions

(Note that these are not member functions.)

typedef boost::optional< OSResultOptionalOSResult
 

Serialization

bool save (const openstudio::path &p, bool overwrite=false) const
 Saves this OSResult to path p (using an XML format and extension .ossr). More...
 
static boost::optional< OSResultload (const openstudio::path &p)
 Loads OSResult from the XML .ossr file at path p, if possible. More...
 

Detailed Description

Class for documenting the outcome of running a UserScript or a Ruleset.

There is an overall result flag (available from value()), and a number of message types.

Constructor & Destructor Documentation

openstudio::ruleset::OSResult::OSResult ( )

Default constructor sets value() to OSResultValue::Success.

openstudio::ruleset::OSResult::OSResult ( const QDomElement &  element)
explicit

Construct from XML content.

Called by OSResult::load.

Member Function Documentation

void openstudio::ruleset::OSResult::addError ( const std::string &  channel,
const std::string &  message 
)
void openstudio::ruleset::OSResult::addInfo ( const std::string &  channel,
const std::string &  message 
)
void openstudio::ruleset::OSResult::addWarning ( const std::string &  channel,
const std::string &  message 
)
void openstudio::ruleset::OSResult::appendAttribute ( const Attribute &  attribute)
std::vector<Attribute> openstudio::ruleset::OSResult::attributes ( ) const
std::vector<LogMessage> openstudio::ruleset::OSResult::errors ( ) const
boost::optional<LogMessage> openstudio::ruleset::OSResult::finalCondition ( ) const
std::vector<LogMessage> openstudio::ruleset::OSResult::info ( ) const
boost::optional<LogMessage> openstudio::ruleset::OSResult::initialCondition ( ) const
static boost::optional<OSResult> openstudio::ruleset::OSResult::load ( const openstudio::path &  p)
static

Loads OSResult from the XML .ossr file at path p, if possible.

Otherwise, returns boost::none.

bool openstudio::ruleset::OSResult::save ( const openstudio::path &  p,
bool  overwrite = false 
) const

Saves this OSResult to path p (using an XML format and extension .ossr).

void openstudio::ruleset::OSResult::setFinalCondition ( const std::string &  channel,
const std::string &  message 
)
void openstudio::ruleset::OSResult::setInitialCondition ( const std::string &  channel,
const std::string &  message 
)
void openstudio::ruleset::OSResult::setValue ( const OSResultValue value)

Set the result value.

OSResultValue openstudio::ruleset::OSResult::value ( ) const
std::vector<LogMessage> openstudio::ruleset::OSResult::warnings ( ) const

Friends And Related Function Documentation

typedef boost::optional<OSResult> OptionalOSResult
related