Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
partons
core
elementary-utils
Commits
31a5625c
Commit
31a5625c
authored
Jul 29, 2016
by
Bryan Berthou
Browse files
refs#16
In ElementaryUtils (trunk) : - Add getters to Parameters members.
parent
21abf38d
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/ElementaryUtils/logger/LoggerManager.h
View file @
31a5625c
...
...
@@ -4,11 +4,8 @@
/**
* @file LoggerManager.h
* @author Bryan BERTHOU (SPhN / CEA Saclay)
* @date
05
September 2014
* @date September
05,
2014
* @version 2.0
*
* @class LoggerManager
* @brief \<singleton\> Use for handle logs.
*/
#include
<SFML/System/Mutex.hpp>
...
...
@@ -35,6 +32,10 @@ const std::string DEFAULT_LEVEL_NAME = "default.level";
const
std
::
string
PRINT_MODE_NAME
=
"print.mode"
;
const
std
::
string
OUTPUT_LOG_FILE_PATH
=
"log.file.path"
;
/**
* @class LoggerManager
* @brief \<singleton\> Use for handle logs.
*/
class
LoggerManager
:
public
Thread
{
public:
static
LoggerManager
*
getInstance
();
...
...
include/ElementaryUtils/parameters/Parameters.h
View file @
31a5625c
...
...
@@ -32,9 +32,6 @@ public:
bool
isAvailable
(
const
std
::
string
&
parameterName
)
const
;
const
GenericType
&
get
(
const
std
::
string
&
key
)
const
;
const
GenericType
&
getLastAvailable
()
const
;
/// Care ! Use it after isAvailable() to ensure that the iterator is in the map range.
size_t
size
()
const
;
void
clear
();
...
...
@@ -45,6 +42,12 @@ public:
bool
update
(
const
std
::
string
&
key
,
const
GenericType
&
value
);
const
GenericType
&
get
(
const
std
::
string
&
key
)
const
;
const
GenericType
&
getLastAvailable
()
const
;
/// Care ! Use it after isAvailable() to ensure that the iterator is in the map range.
std
::
string
key
(
size_t
index
)
const
;
GenericType
value
(
size_t
index
)
const
;
private:
// <key, value>
std
::
map
<
std
::
string
,
GenericType
>
m_parameters
;
...
...
src/ElementaryUtils/parameters/Parameters.cpp
View file @
31a5625c
#include
"../../../include/ElementaryUtils/parameters/Parameters.h"
#include
<iterator>
#include
<stdexcept>
#include
<utility>
...
...
@@ -101,4 +102,23 @@ bool ElemUtils::Parameters::update(const std::string& key,
return
result
;
}
std
::
string
Parameters
::
key
(
size_t
index
)
const
{
std
::
map
<
std
::
string
,
GenericType
>::
const_iterator
it
=
m_parameters
.
begin
();
std
::
advance
(
it
,
index
);
return
it
->
first
;
}
GenericType
Parameters
::
value
(
size_t
index
)
const
{
std
::
map
<
std
::
string
,
GenericType
>::
const_iterator
it
=
m_parameters
.
begin
();
std
::
advance
(
it
,
index
);
return
it
->
second
;
}
}
// namespace ElemUtils
Write
Preview
Supports
Markdown
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