23 #include <boost/algorithm/string/join.hpp>
28 std::multimap<std::string,
35 RCObject(), itsName(name), itsHelp(help), itsDefault(def),
36 is_deferred(
false), is_readonly(
false)
46 "Internal error: should not call this method.");
55 "Attribute \"" +
itsName +
"\" has no default value.");
74 "You cannot assign to a component of \"" + itsName +
75 "\" which is not a vector value.");
99 const std::string& defaultValue)
101 std::string validValues =
" Valid values are " + boost::algorithm::join(predefinedValues,
", ") +
".";
102 if (defaultValue !=
"_HAS_NO_DEFAULT_") {
103 validValues +=
" Its default is " + defaultValue +
".";
105 std::string* help =
const_cast<std::string*
>(&
itsHelp);
106 *help += validValues;
110 std::multimap<OwnerType, std::string> possibleOwners;
115 for (
auto it = its.first;
it != its.second; ++
it) {
116 auto owner =
it->second;
118 possibleOwners.insert(std::make_pair(owner.first, owner.second));
122 return possibleOwners;
127 const std::string &name) {
bool isValid() const
Test for validity.
const std::string itsHelp
Help text.
virtual const std::string & getHelp() const
Return help string.
Abstract base class for reference counted objects.
Abstract base class for attribute parsers.
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed we want its recipients to know that what they have is not the so that any problems introduced by others will not reflect on the original authors reputations any free program is threatened constantly by software patents We wish to avoid the danger that redistributors of a free program will individually obtain patent in effect making the program proprietary To prevent we have made it clear that any patent must be licensed for everyone s free use or not licensed at all The precise terms and conditions for distribution and modification follow GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR DISTRIBUTION AND MODIFICATION This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License The refers to any such program or and a work based on the Program means either the Program or any derivative work under copyright a work containing the Program or a portion of it
Pointer< AttributeBase > itsDefault
Default value.
virtual AttributeBase * getDefault() const
Return default value.
void setReadOnly(bool)
Set or reset read-only flag.
bool isReadOnly() const
Return read-only flag.
bool isDeferred() const
Return defer flag.
bool is_deferred
Defer flag.
void setDeferred(bool)
Set or reset defer flag.
void setPredefinedValues(const std::set< std::string > &, const std::string &)
Add predefined strings values to the help.
virtual ~AttributeHandler()
The base class for all OPAL exceptions.
virtual const std::string & getName() const
Return attribute name.
Interface for statements.
Abstract base class for attribute values of different types.
static std::multimap< std::string, std::pair< OwnerType, std::string > > attributeOwnerDictionary_s
static std::multimap< OwnerType, std::string > getOwner(const std::string &att)
virtual AttributeHandler * clone() const
Make clone.
const std::string itsName
Attribute name.
virtual void parseComponent(Attribute &a, Statement &s, bool eval, int i) const
Parse component value.
static void addAttributeOwner(const std::string &owner, const OwnerType &type, const std::string &name)
bool is_readonly
Read-only flag.
A representation of an Object attribute.