Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WCCL
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Analysers
WCCL
Commits
57725eaa
Commit
57725eaa
authored
14 years ago
by
Adam Wardynski
Browse files
Options
Downloads
Patches
Plain Diff
Rename TRet to T for nicer documentation with doxygen
parent
5e1630d5
Branches
Branches containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libwccl/ops/constant.h
+7
-7
7 additions, 7 deletions
libwccl/ops/constant.h
libwccl/ops/functions.h
+5
-5
5 additions, 5 deletions
libwccl/ops/functions.h
with
12 additions
and
12 deletions
libwccl/ops/constant.h
+
7
−
7
View file @
57725eaa
...
...
@@ -12,15 +12,15 @@ namespace Wccl {
/**
* Functional realisation of constant value of a given type
*/
template
<
class
T
Ret
>
class
Constant
:
public
Function
<
T
Ret
>
{
BOOST_CONCEPT_ASSERT
((
boost
::
CopyConstructible
<
T
Ret
>
));
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
T
Ret
&
value
)
:
value_
(
new
T
Ret
(
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
T
Ret
(
*
value_
));
return
BaseRetValPtr
(
new
T
(
*
value_
));
}
private
:
const
boost
::
scoped_ptr
<
const
T
Ret
>
value_
;
const
boost
::
scoped_ptr
<
const
T
>
value_
;
};
...
...
This diff is collapsed.
Click to expand it.
libwccl/ops/functions.h
+
5
−
5
View file @
57725eaa
...
...
@@ -28,16 +28,16 @@ protected:
* Abstract base class template for functional WCCL operators that are functions
* returning a value of given type
*/
template
<
class
T
Ret
>
template
<
class
T
>
class
Function
:
public
FunctionBase
{
BOOST_MPL_ASSERT
(
(
boost
::
is_base_of
<
Value
,
T
Ret
>
)
);
BOOST_MPL_ASSERT_NOT
(
(
boost
::
is_same
<
Value
,
T
Ret
>
)
);
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
<
T
Ret
>
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
<
T
Ret
>
(
apply_internal
(
context
));
RetValPtr
v
=
boost
::
dynamic_pointer_cast
<
T
>
(
apply_internal
(
context
));
BOOST_ASSERT
(
v
);
return
v
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment