patrick
/
plasp
Archived
1
0
Fork 0
This repository has been archived on 2023-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
plasp/include/plasp/pddl/expressions/Reference.h

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