Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
RefAttribute< T > Class Template Reference

#include <elm/xom/dtd.h>

+ Inheritance diagram for RefAttribute< T >:

Public Member Functions

 RefAttribute (Element &element, xom::String name, t::uint32 flags=0)
 
T * operator* () const
 
bool done () const
 
xom::String id () const
 
- Public Member Functions inherited from AbstractAttribute
 AbstractAttribute (Element &element, xom::String name, t::uint32 flags=0)
 
virtual ~AbstractAttribute ()
 
xom::String name () const
 
Elementelement () const
 
bool isRequired () const
 
bool isStrict () const
 
bool isForward () const
 
bool isSet () const
 
bool operator== (const AbstractAttribute &a) const
 
bool operator!= (const AbstractAttribute &a) const
 

Protected Member Functions

bool process (Parser &parser, xom::String value) override
 
void reset () override
 
void postprocess (Parser &parser) override
 
- Protected Member Functions inherited from AbstractAttribute
bool parse (Parser &parser)
 

Additional Inherited Members

- Static Public Attributes inherited from AbstractAttribute
static const t::uint32 REQUIRED = 0x01
 
static const t::uint32 STRICT = 0x02
 
static const t::uint32 FORWARD = 0x04
 

Detailed Description

template<class T>
class elm::dtd::RefAttribute< T >

Defines an attribute that is a reference to another XML element and therefore to a specific application object (recorded from an IDAttr attribute).

Parameters
TType of reference object.

Constructor & Destructor Documentation

◆ RefAttribute()

RefAttribute ( Element element,
xom::String  name,
t::uint32  flags = 0 
)
inline

Build a reference attribute.

Parameters
nameAttribute name.
flagsAttribute flags (see AbstractAttribute, optional).

Member Function Documentation

◆ done()

bool done ( ) const
inline

◆ id()

xom::String id ( ) const
inline

◆ operator*()

T* operator* ( ) const
inline

References elm::t::ref().

◆ postprocess()

void postprocess ( Parser parser)
inlineoverrideprotectedvirtual

Function called after the call to Factory::begin() for the element containing the attribute, if it has been recorded with Parser::addPost(). It is used for attributes requiring the reference to the application current object like identifiers or forward references.

The default implementation does nothing.

Parameters
parserCurrent parser.

Reimplemented from AbstractAttribute.

References Parser::recordPatch().

◆ process()

bool process ( Parser parser,
xom::String  value 
)
inlineoverrideprotectedvirtual

This function is called by parse() if a value is found for the attribute. The role of this function is to process the found value. The default implementation does nothing but it can overridden.

Reimplemented from AbstractAttribute.

References elm::_, Parser::addPost(), Parser::getID(), Parser::hasID(), Parser::raise(), and elm::t::ref().

◆ reset()

void reset ( )
inlineoverrideprotectedvirtual

Function called to reset the value stored in the attribute. The default implementation does nothing but it can be overridden.

Reimplemented from AbstractAttribute.

References elm::t::ref(), and AbstractAttribute::reset().


The documentation for this class was generated from the following files: