OpenStudioCore:ruleset
 All Classes Namespaces Functions Typedefs Enumerations Enumerator Pages
Protected Member Functions | List of all members
openstudio::ruleset::TranslationUserScript Class Reference

#include <TranslationUserScript.hpp>

+ Inheritance diagram for openstudio::ruleset::TranslationUserScript:

Public Member Functions

Constructors and Destructors
virtual ~TranslationUserScript ()
 
Getters
virtual std::vector< OSArgumentarguments (const openstudio::Workspace &workspace) const
 Returns the arguments for this script. More...
 
virtual std::vector< OSArgumentarguments (const openstudio::model::Model &model) const
 Returns the arguments for this script. More...
 
Actions
virtual bool run (openstudio::Workspace &workspace, openstudio::model::Model &model, OSRunner &runner, const std::map< std::string, OSArgument > &user_arguments) const
 Run the script on the given workspace and model with the given runner and user_arguments. More...
 
- Public Member Functions inherited from openstudio::ruleset::UserScript
virtual ~UserScript ()
 
virtual std::string name () const
 user facing name of this script, defaults to empty More...
 
virtual std::string description () const
 user facing description of this script, defaults to empty More...
 
virtual std::string modeler_description () const
 user facing technical description of this script, defaults to empty More...
 
virtual OS_DEPRECATED bool registerWithSketchUp () const
 Register this script with SketchUp. More...
 
virtual OS_DEPRECATED bool registerWithApplication () const
 Register this script with an Application. More...
 

Protected Member Functions

 TranslationUserScript ()
 
- Protected Member Functions inherited from openstudio::ruleset::UserScript
 UserScript ()
 

Additional Inherited Members

Detailed Description

TranslationUserScript is an abstract base class for UserScripts that operate on an OpenStudio Model and an OpenStudio Workspace.

Deprecated:

Constructor & Destructor Documentation

virtual openstudio::ruleset::TranslationUserScript::~TranslationUserScript ( )
virtual
openstudio::ruleset::TranslationUserScript::TranslationUserScript ( )
inlineprotected

Member Function Documentation

virtual std::vector<OSArgument> openstudio::ruleset::TranslationUserScript::arguments ( const openstudio::Workspace &  workspace) const
virtual

Returns the arguments for this script.

In interactive applications, an OSRunner presents these arguments to the user to produce an OSArgumentMap of user_arguments that it then passes to this script's run method. The same basic steps should happen in applications with non- interactive scripts, but in that case an entity other than an OSRunner may be in charge of collecting user arguments. The base class implementation returns an empty vector.

virtual std::vector<OSArgument> openstudio::ruleset::TranslationUserScript::arguments ( const openstudio::model::Model &  model) const
virtual

Returns the arguments for this script.

In interactive applications, an OSRunner presents these arguments to the user to produce an OSArgumentMap of user_arguments that it then passes to this script's run method. The same basic steps should happen in applications with non- interactive scripts, but in that case an entity other than an OSRunner may be in charge of collecting user arguments. The base class implementation returns an empty vector.

virtual bool openstudio::ruleset::TranslationUserScript::run ( openstudio::Workspace &  workspace,
openstudio::model::Model &  model,
OSRunner runner,
const std::map< std::string, OSArgument > &  user_arguments 
) const
virtual

Run the script on the given workspace and model with the given runner and user_arguments.

The base class implementation calls runner.prepareForUserScriptRun(*this) and should be called at the beginning of derived class implementations of this method. (In C++, that call looks like TranslationUserScript::run(workspace, model, runner, user_arguments). In Ruby that call looks like super(workspace, model, runner, user_arguments).