HGL::Type::IReferenceHolder Interface Reference
[Types]

Interface to IType which can refer to other types. More...

#include <ireferenceholder.h>

Inheritance diagram for HGL::Type::IReferenceHolder:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual uint16_t getHash () const =0
 Calculates the hash value.
Reference access and manipulation



virtual const ITypefindReference (bool recache=false) const =0
 Searches the tree for the associated reference.
virtual const std::string * getReference () const =0
 Gets the reference.
virtual void removeReference ()=0 throw (Exception::ReferenceException)
 Removes the reference.
virtual void setReference (const std::string &ref, IType *scope)=0
 Sets the reference.
virtual void setReference (const std::string &ref, bool fromStdLib=false)=0
 Sets the reference.

Detailed Description

Interface to IType which can refer to other types.

A type can hold a reference to another IType and should behave like that type. A reference itself is only a string to an identifier.

See also:
IType::getId
IType::setId
Author:
Heiko Schäfer <heiko@hgl.rangun.de>

Member Function Documentation

virtual const IType* HGL::Type::IReferenceHolder::findReference ( bool  recache = false  )  const [pure virtual]

Searches the tree for the associated reference.

Note:
To check if a reference was actually found use IType::isNull
See also:
IType::isNull
Returns:
an IType to a reference or the special NullType if not found

Implemented in HGL::Type::ExpressionParam, HGL::Type::Line, HGL::Type::ReferenceHolderBase, and HGL::Type::ReferenceParam.

virtual uint16_t HGL::Type::IReferenceHolder::getHash (  )  const [pure virtual]

Calculates the hash value.

Returns:
uint16_t the hash value
virtual const std::string* HGL::Type::IReferenceHolder::getReference (  )  const [pure virtual]

Gets the reference.

Returns:
pointer to the reference, NULL if no reference is set

Implemented in HGL::Type::ReferenceHolderBase.

virtual void HGL::Type::IReferenceHolder::removeReference (  )  throw (Exception::ReferenceException) [pure virtual]

Removes the reference.

Precondition:
The underlying type has to be valid (isValid() == true), i.e. if the reference is removed the resulting type must be valid, otherwise an ReferenceRemoveException is thrown
See also:
isValid
Exceptions:
HGL::Exception::ReferenceRemoveException if the underlying type is not valid
virtual void HGL::Type::IReferenceHolder::setReference ( const std::string &  ref,
IType scope 
) [pure virtual]

Sets the reference.

Scoped references are useful for types which are created at runtime.

Parameters:
ref the reference
scope the scope in which the reference should be found
virtual void HGL::Type::IReferenceHolder::setReference ( const std::string &  ref,
bool  fromStdLib = false 
) [pure virtual]

Sets the reference.

Parameters:
ref the reference
fromStdLib true if the reference points into the stdlib

Implemented in HGL::Type::ReferenceHolderBase.


Generated on 9 Apr 2014 for hgl 0.5.26~svn by  doxygen 1.6.1