Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Koch
dune-common
Commits
3bfd75b0
Commit
3bfd75b0
authored
19 years ago
by
Adrian Burri
Browse files
Options
Downloads
Patches
Plain Diff
Helper template for HasStream interface
[[Imported from SVN: r2743]]
parent
dbb9e7c9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/interfaces.hh
+25
-0
25 additions, 0 deletions
common/interfaces.hh
with
25 additions
and
0 deletions
common/interfaces.hh
+
25
−
0
View file @
3bfd75b0
...
...
@@ -3,6 +3,8 @@
#ifndef DUNE_INTERFACES_HH
#define DUNE_INTERFACES_HH
#include
"typetraits.hh"
namespace
Dune
{
//! An interface class for cloneable objects
...
...
@@ -19,6 +21,29 @@ namespace Dune {
//! Tagging interface to indicate that Grid provides typedef ObjectStreamType
struct
HasObjectStream
{};
//! Helper template (implicit specialisation if GridImp exports an object
//! stream
template
<
bool
hasStream
,
class
GridImp
,
class
DefaultImp
>
struct
GridObjectStreamOrDefaultHelper
{
typedef
typename
GridImp
::
ObjectStreamType
ObjectStreamType
;
};
//! Helper template (explicit specialisation if GridImp doesn't export an
//! object stream -> DefaultImplementation is exported)
template
<
class
GridImp
,
class
DefaultImp
>
struct
GridObjectStreamOrDefaultHelper
{
typedef
DefaultImp
ObjectStreamType
;
};
//! Template to choose right Object stream type for a given class
template
<
class
GridImp
,
class
DefaultImp
>
struct
GridObjectStreamOrDefault
{
GridObjectStreamOrDefaultHelper
<
Conversion
<
GridImp
,
HasObjectStream
::
exists
>
,
GridImp
,
DefaultImp
>::
ObjectStreamType
ObjectStreamType
;
};
}
// end namespace Dune
#endif
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