Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sds
HEP
HEPnOS
Commits
c0751114
Commit
c0751114
authored
Sep 26, 2019
by
Matthieu Dorier
Browse files
added hepnos-ls program
parent
93595c07
Changes
2
Hide whitespace changes
Inline
Side-by-side
bin/CMakeLists.txt
View file @
c0751114
...
@@ -4,5 +4,9 @@ target_link_libraries(hepnos-daemon hepnos-service yaml-cpp margo sdskv-server)
...
@@ -4,5 +4,9 @@ target_link_libraries(hepnos-daemon hepnos-service yaml-cpp margo sdskv-server)
add_executable
(
hepnos-shutdown hepnos-shutdown.cpp
)
add_executable
(
hepnos-shutdown hepnos-shutdown.cpp
)
target_link_libraries
(
hepnos-shutdown hepnos yaml-cpp margo
)
target_link_libraries
(
hepnos-shutdown hepnos yaml-cpp margo
)
add_executable
(
hepnos-ls hepnos-ls.cpp
)
target_link_libraries
(
hepnos-ls hepnos yaml-cpp margo
)
install
(
TARGETS hepnos-shutdown DESTINATION bin
)
install
(
TARGETS hepnos-shutdown DESTINATION bin
)
install
(
TARGETS hepnos-daemon DESTINATION bin
)
install
(
TARGETS hepnos-daemon DESTINATION bin
)
install
(
TARGETS hepnos-ls DESTINATION bin
)
bin/hepnos-ls.cpp
0 → 100644
View file @
c0751114
#include <iostream>
#include <hepnos.hpp>
void
navigate_subrun
(
int
level
,
hepnos
::
SubRun
&
sr
)
{
for
(
int
i
=
0
;
i
<
level
;
i
++
)
std
::
cout
<<
" "
;
std
::
cout
<<
"| "
<<
sr
.
number
()
<<
std
::
endl
;
for
(
auto
&
e
:
sr
)
{
for
(
int
i
=
0
;
i
<
level
+
1
;
i
++
)
std
::
cout
<<
" "
;
std
::
cout
<<
"| "
<<
e
.
number
()
<<
std
::
endl
;
}
}
void
navigate_run
(
int
level
,
hepnos
::
Run
&
r
)
{
for
(
int
i
=
0
;
i
<
level
;
i
++
)
std
::
cout
<<
" "
;
std
::
cout
<<
"| "
<<
r
.
number
()
<<
std
::
endl
;
for
(
auto
&
sr
:
r
)
{
navigate_subrun
(
level
+
1
,
sr
);
}
}
void
navigate_dataset
(
int
level
,
hepnos
::
DataSet
&
ds
)
{
for
(
int
i
=
0
;
i
<
level
;
i
++
)
std
::
cout
<<
" "
;
std
::
cout
<<
"| "
<<
ds
.
name
()
<<
std
::
endl
;
for
(
auto
&
sub_ds
:
ds
)
{
navigate_dataset
(
level
+
1
,
sub_ds
);
}
for
(
auto
&
r
:
ds
.
runs
())
{
navigate_run
(
level
+
1
,
r
);
}
}
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
argc
!=
2
)
{
std
::
cerr
<<
"Usage: "
<<
argv
[
0
]
<<
" <connection.yaml>"
<<
std
::
endl
;
exit
(
-
1
);
}
hepnos
::
DataStore
datastore
(
argv
[
1
]);
for
(
auto
&
ds
:
datastore
)
{
navigate_dataset
(
0
,
ds
);
}
return
0
;
}
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