22 dependentVisible_(false),
31 dependentVisible_(false),
40 dependentVisible_(false),
49 dependentVisible_(false),
105 const std::string& value,
132 getFirstDependeeValue<std::string>()) !=
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);
152 std::string blahString =
"blah";
178 return getFirstDependeeValue<bool>();
182 return "BoolVisualDependency";
188 "Ay no! The dependee of a "
189 "Bool Visual Dependency must be of type " <<
192 std::endl << std::endl);
208 condition_(condition)
218 condition_(condition)
232 return "ConditionVisualDependency";
249 valuesAndValidators_(valuesAndValidators),
250 defaultValidator_(defaultValidator)
261 valuesAndValidators_(valuesAndValidators),
262 defaultValidator_(defaultValidator)
280 std::string currentDependeeValue = getFirstDependeeValue<std::string>();
300 return "StringValidatorDependency";
306 "Ay no! The dependee of a "
307 "String Validator Dependency must be of type " <<
310 std::endl << std::endl);
315 "The valuesAndValidatord map for a string validator dependency must "
316 "have at least one entry!" << std::endl << std::endl);
326 "Ay no! All of the validators in a StringValidatorDependency "
327 "must have the same type.");
335 std::string blahString =
"blah";
351 trueValidator_(trueValidator),
352 falseValidator_(falseValidator)
363 trueValidator_(trueValidator),
364 falseValidator_(falseValidator)
370 bool dependeeValue = getFirstDependeeValue<bool>();
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);
RCP< const ParameterEntryValidator > getDefaultValidator() const
std::string typeName(const T &t)
Template function for returning the concrete type name of a passed-in object.
RCP< ParameterEntryValidator > defaultValidator_
The default validator to be used if a request is made for a value that does not appear in the valuesA...
static RCP< T > getDummyObject()
Retrieves a dummy object of type T.
A BoolValidatorDependency says the following about the relationship between two parameters: Dependeni...
std::pair< std::string, RCP< const ParameterEntryValidator > > ValueToValidatorPair
Conveniece typedef.
std::set< RCP< const ParameterEntry >, RCPConstComp > ConstParameterEntryList
A list of dependents.
An abstract parent class for all visual dependencies.
ParameterEntryList & getDependents()
Gets the dependents of the dependency.
BoolValidatorDependency(RCP< const ParameterEntry > dependee, RCP< ParameterEntry > dependent, RCP< const ParameterEntryValidator > trueValidator, RCP< const ParameterEntryValidator > falseValidator=null)
Constructs a BoolValidatorDependency.
A string visual dependency says the following about the relationship between two elements in a Parame...
RCP< const ParameterEntryValidator > trueValidator_
The validators to be used when the dependee is either true or false.
A bool visual dependency says the following about the relationship between two elements in a Paramete...
bool dependentVisible_
Whether or not the dependent is currently visible.
std::string getTypeAttributeValue() const
void validateDep() const
Validates the dependency to make sure it's valid/has been setup properly. If subclassing, this fucntion should be called in the new subclasses constructor.
std::set< RCP< ParameterEntry >, RCPComp > ParameterEntryList
A list of Dependees.
std::string getTypeAttributeValue() const
This object is held as the "value" in the Teuchos::ParameterList std::map.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
bool getShowIf() const
Get's the value of the showIf variable.
std::string getTypeAttributeValue() const
const ValueToValidatorMap & getValuesAndValidators() const
retrieve a const reference to the ValueToValidator map being used by this StringValidatorDependency ...
T * get() const
Get the raw C++ pointer to the underlying object.
bool getDependeeState() const
VisualDependency(RCP< const ParameterEntry > dependee, RCP< ParameterEntry > dependent, bool showIf=getShowIfDefaultValue())
Constructs a VisualDependency.
std::map< std::string, RCP< const ParameterEntryValidator > > ValueToValidatorMap
Conveniece typedef.
This class represents a depndency between elements in a Parameter List.
RCP< const ParameterEntryValidator > falseValidator_
const ValueList & getValues() const
get the List of values the dependee will be checked against.
RCP< const ParameterEntryValidator > getFalseValidator() const
Gets the false validator.
bool showIf_
Whether or not to show the dependent if the dependee is set to the value.
RCP< const Condition > condition_
The Condition to determine whether or not the dependent is displayed.
BoolVisualDependency(RCP< const ParameterEntry > dependee, RCP< ParameterEntry > dependent, bool showIf=true)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.
ValueToValidatorMap valuesAndValidators_
A map associating particular dependee values with validators that could be placed on the dependent...
StringVisualDependency(RCP< const ParameterEntry > dependee, RCP< ParameterEntry > dependent, std::string value, bool showIf=true)
Constructs a StringVisualDependency.
RCP< const ParameterEntryValidator > getTrueValidator() const
Gets the true validator.
bool getDependeeState() const
ValidatorDependency(RCP< const ParameterEntry > dependee, RCP< ParameterEntry > dependent)
Constructs a ValidatorDependency.
A collection of standard dependencies.
RCP< const ParameterEntry > getFirstDependee() const
Gets the first dependee in the dependees list. This is a convience function.
Abstract interface for an object that can validate a ParameterEntry's value.
RCP< const Condition > getCondition() const
Gets the condition being used in this dependency.
Default traits class that just returns typeid(T).name().
Class for retrieving a dummy object of type T.
A StringValidatorDependency says the following about the relationship between two parameters: Depende...
ConditionVisualDependency(RCP< const Condition > condition, RCP< ParameterEntry > dependent, bool showIf=true)
An abstract base class for all validator dependencies.
StringValidatorDependency(RCP< const ParameterEntry > dependee, RCP< ParameterEntry > dependent, ValueToValidatorMap valuesAndValidators, RCP< ParameterEntryValidator > defaultValidator=null)
Constructs a StringValidatorDependency.
Smart reference counting pointer class for automatic garbage collection.
std::string getTypeAttributeValue() const
A condition visual dependency says the following about the relationship between elements in a Paramet...
bool getDependeeState() const
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.
std::string getTypeAttributeValue() const
void validateDep() const
Validates the dependency to make sure it's valid/has been setup properly. If subclassing, this fucntion should be called in the new subclasses constructor.