hgl 0.5.25
A compiler/interpreter suite for developing images
Public Member Functions | Protected Member Functions | List of all members
HGL::Type::Project Class Reference

#include "project.h"

Inheritance diagram for HGL::Type::Project:
[legend]

Public Member Functions

virtual MainSegmentaddMainSegment (MainSegment *ms)
 Adds the main segment. More...
 
virtual ObjectsSegmentaddObjectsSegment (ObjectsSegment *os)
 Adds the objects segment. More...
 
virtual ProceduresSegmentaddProceduresSegment (ProceduresSegment *ps)
 Adds the procedures segment. More...
 
virtual bool isValid () const
 Checks if the type is valid. More...
 
- Public Member Functions inherited from HGL::IType
virtual operator iterator ()=0
 Gets the iterator over this type's attached types. More...
 
- Public Member Functions inherited from HGL::Type::TypeBase
ITypeattachType (IType *type, bool check=true) throw (Exception::AttachException)
 Attach child objects to the IType at end of list. More...
 
virtual IType::iterator begin ()
 Gets the iterator to the begin over this type's attached types. More...
 
virtual void detachType (IType *type)
 Detaches a child from the IType. More...
 
virtual IType::iterator end ()
 Gets the iterator to the end over this type's attached types. More...
 
virtual const TYPELISTgetAttachedTypes () const
 Returns all attached IType instances. More...
 
virtual BOUNDINGBOX getBoundingBox () const
 Gets the bounding box of the type. More...
 
virtual const std::string & getId () const
 Gets the identifier. More...
 
virtual ITypegetParent () const
 Returns the parent IType. More...
 
virtual bool isNull () const
 Checks if the type is null type. More...
 
virtual void setDescription (const std::string &desc)
 Sets the description of the type. More...
 
virtual void setId (const std::string &id)
 Sets the identifier. More...
 

Protected Member Functions

SERIALID getSerialID () const
 Gets the serialization ID of the object. More...
 
- Protected Member Functions inherited from HGL::Type::TypeBase
virtual ITypeattachType (IType *type, const TYPELIST::iterator &before, bool check=true) throw (Exception::AttachException)
 Attaches a child at the position before. More...
 
virtual IType::Ptr clone () const throw (Exception::CloneNotSupportedException)
 Creates a clone of the type. More...
 
virtual const std::string & getDescription () const
 Gets the description of the type. More...
 
virtual const ITypegetRoot (const IType &type) const
 Get the root of a type. More...
 
virtual std::string getTypeName () const
 Displayable name of the IType. More...
 
virtual operator float () const throw (Exception::ReferenceException, Exception::InvalidExpressionException)
 Converts the type into a float More...
 
virtual ITyperesolve (const std::string &id) const
 Resolves a type by its ID. More...
 
virtual void setParent (IType *parent)
 Set parent of the type. More...
 

Detailed Description

Author
Heiko Schäfer heiko.nosp@m.@hgl.nosp@m..rang.nosp@m.un.d.nosp@m.e

Member Function Documentation

HGL::Type::MainSegment * Project::addMainSegment ( MainSegment ms)
virtual

Adds the main segment.

Parameters
msthe main segment
Returns
the attached main segment

Implements HGL::Type::IProject.

References HGL::IType::attachType().

HGL::Type::ObjectsSegment * Project::addObjectsSegment ( ObjectsSegment os)
virtual

Adds the objects segment.

Parameters
osthe objects segment
Returns
the attached objects segment

Implements HGL::Type::IProject.

References HGL::IType::attachType().

HGL::Type::ProceduresSegment * Project::addProceduresSegment ( ProceduresSegment ps)
virtual

Adds the procedures segment.

Parameters
psthe procedures segment
Returns
the attached procedures segment

Implements HGL::Type::IProject.

References HGL::IType::attachType().

HGL::IType::SERIALID Project::getSerialID ( ) const
protectedvirtual

Gets the serialization ID of the object.

Returns
the serialization ID of the object

Implements HGL::IType.

References HGL::IType::SPROJECT.

bool Project::isValid ( ) const
virtual

Checks if the type is valid.

A Project is valid if it at least contains a MainSegment.

Note
this method returns false if the type has no attached subtypes. 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.

Returns
true if the type is valid, false otherwise

Reimplemented from HGL::Type::NonEmptyType.

References HGL::IType::getAttachedTypes(), and HGL::Type::NonEmptyType::isValid().