HGL::Type::TypeBase Class Reference
[Types]

This class provides the default implementation for most types. More...

#include <typebase.h>

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

List of all members.

Public Member Functions

virtual IType::iterator begin ()
 Gets the iterator to the begin over this type's attached types.
virtual IType::iterator end ()
 Gets the iterator to the end over this type's attached types.
virtual const TYPELISTgetAttachedTypes () const
 Returns all attached IType instances.
virtual BOUNDINGBOX getBoundingBox () const
 Gets the bounding box of the type.
virtual const std::string & getId () const
 Gets the identifier.
virtual ITypegetParent () const
 Returns the parent IType.
virtual bool isNull () const
 Checks if the type is null type.
virtual void setDescription (const std::string &desc)
 Sets the description of the type.
virtual void setId (const std::string &id)
 Sets the identifier.

Protected Member Functions

virtual ITypeattachType (IType *type, const TYPELIST::iterator &before, bool check=true) throw (Exception::AttachException)
 Attaches a child at the position before.
virtual IType::Ptr clone () const throw (Exception::CloneNotSupportedException)
 Creates a clone of the type.
virtual const std::string & getDescription () const
 Gets the description of the type.
virtual std::string getTypeName () const
 Displayable name of the IType.
virtual bool isValid () const
virtual operator float () const throw (Exception::ReferenceException, Exception::InvalidExpressionException)
 Converts the type into a float.
virtual ITyperesolve (const std::string &id) const
 Resolves a type by its ID.

Detailed Description

This class provides the default implementation for most types.

Author:
Heiko Schäfer <heiko@hgl.rangun.de>

Member Function Documentation

HGL::IType * TypeBase::attachType ( HGL::IType type,
const TYPELIST::iterator &  before,
bool  check = true 
) throw (Exception::AttachException) [protected, virtual]

Attaches a child at the position before.

It updates the parent of the attached type to this type as well.

Parameters:
type the IType to attach as child
before the type will be attached before the type referenced by before
check true (default), if validity checks should be performed

Reimplemented in HGL::Type::AssignmentOperator, HGL::Type::Curve, HGL::Type::Line, HGL::Type::RenderCallback, and HGL::Type::VirtualGroup.

HGL::IType::iterator TypeBase::begin (  )  [virtual]

Gets the iterator to the begin over this type's attached types.

Returns:
the iterator to the begin over this type's attached types

Implements HGL::IType.

HGL::IType::Ptr TypeBase::clone (  )  const throw (Exception::CloneNotSupportedException) [protected, virtual]

Creates a clone of the type.

Returns:
a smart pointer to the cloned type

Implements HGL::IType.

Reimplemented in HGL::Type::FloatParam.

HGL::IType::iterator TypeBase::end (  )  [virtual]

Gets the iterator to the end over this type's attached types.

Returns:
the iterator to the end over this type's attached types

Implements HGL::IType.

const HGL::IType::TYPELIST & TypeBase::getAttachedTypes (  )  const [virtual]

Returns all attached IType instances.

Returns:
all attached IType instances

Implements HGL::IType.

Reimplemented in HGL::Type::RenderCallback, and HGL::Type::VirtualGroup.

HGL::IType::BOUNDINGBOX TypeBase::getBoundingBox (  )  const [virtual]

Gets the bounding box of the type.

Returns:
the bounding box of the type

Implements HGL::IType.

Reimplemented in HGL::Type::Fill, HGL::Type::Line, HGL::Type::ParamBase, HGL::Type::Point, HGL::Type::Text, and HGL::Type::Vector2D.

const std::string & TypeBase::getDescription (  )  const [protected, virtual]

Gets the description of the type.

Returns:
the description of the type

Implements HGL::IType.

const std::string & TypeBase::getId (  )  const [virtual]

Gets the identifier.

Returns:
the identifier

Implements HGL::IType.

Reimplemented in HGL::Type::Procedure, and HGL::Type::NamedParam.

HGL::IType * TypeBase::getParent (  )  const [virtual]

Returns the parent IType.

Returns:
the parent IType or NULL if there is no parent

Implements HGL::IType.

std::string TypeBase::getTypeName (  )  const [protected, virtual]

Displayable name of the IType.

Returns:
the displayable name of the IType

Reimplemented in HGL::Type::ExpressionParam, and HGL::Type::NamedParam.

bool TypeBase::isNull (  )  const [virtual]

Checks if the type is null type.

See also:
IReferenceHolder::findReference
Returns:
true if the type is null type, false otherwise

Implements HGL::IType.

bool TypeBase::isValid (  )  const [protected, virtual]

A type is valid

  1. if all attached types are allowed for this type, if not the type is invalid
  2. if all attached types itself are valid, if not the type is invalid

Subclasses can add more checks if neccessary.

Checks if the type is valid.

Returns:
true if the type is valid, false otherwise

Implements HGL::IType.

Reimplemented in HGL::Type::Curve, HGL::Type::Ellipse, HGL::Type::NonEmptyType, HGL::Type::Point, HGL::Type::Project, HGL::Type::ReferenceHolderBase, HGL::Type::Text, and HGL::Type::Poly.

TypeBase::operator float (  )  const throw (Exception::ReferenceException, Exception::InvalidExpressionException) [protected, virtual]

Converts the type into a float.

Returns:
the type as float

Implements HGL::IType.

Reimplemented in HGL::Type::FloatParam, and HGL::Type::ReferenceParam.

HGL::IType * TypeBase::resolve ( const std::string &  id  )  const [protected, virtual]

Resolves a type by its ID.

Parameters:
id the id to resolve
Returns:
the resolved type or 0L if no type could get resolved by that id

Implements HGL::IType.

Reimplemented in HGL::Type::AssignmentOperator.

void TypeBase::setDescription ( const std::string &  desc  )  [virtual]

Sets the description of the type.

Parameters:
desc the description of the type

Implements HGL::IType.

void TypeBase::setId ( const std::string &  id  )  [virtual]

Sets the identifier.

Parameters:
id the identifier

Implements HGL::IType.

Reimplemented in HGL::Type::NamedParam.


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