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