76 lines
1.6 KiB
C++
76 lines
1.6 KiB
C++
#ifndef __PLASP__PDDL__EXPRESSIONS__REFERENCE_H
|
|
#define __PLASP__PDDL__EXPRESSIONS__REFERENCE_H
|
|
|
|
#include <plasp/pddl/Expression.h>
|
|
|
|
namespace plasp
|
|
{
|
|
namespace pddl
|
|
{
|
|
namespace expressions
|
|
{
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Reference
|
|
//
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
template<class Type>
|
|
class Reference: public ExpressionCRTP<Reference<Type>>
|
|
{
|
|
public:
|
|
static const Expression::Type ExpressionType = Expression::Type::Reference;
|
|
|
|
public:
|
|
Reference(Type *value);
|
|
|
|
Type *get();
|
|
const Type *get() const;
|
|
|
|
ExpressionPointer normalize();
|
|
|
|
protected:
|
|
Type *m_value = nullptr;
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
template<class Type>
|
|
Reference<Type>::Reference(Type *value)
|
|
: m_value{value}
|
|
{
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
template<class Type>
|
|
Type *Reference<Type>::get()
|
|
{
|
|
return m_value;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
template<class Type>
|
|
const Type *Reference<Type>::get() const
|
|
{
|
|
return m_value;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
template<class Type>
|
|
ExpressionPointer Reference<Type>::normalize()
|
|
{
|
|
return nullptr;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
#endif
|