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
e4b3a9c1
Commit
e4b3a9c1
authored
Apr 13, 2018
by
Matthieu Dorier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
completely moved private function in implementation classes
parent
46b3a0ef
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
394 additions
and
294 deletions
+394
-294
include/hepnos/DataStore.hpp
include/hepnos/DataStore.hpp
+2
-61
src/CMakeLists.txt
src/CMakeLists.txt
+6
-5
src/DataSet.cpp
src/DataSet.cpp
+6
-5
src/DataStore.cpp
src/DataStore.cpp
+5
-223
src/private/DataStoreImpl.hpp
src/private/DataStoreImpl.hpp
+375
-0
No files found.
include/hepnos/DataStore.hpp
View file @
e4b3a9c1
...
...
@@ -214,62 +214,10 @@ class DataStore {
*/
class
Impl
;
std
::
unique_ptr
<
Impl
>
m_impl
;
/*!< Pointer to implementation */
/**
* @brief Function used by the DataSet, Run, SubRuns, and Event
* classes to load binary data associated with a particular object.
*
* @param level Level of nesting (0 for data products)
* @param containerName Name of the container
* @param objectName Name of the object
* @param data Resulting byte buffer containing the object's data
*
* @return true if the object was found an loaded correctly,
* false otherwise.
*/
bool
load
(
uint8_t
level
,
const
std
::
string
&
containerName
,
const
std
::
string
&
objectName
,
std
::
vector
<
char
>&
data
)
const
;
/**
* @brief Function used by the DataSet, Run, SubRuns, and Event
* classes to load binary data associated with a particular object.
*
* @param level Level of nesting (0 for data products)
* @param containerName Name of the container
* @param objectName Name of the object
* @param data Byte buffer to write
*
* @return true is the object did not exist and was correctly written,
* false otherwise.
*/
bool
store
(
uint8_t
level
,
const
std
::
string
&
containerName
,
const
std
::
string
&
objectName
,
const
std
::
vector
<
char
>&
data
);
/**
* @brief Given a lowerBound for dataset names, retrieve at most
* maxDataSets dataset names coming striclty after lowerBound
* from the DataStore, for a given level and container name.
* Returns the number of dataset names actually retrieved
*
* @param level Level of nesting
* @param containerName Name of the container in which to search
* @param lowerBound Lower bound name to search for
* @param keys Resulting vector of dataset names
* @param maxDataSets Maximum number of datasets to retrieve.
*
* @return The actual number of dataset names retrieved.
*/
size_t
nextKeys
(
uint8_t
level
,
const
std
::
string
&
containerName
,
const
std
::
string
&
lowerBound
,
std
::
vector
<
std
::
string
>&
keys
,
size_t
maxDataSets
)
const
;
};
class
DataStore
::
const_iterator
{
friend
class
DataStore
::
Impl
;
friend
class
DataStore
;
friend
class
DataSet
;
protected:
/**
...
...
@@ -278,6 +226,7 @@ class DataStore::const_iterator {
class
Impl
;
std
::
unique_ptr
<
Impl
>
m_impl
;
/*!< Pointer to implementation */
public:
/**
* @brief Constructor. Creates a const_iterator pointing
* to an invalid DataSet.
...
...
@@ -300,8 +249,6 @@ class DataStore::const_iterator {
*/
const_iterator
(
DataSet
&&
current
);
public:
typedef
const_iterator
self_type
;
typedef
DataSet
value_type
;
typedef
DataSet
&
reference
;
...
...
@@ -404,11 +351,7 @@ class DataStore::const_iterator {
class
DataStore
::
iterator
:
public
DataStore
::
const_iterator
{
friend
class
DataStore
::
Impl
;
friend
class
DataStore
;
friend
class
DataSet
;
private:
public:
/**
* @brief Constructor. Builds an iterator pointing to an
...
...
@@ -434,8 +377,6 @@ class DataStore::iterator : public DataStore::const_iterator {
*/
iterator
(
DataSet
&&
current
);
public:
typedef
iterator
self_type
;
typedef
DataSet
value_type
;
typedef
DataSet
&
reference
;
...
...
src/CMakeLists.txt
View file @
e4b3a9c1
...
...
@@ -21,13 +21,14 @@ target_link_libraries (hepnos mercury margo yaml-cpp sdskv-client bake-client ch
target_include_directories
(
hepnos PUBLIC $<INSTALL_INTERFACE:include>
)
# local include's BEFORE, in case old incompatable .h files in prefix/include
#target_include_directories (hepnos BEFORE PUBLIC
# $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>)
include_directories
(
hepnos
${
CMAKE_CURRENT_SOURCE_DIR
}
/private
)
target_include_directories
(
hepnos BEFORE PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/../include>
)
# for shared libs, establish the lib version
#
set_target_properties (hepnos
#
PROPERTIES VERSION ${HEPNOS_VERSION}
#
SOVERSION ${HEPNOS_VERSION_MAJOR})
set_target_properties
(
hepnos
PROPERTIES VERSION
${
HEPNOS_VERSION
}
SOVERSION
${
HEPNOS_VERSION_MAJOR
}
)
#
# installation stuff (packaging and install commands)
...
...
src/DataSet.cpp
View file @
e4b3a9c1
#include "hepnos/DataSet.hpp"
#include "private/DataStoreImpl.hpp"
namespace
hepnos
{
...
...
@@ -54,7 +55,7 @@ DataSet DataSet::next() const {
if
(
!
valid
())
return
DataSet
();
std
::
vector
<
std
::
string
>
keys
;
size_t
s
=
m_impl
->
m_datastore
->
nextKeys
(
size_t
s
=
m_impl
->
m_datastore
->
m_impl
->
nextKeys
(
m_impl
->
m_level
,
m_impl
->
m_container
,
m_impl
->
m_name
,
keys
,
1
);
if
(
s
==
0
)
return
DataSet
();
return
DataSet
(
m_impl
->
m_datastore
,
m_impl
->
m_level
,
m_impl
->
m_container
,
keys
[
0
]);
...
...
@@ -70,7 +71,7 @@ bool DataSet::storeBuffer(const std::string& key, const std::vector<char>& buffe
throw
Exception
(
"Calling store() on invalid DataSet"
);
}
// forward the call to the datastore's store function
return
m_impl
->
m_datastore
->
store
(
0
,
fullname
(),
key
,
buffer
);
return
m_impl
->
m_datastore
->
m_impl
->
store
(
0
,
fullname
(),
key
,
buffer
);
}
bool
DataSet
::
loadBuffer
(
const
std
::
string
&
key
,
std
::
vector
<
char
>&
buffer
)
const
{
...
...
@@ -78,7 +79,7 @@ bool DataSet::loadBuffer(const std::string& key, std::vector<char>& buffer) cons
throw
Exception
(
"Calling load() on invalid DataSet"
);
}
// forward the call to the datastore's load function
return
m_impl
->
m_datastore
->
load
(
0
,
fullname
(),
key
,
buffer
);
return
m_impl
->
m_datastore
->
m_impl
->
load
(
0
,
fullname
(),
key
,
buffer
);
}
bool
DataSet
::
operator
==
(
const
DataSet
&
other
)
const
{
...
...
@@ -113,7 +114,7 @@ DataSet DataSet::createDataSet(const std::string& name) {
throw
Exception
(
"Invalid character '/' in dataset name"
);
}
std
::
string
parent
=
fullname
();
m_impl
->
m_datastore
->
store
(
m_impl
->
m_level
+
1
,
parent
,
name
,
std
::
vector
<
char
>
());
m_impl
->
m_datastore
->
m_impl
->
store
(
m_impl
->
m_level
+
1
,
parent
,
name
,
std
::
vector
<
char
>
());
return
DataSet
(
m_impl
->
m_datastore
,
m_impl
->
m_level
+
1
,
parent
,
name
);
}
...
...
@@ -129,7 +130,7 @@ DataSet::iterator DataSet::find(const std::string& datasetName) {
}
std
::
vector
<
char
>
data
;
std
::
string
parent
=
fullname
();
bool
b
=
m_impl
->
m_datastore
->
load
(
m_impl
->
m_level
+
1
,
parent
,
datasetName
,
data
);
bool
b
=
m_impl
->
m_datastore
->
m_impl
->
load
(
m_impl
->
m_level
+
1
,
parent
,
datasetName
,
data
);
if
(
!
b
)
{
return
m_impl
->
m_datastore
->
end
();
}
...
...
src/DataStore.cpp
View file @
e4b3a9c1
This diff is collapsed.
Click to expand it.
src/private/DataStoreImpl.hpp
0 → 100644
View file @
e4b3a9c1
This diff is collapsed.
Click to expand it.
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