ChimeraTK-DeviceAccess 03.25.00
Loading...
Searching...
No Matches
MetadataCatalogue.cc
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Deutsches Elektronen-Synchrotron DESY, MSK, ChimeraTK Project <chimeratk-support@desy.de>
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
4#include "MetadataCatalogue.h"
5
6#include "Exception.h"
7
8#include <stdexcept>
9
10namespace ChimeraTK {
11
12 /********************************************************************************************************************/
13
14 const std::string& MetadataCatalogue::getMetadata(const std::string& key) const {
15 try {
16 return metadata.at(key);
17 }
18 catch(std::out_of_range&) {
19 throw ChimeraTK::logic_error("");
20 }
21 }
22
23 /********************************************************************************************************************/
24
26 return metadata.size();
27 }
28
29 /********************************************************************************************************************/
30
31 void MetadataCatalogue::addMetadata(const std::string& key, const std::string& value) {
32 metadata[key] = value;
33 }
34
35 /********************************************************************************************************************/
36
40
41 /********************************************************************************************************************/
42
46
47 /********************************************************************************************************************/
48
52
53 /********************************************************************************************************************/
54
58
59 /********************************************************************************************************************/
60
61} // namespace ChimeraTK
std::map< std::string, std::string >::iterator iterator
Iterators for meta data.
void addMetadata(const std::string &key, const std::string &value)
Add metadata information to the catalogue.
size_t getNumberOfMetadata() const
Get number of metadata entries in the catalogue.
const std::string & getMetadata(const std::string &key) const
Get metadata information for the given key.
std::map< std::string, std::string > metadata
Map of meta data.
std::map< std::string, std::string >::const_iterator const_iterator
const_iterator cbegin() const
const_iterator cend() const
Exception thrown when a logic error has occured.
Definition Exception.h:51