Goose  Artifact [96aeb2dbb7]

Artifact 96aeb2dbb71f7ab381f7f1602f430f36f76f56e5329bd4413b2b022c43283546:

  • File bs/llr/element.h — part of check-in [d2c4e27b15] at 2019-03-02 12:33:24 on branch trunk — llr: added predicates to quickly test if an llr element is suitable for compilation time execution, or for eager evaluation. (user: achavasse size: 1010)

#ifndef EMPATHY_LLR_ELEMENT_H
#define EMPATHY_LLR_ELEMENT_H

namespace empathy::llr
{
    class Seq;

    class Element
    {
        public:
            Element() {}

            Element( ptr< Seq >&& s ) :
                m_content( move( s ) )
            {}

            Element( const ptr< Seq >& s ) :
                m_content( s )
            {}

            Element( Call&& c ) :
                m_content( move( c ) )
            {}

            Element( SetVar&& sv ) :
                m_content( move( sv ) )
            {}

            Element( GetVar&& gv ) :
                m_content( move( gv ) )
            {}

            using Content = variant
            <
                ptr< Seq >,
                SetVar,
                GetVar,
                Call
            >;

            const auto& content() const { return m_content; }

            bool canBeExecuted() const;
            bool canBeEagerlyEvaluated() const;

        private:
            Content m_content;
    };
}

#endif