Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
HEPnOS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sds
HEP
HEPnOS
Commits
98e7aee4
Commit
98e7aee4
authored
Mar 22, 2018
by
Matthieu Dorier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
done with getEventByID
parent
f380fca9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
include/hepnos/FileDataStore.hpp
include/hepnos/FileDataStore.hpp
+9
-0
include/hepnos/FileEvent.hpp
include/hepnos/FileEvent.hpp
+20
-0
No files found.
include/hepnos/FileDataStore.hpp
View file @
98e7aee4
...
...
@@ -43,6 +43,15 @@ public:
return
FileNamespace
();
}
event_type
getEventByID
(
std
::
uint64_t
id
)
{
std
::
stringstream
ss
;
ss
<<
_path
<<
".ref/"
<<
std
::
setfill
(
'0'
)
<<
std
::
setw
(
20
)
<<
id
;
std
::
string
link
=
ss
.
str
();
if
(
!
fs
::
exists
(
link
))
return
FileEvent
();
std
::
string
p
=
fs
::
canonical
(
link
).
string
();
return
FileEvent
(
p
);
}
private:
std
::
string
_path
;
...
...
include/hepnos/FileEvent.hpp
View file @
98e7aee4
...
...
@@ -13,11 +13,13 @@ namespace hepnos {
namespace
fs
=
boost
::
filesystem
;
class
FileSubRun
;
class
FileDataStore
;
class
FileEvent
:
public
ProductAccessor
<
FileProductAccessorBackend
>
{
private:
friend
class
FileDataStore
;
friend
class
FileSubRun
;
friend
class
FileObjectIterator
<
FileEvent
>
;
...
...
@@ -42,6 +44,24 @@ class FileEvent : public ProductAccessor<FileProductAccessorBackend> {
createRefAndSetID
();
}
FileEvent
(
const
std
::
string
&
dir
)
:
ProductAccessor
<
FileProductAccessorBackend
>
(
dir
)
,
_eventNumber
(
0
)
,
_path
(
dir
)
{
if
(
_path
.
back
()
!=
'/'
)
_path
+=
std
::
string
(
"/"
);
std
::
size_t
i
,
j
;
j
=
_path
.
size
()
-
1
;
if
(
_path
[
j
]
==
'/'
)
j
--
;
i
=
j
;
while
(
_path
[
i
]
!=
'/'
)
i
--
;
i
+=
1
;
while
(
_path
[
i
]
==
'0'
)
i
++
;
j
+=
1
;
std
::
string
eventDir
(
&
dir
[
i
],
j
-
i
);
if
(
eventDir
.
size
()
>
0
)
_eventNumber
=
std
::
stoi
(
eventDir
);
}
FileEvent
()
:
ProductAccessor
<
FileProductAccessorBackend
>
(
""
)
,
_eventNumber
(
std
::
numeric_limits
<
std
::
uint64_t
>::
max
())
...
...
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