Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
openfpm_data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
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
Sbalzarini Lab
Software
Parallel Computing
OpenFPM
openfpm_data
Commits
d267a896
Commit
d267a896
authored
9 years ago
by
Pietro Incardona
Browse files
Options
Downloads
Patches
Plain Diff
Fixed storing reference of temporal object
parent
12ee5ff4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/GraphMLWriter.hpp
+29
-3
29 additions, 3 deletions
src/GraphMLWriter.hpp
with
29 additions
and
3 deletions
src/GraphMLWriter.hpp
+
29
−
3
View file @
d267a896
...
...
@@ -168,13 +168,25 @@ struct vertex_node
* constructor is selected over the other one
*
*/
vertex_node
(
std
::
string
&
v_node
,
const
typename
G
::
V_container
&
n_obj
,
typename
G
::
V_type
::
attributes
&
a_name
)
inline
vertex_node
(
std
::
string
&
v_node
,
const
typename
G
::
V_container
&
n_obj
,
typename
G
::
V_type
::
attributes
&
a_name
)
:
vo
(
n_obj
),
v_node
(
v_node
),
attributes_names
(
a_name
.
name
)
{
// Calculate the number of attributes name
n_attr
=
sizeof
(
a_name
.
name
)
/
sizeof
(
std
::
string
);
};
#ifdef DEBUG
/*! \brief Constructor
*
* Calling this constructor produce an error. This class store the reference of the object,
* this mean that the object passed must not be a temporal object
*
*/
inline
vertex_node
(
std
::
string
&
v_node
,
const
typename
G
::
V_container
&&
n_obj
,
typename
G
::
V_type
::
attributes
&
a_name
)
:
vo
(
n_obj
),
v_node
(
v_node
),
attributes_names
(
a_name
.
name
)
{
std
::
cerr
<<
"Error: "
<<
__FILE__
<<
":"
<<
__LINE__
<<
" Passing a temporal object
\n
"
;};
#endif
/*! \brief Constructor
*
* Create a vertex properties list
...
...
@@ -183,7 +195,7 @@ struct vertex_node
* \param n_obj object container to access its properties for example encapc<...>
*
*/
vertex_node
(
std
::
string
&
v_node
,
const
typename
G
::
V_container
&
n_obj
)
inline
vertex_node
(
std
::
string
&
v_node
,
const
typename
G
::
V_container
&
n_obj
)
:
vo
(
n_obj
),
v_node
(
v_node
),
attributes_names
(
NULL
)
{
// Calculate the number of attributes
...
...
@@ -196,6 +208,18 @@ struct vertex_node
create_prop
<
typename
G
::
V_type
>
(
attributes_names
);
};
#ifdef DEBUG
/*! \brief Constructor
*
* Calling this constructor produce an error. This class store the reference of the object,
* this mean that the object passed must not be a temporal object
*
*/
inline
vertex_node
(
std
::
string
&
v_node
,
const
typename
G
::
V_container
&&
n_obj
)
:
vo
(
n_obj
),
v_node
(
v_node
),
attributes_names
(
NULL
)
{
std
::
cerr
<<
"Error: "
<<
__FILE__
<<
":"
<<
__LINE__
<<
" Passing a temporal object
\n
"
;};
#endif
/*! \brief Create a new node
*
* Create a new node
...
...
@@ -525,8 +549,10 @@ class GraphMLWriter
// if there is the next element
while
(
it
.
isNext
())
{
auto
v
=
g
.
vertex
(
it
.
get
());
// create a vertex list functor
vertex_node
<
Graph
>
vn
(
v_out
,
g
.
vertex
(
it
.
get
())
);
vertex_node
<
Graph
>
vn
(
v_out
,
v
);
// create new node
vn
.
new_node
(
nc
);
...
...
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