11#include "Teuchos_StandardParameterEntryValidators.hpp"
22 dependentVisible_(
false),
31 dependentVisible_(
false),
40 dependentVisible_(
false),
49 dependentVisible_(
false),
54 return dependentVisible_;
63 dependentVisible_ =
true;
66 dependentVisible_ =
false;
105 const std::string& value,
131 return find(values_.begin(), values_.end(),
136 return "StringVisualDependency";
142 "Ay no! The dependee of a "
143 "String Visual Dependency must be of type "
146 std::endl << std::endl);
182 return "BoolVisualDependency";
188 "Ay no! The dependee of a "
189 "Bool Visual Dependency must be of type " <<
192 std::endl << std::endl);
228 return condition_->isConditionTrue();
232 return "ConditionVisualDependency";
270 return valuesAndValidators_;
276 return defaultValidator_;
289 valuesAndValidators_.end())
291 (*it)->setValidator(defaultValidator_);
300 return "StringValidatorDependency";
306 "Ay no! The dependee of a "
307 "String Validator Dependency must be of type " <<
310 std::endl << std::endl);
313 valuesAndValidators_.size() < 1,
315 "The valuesAndValidatord map for a string validator dependency must "
316 "have at least one entry!" << std::endl << std::endl);
317 ValueToValidatorMap::const_iterator
it = valuesAndValidators_.begin();
322 for(;
it != valuesAndValidators_.end(); ++
it){
326 "Ay no! All of the validators in a StringValidatorDependency "
327 "must have the same type.");
377 (*it)->setValidator(trueValidator_)
379 (*it)->setValidator(falseValidator_);
386 return trueValidator_;
392 return falseValidator_;
396 return "BoolValidatorDependency";
404 "Ay no! The dependee of a "
405 "Bool Validator Dependency must be of type " <<
408 std::endl << std::endl);
416 "Ay no! The true and false validators of a Bool Validator Dependency "
417 "must be the same type! " <<std::endl << std::endl);
A collection of standard dependencies.
A BoolValidatorDependency says the following about the relationship between two parameters: Dependeni...
BoolValidatorDependency(RCP< const ParameterEntry > dependee, RCP< ParameterEntry > dependent, RCP< const ParameterEntryValidator > trueValidator, RCP< const ParameterEntryValidator > falseValidator=null)
Constructs a BoolValidatorDependency.
std::string getTypeAttributeValue() const
RCP< const ParameterEntryValidator > getTrueValidator() const
Gets the true validator.
void validateDep() const
Validates the dependency to make sure it's valid/has been setup properly. If subclassing,...
RCP< const ParameterEntryValidator > getFalseValidator() const
Gets the false validator.
A bool visual dependency says the following about the relationship between two elements in a Paramete...
bool getDependeeState() const
std::string getTypeAttributeValue() const
BoolVisualDependency(RCP< const ParameterEntry > dependee, RCP< ParameterEntry > dependent, bool showIf=true)
A condition visual dependency says the following about the relationship between elements in a Paramet...
std::string getTypeAttributeValue() const
bool getDependeeState() const
ConditionVisualDependency(RCP< const Condition > condition, RCP< ParameterEntry > dependent, bool showIf=true)
RCP< const Condition > getCondition() const
Gets the condition being used in this dependency.
This class represents a depndency between elements in a Parameter List.
ParameterEntryList & getDependents()
Gets the dependents of the dependency.
std::set< RCP< ParameterEntry >, RCPComp > ParameterEntryList
A list of Dependees.
std::set< RCP< const ParameterEntry >, RCPConstComp > ConstParameterEntryList
A list of dependents.
RCP< const ParameterEntry > getFirstDependee() const
Gets the first dependee in the dependees list. This is a convience function.
Class for retrieving a dummy object of type T.
static RCP< T > getDummyObject()
Retrieves a dummy object of type T.
Abstract interface for an object that can validate a ParameterEntry's value.
This object is held as the "value" in the Teuchos::ParameterList std::map.
Smart reference counting pointer class for automatic garbage collection.
RCP< T > rcp(const boost::shared_ptr< T > &sptr)
Conversion function that takes in a boost::shared_ptr object and spits out a Teuchos::RCP object.
bool is_null() const
Returns true if the underlying pointer is null.
T * get() const
Get the raw C++ pointer to the underlying object.
A StringValidatorDependency says the following about the relationship between two parameters: Depende...
void validateDep() const
Validates the dependency to make sure it's valid/has been setup properly. If subclassing,...
std::string getTypeAttributeValue() const
const ValueToValidatorMap & getValuesAndValidators() const
retrieve a const reference to the ValueToValidator map being used by this StringValidatorDependency
RCP< const ParameterEntryValidator > getDefaultValidator() const
std::pair< std::string, RCP< const ParameterEntryValidator > > ValueToValidatorPair
Conveniece typedef.
StringValidatorDependency(RCP< const ParameterEntry > dependee, RCP< ParameterEntry > dependent, ValueToValidatorMap valuesAndValidators, RCP< ParameterEntryValidator > defaultValidator=null)
Constructs a StringValidatorDependency.
std::map< std::string, RCP< const ParameterEntryValidator > > ValueToValidatorMap
Conveniece typedef.
A string visual dependency says the following about the relationship between two elements in a Parame...
const ValueList & getValues() const
get the List of values the dependee will be checked against.
StringVisualDependency(RCP< const ParameterEntry > dependee, RCP< ParameterEntry > dependent, std::string value, bool showIf=true)
Constructs a StringVisualDependency.
std::string getTypeAttributeValue() const
bool getDependeeState() const
Default traits class that just returns typeid(T).name().
An abstract base class for all validator dependencies.
ValidatorDependency(RCP< const ParameterEntry > dependee, RCP< ParameterEntry > dependent)
Constructs a ValidatorDependency.
An abstract parent class for all visual dependencies.
bool isDependentVisible() const
Determines whether or not the dependent is currently visible.
virtual bool getDependeeState() const =0
Get the state of the dependee in order to evaluate the dependency.
bool getShowIf() const
Get's the value of the showIf variable.
VisualDependency(RCP< const ParameterEntry > dependee, RCP< ParameterEntry > dependent, bool showIf=getShowIfDefaultValue())
Constructs a VisualDependency.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
std::string typeName(const T &t)
Template function for returning the concrete type name of a passed-in object.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...