Skip to content
Snippets Groups Projects
Commit 57725eaa authored by Adam Wardynski's avatar Adam Wardynski
Browse files

Rename TRet to T for nicer documentation with doxygen

parent 5e1630d5
Branches
No related merge requests found
......@@ -12,15 +12,15 @@ namespace Wccl {
/**
* Functional realisation of constant value of a given type
*/
template<class TRet>
class Constant : public Function<TRet> {
BOOST_CONCEPT_ASSERT((boost::CopyConstructible<TRet>));
template<class T>
class Constant : public Function<T> {
BOOST_CONCEPT_ASSERT((boost::CopyConstructible<T>));
public:
/*
* Constant function holds specific value to return when applying it
*/
Constant(const TRet& value)
: value_(new TRet(value))
Constant(const T& value)
: value_(new T(value))
{
BOOST_ASSERT(value_);
}
......@@ -47,11 +47,11 @@ protected :
* Applying Constant function returns the held value of a constant
*/
virtual BaseRetValPtr apply_internal(const SentenceContext&) const {
return BaseRetValPtr (new TRet(*value_));
return BaseRetValPtr (new T(*value_));
}
private:
const boost::scoped_ptr<const TRet> value_;
const boost::scoped_ptr<const T> value_;
};
......
......@@ -28,16 +28,16 @@ protected:
* Abstract base class template for functional WCCL operators that are functions
* returning a value of given type
*/
template<class TRet>
template<class T>
class Function : public FunctionBase {
BOOST_MPL_ASSERT( (boost::is_base_of<Value, TRet>) );
BOOST_MPL_ASSERT_NOT( (boost::is_same<Value, TRet>) );
BOOST_MPL_ASSERT( (boost::is_base_of<Value, T>) );
BOOST_MPL_ASSERT_NOT( (boost::is_same<Value, T>) );
public:
/**
* Type returned after application of function (shared pointer to
* a variable of the specified return type)
*/
typedef boost::shared_ptr<TRet> RetValPtr;
typedef boost::shared_ptr<T> RetValPtr;
/**
* Applies the function, given the sentence context, returning specific
......@@ -45,7 +45,7 @@ public:
* be specified in derived classes.
*/
RetValPtr apply(const SentenceContext& context) const {
RetValPtr v = boost::dynamic_pointer_cast<TRet>(apply_internal(context));
RetValPtr v = boost::dynamic_pointer_cast<T>(apply_internal(context));
BOOST_ASSERT(v);
return v;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment