Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ScalFMM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
solverstack
ScalFMM
Commits
5c05c1d5
Commit
5c05c1d5
authored
Apr 08, 2016
by
Quentin Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Basic/Variadic Containers: move methods from basic to variadic
parent
439c9c63
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
20 deletions
+44
-20
Src/Adaptive/new/FVariadicParticleContainer.hpp
Src/Adaptive/new/FVariadicParticleContainer.hpp
+33
-1
Src/Components/FBasicParticleContainer.hpp
Src/Components/FBasicParticleContainer.hpp
+11
-19
No files found.
Src/Adaptive/new/FVariadicParticleContainer.hpp
View file @
5c05c1d5
...
...
@@ -50,11 +50,43 @@ public:
FBase
::
clear
();
}
/** \brief Push a particle in the conainer
*
* \param particle Particle to push
*/
void
push
(
const
Particle
&
particle
)
{
this
->
push_back
(
static_cast
<
typename
Particle
::
data_t
>
(
particle
));
}
/** \brief Push a particle in the container
*
* \tparam Args Parameter pack of types convertible to the Attribute type.
*
* \note The pack size must be at most AttributeCount, if it is less,
* the remaining attributes are zero constructed (i.e. `Attribute(0)`
* is called to build them).
*
* \param position The particle position
* \param args The particle attributes
*/
template
<
typename
...
Args
>
void
push
(
const
FPoint
<
FReal
>&
position
,
Args
...
args
)
{
this
->
push
(
Particle
(
position
,
args
...));
}
/*
template<typename... Ts>
void push(const position_t& pos, Ts&&... args) {
this->push_impl(std::make_index_sequence<position_t::Dim>(),
pos, std::forward<Ts>(args)...);
}
template<typename... Ts, std::size_t... Is>
void push_impl(std::index_sequence<Is...>, const position_t& pos, Ts&&... args) {
this->push_back(pos[Is]..., std::forward<Ts>(args)...);
}
*/
};
...
...
Src/Components/FBasicParticleContainer.hpp
View file @
5c05c1d5
...
...
@@ -226,14 +226,6 @@ public:
using
FBase
::
push
;
/** \brief Push a particle in the conainer
*
* \param particle Particle to push
*/
void
push
(
const
value_type
&
particle
)
{
this
->
push
(
particle
.
position
(),
std
::
get
<
attrIndices
>
(
particle
.
attributes
())...);
}
/** \brief Push a particle in the container
*
...
...
@@ -246,13 +238,13 @@ public:
* \param position The particle position
* \param args The particle attributes
*/
template
<
typename
...
Args
>
void
push
(
const
FPoint
<
FReal
>&
position
,
Args
...
args
)
{
this
->
push_helper
(
std
::
make_index_sequence
<
AttributeCount
+
OtherCount
-
sizeof
...(
args
)
>
(),
position
,
args
...
);
}
//
template<typename... Args>
//
void push(const FPoint<FReal>& position, Args... args) {
//
this->push_helper(
//
std::make_index_sequence<AttributeCount+OtherCount-sizeof...(args)>(),
//
position, args...
//
);
//
}
/** \brief Helper function for push
*
...
...
@@ -268,10 +260,10 @@ public:
* \param position Particle position
* \param args Particle attributes
*/
template
<
typename
...
Args
,
std
::
size_t
...
Is
>
void
push_helper
(
std
::
index_sequence
<
Is
...
>
,
const
FPoint
<
FReal
>&
position
,
Args
&&
...
args
)
{
FBase
::
push_back
(
std
::
get
<
posIndices
>
(
position
)...,
std
::
forward
<
Args
>
(
args
)...,
((
void
)
Is
,
Attribute
(
0
))...);
}
//
template<typename... Args, std::size_t... Is>
//
void push_helper(std::index_sequence<Is...>, const FPoint<FReal>& position, Args&&... args) {
//
FBase::push_back(std::get<posIndices>(position)..., std::forward<Args>(args)..., ((void)Is,Attribute(0))...);
//
}
/** \brief Push a particle in the container (array attributes)
*
...
...
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