Fabrique

A build language for complex systems

 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
fabrique::dag::Value Class Referenceabstract

The result of evaluating an expression. More...

#include <Value.h>

Inheritance diagram for fabrique::dag::Value:
fabrique::HasSource fabrique::Printable fabrique::Typed fabrique::Uncopyable fabrique::dag::Build fabrique::dag::File fabrique::dag::Function fabrique::dag::List fabrique::dag::Primitive< T > fabrique::dag::Rule fabrique::dag::Structure fabrique::dag::Target fabrique::dag::Primitive< bool > fabrique::dag::Primitive< int > fabrique::dag::Primitive< std::string >

Public Member Functions

virtual bool hasFields () const
 
virtual ValuePtr field (const std::string &) const
 
virtual ValuePtr Negate (const SourceRange &loc) const
 Unary 'not' operator.
 
virtual ValuePtr Add (ValuePtr &) const
 Add this fabrique::dag::Value to a following Value. More...
 
virtual ValuePtr PrefixWith (ValuePtr &) const
 Apply the prefix operation: prefix this value with another value.
 
virtual ValuePtr ScalarAdd (ValuePtr &) const
 Add another fabrique::dag::Value scalar-wise across this Value.
 
virtual ValuePtr And (ValuePtr &) const
 Logical and. More...
 
virtual ValuePtr Or (ValuePtr &) const
 Logical or. More...
 
virtual ValuePtr Xor (ValuePtr &) const
 Logical xor. More...
 
virtual ValuePtr Equals (ValuePtr &) const
 Equivalence. More...
 
virtual const ListasList () const
 A list representation of this value (or nullptr).
 
virtual bool canScalarAdd (const Value &) const
 This Value can add a value to itself in a scalar fashion. More...
 
virtual void Accept (Visitor &) const =0
 
- Public Member Functions inherited from fabrique::HasSource
 HasSource (const SourceRange &src)
 
const SourceRangesource () const
 
- Public Member Functions inherited from fabrique::Printable
 Printable (const Printable &)
 
Printableoperator= (const Printable &)
 
virtual void PrettyPrint (Bytestream &, size_t indent=0) const =0
 Print a human-readable representation to an output stream and return that output stream.
 
virtual std::string str () const
 
- Public Member Functions inherited from fabrique::Typed
 Typed (const Type &t)
 
virtual const Typetype () const
 

Protected Member Functions

 Value (const Type &, const SourceRange &)
 

Detailed Description

The result of evaluating an expression.

Definition at line 58 of file Value.h.

Member Function Documentation

ValuePtr Value::Add ( ValuePtr &  ) const
virtual

Add this fabrique::dag::Value to a following Value.

The implementation of addition is type-dependent: it might make sense to add, concatenate or apply a logical AND.

Reimplemented in fabrique::dag::String, fabrique::dag::Integer, fabrique::dag::File, fabrique::dag::List, and fabrique::dag::Target.

Definition at line 57 of file Value.cc.

ValuePtr Value::And ( ValuePtr &  ) const
virtual

Logical and.

Reimplemented in fabrique::dag::Boolean, and fabrique::dag::Target.

Definition at line 75 of file Value.cc.

virtual bool fabrique::dag::Value::canScalarAdd ( const Value ) const
inlinevirtual

This Value can add a value to itself in a scalar fashion.

For instance, [ 1 2 ] can add 3 to itself but not vice versa.

Reimplemented in fabrique::dag::List.

Definition at line 101 of file Value.h.

ValuePtr Value::Equals ( ValuePtr &  ) const
virtual

Equivalence.

Reimplemented in fabrique::dag::String, fabrique::dag::Integer, fabrique::dag::Boolean, and fabrique::dag::Target.

Definition at line 93 of file Value.cc.

ValuePtr Value::Or ( ValuePtr &  ) const
virtual

Logical or.

Reimplemented in fabrique::dag::Boolean, and fabrique::dag::Target.

Definition at line 81 of file Value.cc.

ValuePtr Value::Xor ( ValuePtr &  ) const
virtual

Logical xor.

Reimplemented in fabrique::dag::Boolean, and fabrique::dag::Target.

Definition at line 87 of file Value.cc.


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