Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Plumed AlphaFold
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Kurečka
Plumed AlphaFold
Commits
534ac2ce
There was an error fetching the commit references. Please try again later.
Commit
534ac2ce
authored
7 years ago
by
Giovanni Bussi
Browse files
Options
Downloads
Patches
Plain Diff
unique_ptr: DataFetchingObject
parent
42b6fd0c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/core/DataFetchingObject.cpp
+3
-3
3 additions, 3 deletions
src/core/DataFetchingObject.cpp
src/core/DataFetchingObject.h
+2
-1
2 additions, 1 deletion
src/core/DataFetchingObject.h
src/core/PlumedMain.cpp
+2
-2
2 additions, 2 deletions
src/core/PlumedMain.cpp
with
7 additions
and
6 deletions
src/core/DataFetchingObject.cpp
+
3
−
3
View file @
534ac2ce
...
...
@@ -40,11 +40,11 @@ public:
void
finishDataGrab
();
};
DataFetchingObject
*
DataFetchingObject
::
create
(
unsigned
n
,
PlumedMain
&
p
)
{
std
::
unique_ptr
<
DataFetchingObject
>
DataFetchingObject
::
create
(
unsigned
n
,
PlumedMain
&
p
)
{
if
(
n
==
sizeof
(
double
))
{
return
new
DataFetchingObjectTyped
<
double
>
(
p
);
return
std
::
unique_ptr
<
DataFetchingObjectTyped
<
double
>>
(
new
DataFetchingObjectTyped
<
double
>
(
p
)
)
;
}
else
if
(
n
==
sizeof
(
float
))
{
return
new
DataFetchingObjectTyped
<
float
>
(
p
);
return
std
::
unique_ptr
<
DataFetchingObjectTyped
<
float
>>
(
new
DataFetchingObjectTyped
<
float
>
(
p
)
)
;
}
std
::
string
pp
;
Tools
::
convert
(
n
,
pp
);
plumed_merror
(
"cannot create an MD interface with sizeof(real)=="
+
pp
);
...
...
This diff is collapsed.
Click to expand it.
src/core/DataFetchingObject.h
+
2
−
1
View file @
534ac2ce
...
...
@@ -26,6 +26,7 @@
#include
<vector>
#include
<set>
#include
<map>
#include
<memory>
namespace
PLMD
{
...
...
@@ -43,7 +44,7 @@ protected:
/// A copy of the plumed main object
PlumedMain
&
plumed
;
public:
static
DataFetchingObject
*
create
(
unsigned
n
,
PlumedMain
&
p
);
static
std
::
unique_ptr
<
DataFetchingObject
>
create
(
unsigned
n
,
PlumedMain
&
p
);
/// A constructor so that we can create the plumed main object
explicit
DataFetchingObject
(
PlumedMain
&
p
);
virtual
~
DataFetchingObject
()
{}
...
...
This diff is collapsed.
Click to expand it.
src/core/PlumedMain.cpp
+
2
−
2
View file @
534ac2ce
...
...
@@ -72,6 +72,7 @@ PlumedMain::PlumedMain():
citations_fwd
(
new
Citations
),
step
(
0
),
active
(
false
),
mydatafetcher
(
DataFetchingObject
::
create
(
sizeof
(
double
),
*
this
)),
endPlumed
(
false
),
atoms_fwd
(
new
Atoms
(
*
this
)),
actionSet_fwd
(
new
ActionSet
(
*
this
)),
...
...
@@ -88,7 +89,6 @@ PlumedMain::PlumedMain():
{
log
.
link
(
comm
);
log
.
setLinePrefix
(
"PLUMED: "
);
mydatafetcher
.
reset
(
DataFetchingObject
::
create
(
sizeof
(
double
),
*
this
));
stopwatch
.
start
();
stopwatch
.
pause
();
}
...
...
@@ -291,7 +291,7 @@ void PlumedMain::cmd(const std::string & word,void*val) {
CHECK_NOTINIT
(
initialized
,
word
);
CHECK_NOTNULL
(
val
,
word
);
atoms
.
setRealPrecision
(
*
static_cast
<
int
*>
(
val
));
mydatafetcher
.
reset
(
DataFetchingObject
::
create
(
*
static_cast
<
int
*>
(
val
),
*
this
)
)
;
mydatafetcher
=
DataFetchingObject
::
create
(
*
static_cast
<
int
*>
(
val
),
*
this
);
break
;
case
cmd_setMDLengthUnits
:
CHECK_NOTINIT
(
initialized
,
word
);
...
...
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