Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Algorithms Library Toolkit Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Algorithms Library Toolkit
Algorithms Library Toolkit Core
Commits
9cae2888
Commit
9cae2888
authored
7 years ago
by
Jan Trávníček
Browse files
Options
Downloads
Patches
Plain Diff
allow exact name specification for container type
parent
936e89a7
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
alib2common/src/abstraction/ContainerRegistry.hpp
+11
-6
11 additions, 6 deletions
alib2common/src/abstraction/ContainerRegistry.hpp
with
11 additions
and
6 deletions
alib2common/src/abstraction/ContainerRegistry.hpp
+
11
−
6
View file @
9cae2888
...
@@ -39,22 +39,27 @@ class ContainerRegistry {
...
@@ -39,22 +39,27 @@ class ContainerRegistry {
static
ext
::
map
<
std
::
string
,
ext
::
vector
<
ext
::
pair
<
std
::
string
,
std
::
shared_ptr
<
Entry
>
>
>
>
containerGroups
;
static
ext
::
map
<
std
::
string
,
ext
::
vector
<
ext
::
pair
<
std
::
string
,
std
::
shared_ptr
<
Entry
>
>
>
>
containerGroups
;
return
containerGroups
;
return
containerGroups
;
};
};
public:
public:
template
<
class
ParamTypes
>
template
<
class
ParamTypes
>
static
void
registerSet
(
)
{
static
void
registerSet
(
std
::
string
param
)
{
std
::
string
container
=
"Set"
;
std
::
string
container
=
"Set"
;
std
::
string
paramName
=
ext
::
to_string
<
typename
std
::
decay
<
ParamTypes
>::
type
>
(
);
auto
&
group
=
getEntries
(
)
[
container
];
auto
&
group
=
getEntries
(
)
[
container
];
for
(
const
ext
::
pair
<
std
::
string
,
std
::
shared_ptr
<
Entry
>
>
&
entry
:
group
)
for
(
const
ext
::
pair
<
std
::
string
,
std
::
shared_ptr
<
Entry
>
>
&
entry
:
group
)
if
(
entry
.
first
==
param
Name
)
if
(
entry
.
first
==
param
)
throw
exception
::
CommonException
(
"Callback for "
+
container
+
" already registered."
);
throw
exception
::
CommonException
(
"Callback for "
+
container
+
" already registered."
);
std
::
shared_ptr
<
Entry
>
entryValue
=
std
::
make_shared
<
SetEntryImpl
<
ParamTypes
>
>
(
);
std
::
shared_ptr
<
Entry
>
entryValue
=
std
::
make_shared
<
SetEntryImpl
<
ParamTypes
>
>
(
);
group
.
push_back
(
ext
::
make_pair
(
paramName
,
entryValue
)
);
group
.
push_back
(
ext
::
make_pair
(
param
,
entryValue
)
);
}
template
<
class
ParamTypes
>
static
void
registerSet
(
)
{
std
::
string
param
=
ext
::
to_string
<
typename
std
::
decay
<
ParamTypes
>::
type
>
(
);
registerSet
<
ParamTypes
>
(
param
);
}
}
static
bool
hasAbstraction
(
const
std
::
string
&
container
);
static
bool
hasAbstraction
(
const
std
::
string
&
container
);
static
std
::
shared_ptr
<
abstraction
::
OperationAbstraction
>
getAbstraction
(
const
std
::
string
&
container
,
const
std
::
string
&
paramType
);
static
std
::
shared_ptr
<
abstraction
::
OperationAbstraction
>
getAbstraction
(
const
std
::
string
&
container
,
const
std
::
string
&
paramType
);
...
...
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