Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Algorithms Library Toolkit Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Algorithms Library Toolkit
Algorithms Library Toolkit Core
Merge requests
!125
procedural aql
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
procedural aql
merge-jt
into
master
Overview
2
Commits
28
Pipelines
2
Changes
2
Merged
Jan Trávníček
requested to merge
merge-jt
into
master
5 years ago
Overview
2
Commits
28
Pipelines
2
Changes
2
Expand
Part one of abstraction value redesign, A huge extension of cli syntax.
0
0
Merge request reports
Viewing commit
a38b84ea
Prev
Next
Show latest version
2 files
+
60
−
37
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
a38b84ea
decouple Value interfaces
· a38b84ea
Jan Trávníček
authored
5 years ago
alib2abstraction/src/abstraction/ValueHolderInterface.hpp
+
4
−
37
Options
@@ -8,49 +8,16 @@
#ifndef _VALUE_HOLDER_INTERFACE_HPP_
#define _VALUE_HOLDER_INTERFACE_HPP_
#include
<abstraction/Value.hpp>
#include
<abstraction/Value
Interface
.hpp>
namespace
abstraction
{
template
<
class
Type
>
class
ValueHolderInterface
:
public
Value
{
ParamQualifiers
::
ParamQualifierSet
m_paramQualifierSet
;
bool
m_isTemporary
;
protected:
ValueHolderInterface
(
ParamQualifiers
::
ParamQualifierSet
paramQualifierSet
,
bool
isTemporary
)
:
m_paramQualifierSet
(
paramQualifierSet
),
m_isTemporary
(
isTemporary
)
{
if
(
this
->
isLvalueRef
(
)
&&
this
->
isTemporary
(
)
)
throw
std
::
domain_error
(
"Lvalue references cannot be a temporarie."
);
if
(
this
->
isLvalueRef
(
)
&&
this
->
isRvalueRef
(
)
)
throw
std
::
domain_error
(
"A reference cannot be both, rvalue and lvalue."
);
}
class
ValueHolderInterface
:
public
ValueInterface
{
public:
virtual
Type
&&
getValue
(
)
const
=
0
;
ParamQualifiers
::
ParamQualifierSet
getParamQualifiersSet
(
)
const
{
return
m_paramQualifierSet
;
}
bool
isConst
(
)
const
{
return
m_paramQualifierSet
&&
ParamQualifiers
::
ParamQualifierSet
::
CONST
;
}
using
ValueInterface
::
ValueInterface
;
bool
isRef
(
)
const
{
return
isRvalueRef
(
)
||
isLvalueRef
(
);
}
bool
isRvalueRef
(
)
const
{
return
m_paramQualifierSet
&&
ParamQualifiers
::
ParamQualifierSet
::
RREF
;
}
bool
isLvalueRef
(
)
const
{
return
m_paramQualifierSet
&&
ParamQualifiers
::
ParamQualifierSet
::
LREF
;
}
bool
isTemporary
(
)
const
{
return
m_isTemporary
;
}
virtual
Type
&&
getValue
(
)
const
=
0
;
};
Loading