Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WCCL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Analysers
WCCL
Commits
57725eaa
Commit
57725eaa
authored
Nov 15, 2010
by
Adam Wardynski
Browse files
Options
Downloads
Patches
Plain Diff
Rename TRet to T for nicer documentation with doxygen
parent
5e1630d5
No related branches found
No related tags found
No related merge requests found
Changes
2
Show 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 {
...
@@ -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
T
Ret
>
template
<
class
T
>
class
Constant
:
public
Function
<
T
Ret
>
{
class
Constant
:
public
Function
<
T
>
{
BOOST_CONCEPT_ASSERT
((
boost
::
CopyConstructible
<
T
Ret
>
));
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
T
Ret
&
value
)
Constant
(
const
T
&
value
)
:
value_
(
new
T
Ret
(
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
T
Ret
(
*
value_
));
return
BaseRetValPtr
(
new
T
(
*
value_
));
}
}
private
:
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:
...
@@ -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
T
Ret
>
template
<
class
T
>
class
Function
:
public
FunctionBase
{
class
Function
:
public
FunctionBase
{
BOOST_MPL_ASSERT
(
(
boost
::
is_base_of
<
Value
,
T
Ret
>
)
);
BOOST_MPL_ASSERT
(
(
boost
::
is_base_of
<
Value
,
T
>
)
);
BOOST_MPL_ASSERT_NOT
(
(
boost
::
is_same
<
Value
,
T
Ret
>
)
);
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
<
T
Ret
>
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
<
T
Ret
>
(
apply_internal
(
context
));
RetValPtr
v
=
boost
::
dynamic_pointer_cast
<
T
>
(
apply_internal
(
context
));
BOOST_ASSERT
(
v
);
BOOST_ASSERT
(
v
);
return
v
;
return
v
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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