Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
staging
dune-typetree
Commits
67ea6814
Commit
67ea6814
authored
Apr 07, 2020
by
Simon Praetorius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unify codestyle in node implementation
parent
94135d46
Pipeline
#26140
passed with stage
in 2 minutes and 8 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
29 deletions
+29
-29
dune/typetree/childextraction.hh
dune/typetree/childextraction.hh
+10
-10
dune/typetree/compositenode.hh
dune/typetree/compositenode.hh
+3
-3
dune/typetree/powernode.hh
dune/typetree/powernode.hh
+3
-3
dune/typetree/proxynode.hh
dune/typetree/proxynode.hh
+13
-13
No files found.
dune/typetree/childextraction.hh
View file @
67ea6814
...
...
@@ -30,7 +30,7 @@ namespace Dune {
// check at run time whether index is a valid child index
template
<
class
Node
,
class
Index
>
std
::
true_type
checkChildIndex
(
Node
const
&
node
,
Index
i
)
std
::
true_type
checkChildIndex
(
Node
const
&
node
,
Index
i
)
{
assert
(
i
<
node
.
degree
()
&&
"Child index out of range"
);
return
{};
...
...
@@ -38,7 +38,7 @@ namespace Dune {
// check at compile time whether index is a valid index
template
<
class
Node
,
std
::
size_t
i
>
std
::
bool_constant
<
(
i
<
Node
::
degree
())
>
checkChildIndex
(
Node
const
&
node
,
index_constant
<
i
>
)
std
::
bool_constant
<
(
i
<
Node
::
degree
())
>
checkChildIndex
(
Node
const
&
node
,
index_constant
<
i
>
)
{
static_assert
(
i
<
Node
::
degree
(),
"Child index out of range"
);
return
{};
...
...
@@ -123,7 +123,7 @@ namespace Dune {
*/
template
<
typename
Node
,
typename
...
Indices
>
#ifdef DOXYGEN
ImplementationDefined
child
(
Node
&&
node
,
Indices
...
indices
)
ImplementationDefined
child
(
Node
&&
node
,
Indices
...
indices
)
#else
decltype
(
auto
)
child
(
Node
&&
node
,
Indices
...
indices
)
#endif
...
...
@@ -133,7 +133,7 @@ namespace Dune {
template
<
typename
Node
,
typename
...
Indices
>
#ifdef DOXYGEN
ImplementationDefined
childStorage
(
Node
&&
node
,
Indices
...
indices
)
ImplementationDefined
childStorage
(
Node
&&
node
,
Indices
...
indices
)
#else
auto
childStorage
(
Node
&&
node
,
Indices
...
indices
)
#endif
...
...
@@ -163,7 +163,7 @@ namespace Dune {
*/
template
<
typename
Node
,
std
::
size_t
...
Indices
>
#ifdef DOXYGEN
ImplementationDefined
child
(
Node
&&
node
,
TreePath
<
Indices
...
>
treePath
)
ImplementationDefined
child
(
Node
&&
node
,
TreePath
<
Indices
...
>
treePath
)
#else
decltype
(
auto
)
child
(
Node
&&
node
,
TreePath
<
Indices
...
>
)
#endif
...
...
@@ -173,7 +173,7 @@ namespace Dune {
template
<
typename
Node
,
std
::
size_t
...
Indices
>
#ifdef DOXYGEN
ImplementationDefined
childStorage
(
Node
&&
node
,
TreePath
<
Indices
...
>
treePath
)
ImplementationDefined
childStorage
(
Node
&&
node
,
TreePath
<
Indices
...
>
treePath
)
#else
auto
childStorage
(
Node
&&
node
,
TreePath
<
Indices
...
>
)
#endif
...
...
@@ -208,7 +208,7 @@ namespace Dune {
*/
template
<
typename
Node
,
typename
...
Indices
>
#ifdef DOXYGEN
ImplementationDefined
child
(
Node
&&
node
,
HybridTreePath
<
Indices
...
>
treePath
)
ImplementationDefined
child
(
Node
&&
node
,
HybridTreePath
<
Indices
...
>
treePath
)
#else
decltype
(
auto
)
child
(
Node
&&
node
,
HybridTreePath
<
Indices
...
>
tp
)
#endif
...
...
@@ -218,7 +218,7 @@ namespace Dune {
template
<
typename
Node
,
typename
...
Indices
>
#ifdef DOXYGEN
ImplementationDefined
child
(
Node
&&
node
,
HybridTreePath
<
Indices
...
>
treePath
)
ImplementationDefined
child
(
Node
&&
node
,
HybridTreePath
<
Indices
...
>
treePath
)
#else
auto
childStorage
(
Node
&&
node
,
HybridTreePath
<
Indices
...
>
tp
)
#endif
...
...
@@ -333,7 +333,7 @@ namespace Dune {
Dune
::
TypeTree
::
is_flat_index
<
T
>::
value
,
bool
>::
type
_non_empty_tree_path
(
T
)
_non_empty_tree_path
(
T
)
{
return
false
;
}
...
...
@@ -343,7 +343,7 @@ namespace Dune {
!
Dune
::
TypeTree
::
is_flat_index
<
T
>::
value
,
bool
>::
type
_non_empty_tree_path
(
T
t
)
_non_empty_tree_path
(
T
t
)
{
return
treePathSize
(
t
)
>
0
;
}
...
...
dune/typetree/compositenode.hh
View file @
67ea6814
...
...
@@ -163,7 +163,7 @@ namespace Dune {
*/
#ifdef DOXYGEN
template
<
typename
...
Indices
>
ImplementationDefined
&
child
(
Indices
...
indices
)
ImplementationDefined
&
child
(
Indices
...
indices
)
#else
template
<
typename
I0
,
typename
...
I
,
std
::
enable_if_t
<
(
sizeof
...(
I
)
>
0
)
||
IsTreePath
<
I0
>::
value
,
int
>
=
0
>
...
...
@@ -183,7 +183,7 @@ namespace Dune {
*/
#ifdef DOXYGEN
template
<
typename
...
Indices
>
const
ImplementationDefined
&
child
(
Indices
...
indices
)
const
ImplementationDefined
&
child
(
Indices
...
indices
)
#else
template
<
typename
I0
,
typename
...
I
,
std
::
enable_if_t
<
(
sizeof
...(
I
)
>
0
)
||
IsTreePath
<
I0
>::
value
,
int
>
=
0
>
...
...
@@ -211,7 +211,7 @@ namespace Dune {
* will not be usable before its children are set using any of the
* setChild(...) methods!
*/
CompositeNode
()
CompositeNode
()
{}
//! Initialize all children with the passed-in objects.
...
...
dune/typetree/powernode.hh
View file @
67ea6814
...
...
@@ -264,7 +264,7 @@ namespace Dune {
*/
#ifdef DOXYGEN
template
<
typename
...
Indices
>
ImplementationDefined
&
child
(
Indices
...
indices
)
ImplementationDefined
&
child
(
Indices
...
indices
)
#else
template
<
typename
I0
,
typename
...
I
,
std
::
enable_if_t
<
(
sizeof
...(
I
)
>
0
)
||
IsTreePath
<
I0
>::
value
,
int
>
=
0
>
...
...
@@ -284,7 +284,7 @@ namespace Dune {
*/
#ifdef DOXYGEN
template
<
typename
...
Indices
>
const
ImplementationDefined
&
child
(
Indices
...
indices
)
const
ImplementationDefined
&
child
(
Indices
...
indices
)
#else
template
<
typename
I0
,
typename
...
I
,
std
::
enable_if_t
<
(
sizeof
...(
I
)
>
0
)
||
IsTreePath
<
I0
>::
value
,
int
>
=
0
>
...
...
@@ -313,7 +313,7 @@ namespace Dune {
* \warning When using the default constructor, make sure to set ALL children
* by means of the setChild() methods!
*/
PowerNode
()
PowerNode
()
{}
//! Initialize the PowerNode with a copy of the passed-in storage type.
...
...
dune/typetree/proxynode.hh
View file @
67ea6814
...
...
@@ -38,12 +38,12 @@ namespace Dune {
template
<
bool
enabled
=
!
proxiedNodeIsConst
>
typename
std
::
enable_if
<
enabled
,
Node
&>::
type
node
()
node
()
{
return
static_cast
<
Node
&>
(
*
this
);
}
const
Node
&
node
()
const
const
Node
&
node
()
const
{
return
static_cast
<
const
Node
&>
(
*
this
);
}
...
...
@@ -65,7 +65,7 @@ namespace Dune {
*/
template
<
std
::
size_t
k
,
typename
std
::
enable_if
<
lazy_enabled
<
k
>
::
value
,
int
>::
type
=
0
>
auto
&
child
(
index_constant
<
k
>
=
{})
auto
&
child
(
index_constant
<
k
>
=
{})
{
return
node
().
proxiedNode
().
template
child
<
k
>();
}
...
...
@@ -111,7 +111,7 @@ namespace Dune {
node
().
proxiedNode
().
template
setChild
<
k
>(
std
::
forward
<
ProxyChild
>
(
child
));
}
const
typename
ProxiedNode
::
NodeStorage
&
nodeStorage
()
const
const
typename
ProxiedNode
::
NodeStorage
&
nodeStorage
()
const
{
return
node
().
proxiedNode
().
nodeStorage
();
}
...
...
@@ -135,12 +135,12 @@ namespace Dune {
template
<
bool
enabled
=
!
proxiedNodeIsConst
>
typename
std
::
enable_if
<
enabled
,
Node
&>::
type
node
()
node
()
{
return
static_cast
<
Node
&>
(
*
this
);
}
const
Node
&
node
()
const
const
Node
&
node
()
const
{
return
static_cast
<
const
Node
&>
(
*
this
);
}
...
...
@@ -267,7 +267,7 @@ namespace Dune {
//! The number of children.
static
const
std
::
size_t
CHILDREN
=
StaticDegree
<
Node
>::
value
;
static
constexpr
std
::
size_t
degree
()
static
constexpr
std
::
size_t
degree
()
{
return
StaticDegree
<
Node
>::
value
;
}
...
...
@@ -281,13 +281,13 @@ namespace Dune {
//! Returns the proxied node.
template
<
bool
enabled
=
!
proxiedNodeIsConst
>
typename
std
::
enable_if
<
enabled
,
Node
&>::
type
proxiedNode
()
proxiedNode
()
{
return
*
_node
;
}
//! Returns the proxied node (const version).
const
Node
&
proxiedNode
()
const
const
Node
&
proxiedNode
()
const
{
return
*
_node
;
}
...
...
@@ -295,13 +295,13 @@ namespace Dune {
//! Returns the storage of the proxied node.
template
<
bool
enabled
=
!
proxiedNodeIsConst
>
typename
std
::
enable_if
<
enabled
,
std
::
shared_ptr
<
Node
>
>::
type
proxiedNodeStorage
()
proxiedNodeStorage
()
{
return
_node
;
}
//! Returns the storage of the proxied node (const version).
std
::
shared_ptr
<
const
Node
>
proxiedNodeStorage
()
const
std
::
shared_ptr
<
const
Node
>
proxiedNodeStorage
()
const
{
return
_node
;
}
...
...
@@ -311,11 +311,11 @@ namespace Dune {
//! @name Constructors
//! @{
ProxyNode
(
Node
&
node
)
ProxyNode
(
Node
&
node
)
:
_node
(
stackobject_to_shared_ptr
(
node
))
{}
ProxyNode
(
std
::
shared_ptr
<
Node
>
node
)
ProxyNode
(
std
::
shared_ptr
<
Node
>
node
)
:
_node
(
std
::
move
(
node
))
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment