Fabrique

A build language for complex systems

 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
fabrique::Type Class Reference

The name of a value, function, parameter or argument. More...

#include <Type.h>

Inheritance diagram for fabrique::Type:
fabrique::Printable fabrique::Uncopyable fabrique::BooleanType fabrique::FileType fabrique::FunctionType fabrique::IntegerType fabrique::MaybeType fabrique::RawMaybeType fabrique::RawSequenceType fabrique::SequenceType fabrique::StringType fabrique::StructureType

Public Types

typedef std::pair< std::string,
const Type & > 
NamedType
 
typedef std::vector< NamedType > NamedTypeVec
 
typedef StringMap< const Type & > TypeMap
 
typedef std::function< PtrVec
< Type >const PtrVec< Type > &)> 
TypesMapper
 

Public Member Functions

 Type (std::weak_ptr< Type > parent)=delete
 
TypeContextcontext () const
 
virtual const std::string name () const
 
virtual TypeMap fields () const
 The fields that objects of this type have. More...
 
virtual void PrettyPrint (Bytestream &, size_t indent=0) const override
 Print a human-readable representation to an output stream and return that output stream.
 
bool operator== (const Type &) const
 
bool operator!= (const Type &t) const
 
const PtrVec< Type > & typeParameters () const
 
size_t typeParamCount () const
 
const Typeoperator[] (size_t i) const
 
const TypeMap (TypesMapper, const SourceRange &) const
 
virtual bool isSubtype (const Type &) const
 
virtual bool isSupertype (const Type &) const
 
 operator bool () const
 
virtual bool valid () const
 
virtual bool hasFields () const
 
virtual bool isFile () const
 
virtual bool isFunction () const
 
virtual bool isString () const
 
virtual bool isOptional () const
 
virtual bool isOrdered () const
 
virtual bool canBeNegated () const
 
virtual const TypeonAddTo (const Type &) const
 
virtual const TypeonPrefixWith (const Type &) const
 
- Public Member Functions inherited from fabrique::Printable
 Printable (const Printable &)
 
Printableoperator= (const Printable &)
 
virtual std::string str () const
 

Static Public Member Functions

static const TypeGetSupertype (const Type &, const Type &)
 
static const TypeListOf (const Type &, const SourceRange &)
 
static std::string UntypedPart (std::string typedName)
 

Protected Member Functions

 Type (const std::string &, const PtrVec< Type > &params, TypeContext &)
 
virtual TypeParameterise (const PtrVec< Type > &, const SourceRange &) const
 

Friends

class TypeContext
 

Detailed Description

The name of a value, function, parameter or argument.

Definition at line 53 of file Type.h.

Member Function Documentation

virtual TypeMap fabrique::Type::fields ( ) const
inlinevirtual

The fields that objects of this type have.

This can be empty even if hasFields() is true: objects like this one might not happen to have fields while still being the kind of objects that, in general, do (e.g., a struct like args with no members).

Reimplemented in fabrique::FileType, fabrique::StructureType, and fabrique::MaybeType.

Definition at line 80 of file Type.h.


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