67 if(i->getName() ==
name)
return &(*i);
75 for(std::vector<Attribute>::const_iterator i =
itsAttr.begin();
77 if(i->getName() ==
name)
return &(*i);
87 "\" cannot be used to define a macro.");
93 "\" cannot be called as a macro.");
107 attr->parseComponent(stat,
true, index);
109 attr->parseComponent(stat,
false, index);
112 "Delimiter \"=\" or \":=\" expected.");
115 attr->parse(stat,
true);
117 attr->parse(stat,
false);
123 "\" has no attribute \"" +
name +
"\".");
138 attr->parse(stat, eval);
142 "\" has no attribute \"" +
name +
"\".");
146 attr->parse(stat,
false);
150 "\" has no attribute \"" +
name +
"\".");
164 if(parent != 0 && ! parent->
getOpalName().empty()) {
170 int pos = head.length();
172 for(std::vector<Attribute>::const_iterator i =
itsAttr.begin();
174 if(*i) i->print(pos);
196 for (
unsigned int i = 0; i <
end; ++ i) {
207 size_t maxLength = 16;
208 std::vector<Attribute>::const_iterator it;
210 std::string
name = it->getName();
215 std::string
type = it->getType();
216 std::string
name = it->getName();
217 *
gmsg <<
'\t' <<
type << std::string(16 -
type.length(),
' ');
218 *
gmsg <<
name << std::string(maxLength -
name.length(),
' ');
219 *
gmsg << it->getHelp();
220 if(it->isReadOnly()) *
gmsg <<
" (read only)";
275 const Object *base =
this;
292 const Object *
object =
this;
294 while(
object != 0 &&
object != classObject) {
328 RCObject(), itsAttr(size), itsParent(0),
329 itsName(
name), itsHelp(help), occurrence(0), sharedFlag(false) {
340 RCObject(), itsAttr(parent->itsAttr), itsParent(parent),
341 itsName(
name), itsHelp(parent->itsHelp), occurrence(0), sharedFlag(false) {
std::ostream & operator<<(std::ostream &os, const Object &object)
PartBunchBase< T, Dim >::ConstIterator end(PartBunchBase< T, Dim > const &bunch)
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
Inform & endl(Inform &inf)
std::string parseString(Statement &, const char msg[])
Parse string value.
void parseDelimiter(Statement &stat, char delim)
Test for one-character delimiter.
double parseRealConst(Statement &)
Parse real constant.
std::string::iterator iterator
boost::function< boost::tuple< double, bool >arguments_t)> type
A representation of an Object attribute.
static void addAttributeOwner(const std::string &owner, const OwnerType &type, const std::string &name)
Abstract base class for references which must be invalidated when an.
The base class for all OPAL objects.
void setParent(Object *)
Set parent object.
virtual void parseShortcut(Statement &, bool eval=true)
Parser for single-attribute commands.
void registerOwnership(const AttributeHandler::OwnerType &itsClass) const
virtual bool canReplaceBy(Object *object)
Test if replacement is allowed.
virtual Object * makeTemplate(const std::string &, TokenStream &, Statement &)
Macro handler function.
bool isFlagged() const
True, if [b]this[/b] is flagged by setFlag(true).
bool isDirty() const
True, if the [b]modified[/b] flag is set.
Object * getParent() const
Return parent pointer.
virtual void update()
Update this object.
const Object * getBaseObject() const
Return the object's base type object.
virtual Object * makeInstance(const std::string &name, Statement &, const Parser *)
Macro handler function.
const std::string & getOpalName() const
Return object name.
virtual void print(std::ostream &) const
Print the object.
int occurrenceCount()
Return the occurrence counter.
void copyAttributes(const Object &)
Copy attributes from another object.
void setDirty(bool)
Set/reset the [b]modified[/b] flag.
int increment()
Increment and return the occurrence counter.
virtual void setShared(bool)
Set/reset shared flag.
std::set< Invalidator * > references
virtual Attribute * findAttribute(const std::string &name)
Find an attribute by name.
void registerReference(Invalidator *a)
Register a reference to this object.
virtual void execute()
Execute the command.
void clear()
Clear the occurrence counter.
void setOpalName(const std::string &name)
Set object name.
virtual void printHelp(std::ostream &) const
Print help.
std::vector< Attribute > itsAttr
The object attributes.
bool isTreeMember(const Object *subTree) const
Test for tree membership.
virtual void parse(Statement &)
Parse the object.
bool isBuiltin() const
True, if [b]this[/b] is a built-in object.
virtual bool isShared() const
Shared flag.
void setFlag(bool)
Flag/unflag this object, e. g. to control output of objects for.
bool builtin
Built-in flag.
virtual void replace(Object *oldObject, Object *newObject)
Replace references.
void unregisterReference(Invalidator *a)
Unegister a reference to this object.
Abstract base class for reference counted objects.
Interface for abstract language parser.
Interface for statements.
void restore()
Return to marked position.
void mark()
Mark position in command.
bool word(std::string &value)
Return word value.
bool delimiter(char c)
Test for delimiter.
Abstract interface for a stream of input tokens.