KeyValueDirectory.h
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // This file is part of FZIs ic_workspace.
5 //
6 // This program is free software licensed under the LGPL
7 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
8 // You can find a copy of this license in LICENSE folder in the top
9 // directory of the source code.
10 //
11 // © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany
12 //
13 // -- END LICENSE BLOCK ------------------------------------------------
14 
15 //----------------------------------------------------------------------
26 //----------------------------------------------------------------------
27 #ifndef ICL_CORE_KEY_VALUE_DIRECTORY_H_INCLUDED
28 #define ICL_CORE_KEY_VALUE_DIRECTORY_H_INCLUDED
29 
30 #include <boost/regex.hpp>
31 
32 #include "icl_core/BaseTypes.h"
33 #include "icl_core/Map.h"
35 
36 #ifdef _IC_BUILDER_DEPRECATED_STYLE_
37 # include "icl_core/Deprecate.h"
38 #endif
39 
40 namespace icl_core {
41 
42 template <typename T>
44 
47 template <typename T>
49 {
50  friend class KeyValueDirectoryIterator<T>;
51 public:
52 
59  KeyValueDirectoryIterator<T> find(const String& query) const;
60 
66  bool get(const String& key, typename ConvertToRef<T>::ToRef value) const;
67 
70  bool hasKey(const String& key) const;
71 
77  bool insert(const String& key, typename ConvertToRef<T>::ToConstRef value);
78 
80 #ifdef _IC_BUILDER_DEPRECATED_STYLE_
81 
86  Find(const String& query) const ICL_CORE_GCC_DEPRECATE_STYLE;
87 
92  Get(const String& key, typename ConvertToRef<T>::ToRef value) const ICL_CORE_GCC_DEPRECATE_STYLE;
93 
98 
103  Insert(const String& key, typename ConvertToRef<T>::ToConstRef value) ICL_CORE_GCC_DEPRECATE_STYLE;
104 
105 #endif
106 
108 private:
110  KeyValueMap m_items;
111 };
112 
117 template <typename T>
119 {
120 public:
124  KeyValueDirectoryIterator(const String& query, const KeyValueDirectory<T> *directory);
125 
129  String key() const;
130 
137  String matchGroup(size_t index) const;
138 
144  bool next();
145 
150  void reset();
151 
155  typename ConvertToRef<T>::ToConstRef value() const;
156 
158 #ifdef _IC_BUILDER_DEPRECATED_STYLE_
159 
164 
172  ICL_CORE_VC_DEPRECATE_STYLE String MatchGroup(size_t index) const ICL_CORE_GCC_DEPRECATE_STYLE;
173 
181 
188 
194 
195 #endif
196 
198 private:
200  boost::regex m_query;
201  boost::match_results<icl_core::String::const_iterator> m_current_results;
202 
204  bool m_reset;
205 };
206 
207 }
208 
210 
211 #endif
Helper definitions for template programming.
KeyValueDirectory< T >::KeyValueMap::const_iterator m_current_entry
#define ICL_CORE_VC_DEPRECATE_STYLE
Definition: Deprecate.h:53
bool insert(const String &key, typename ConvertToRef< T >::ToConstRef value)
Contains macros to deprecate classes, types, functions and variables.
bool hasKey(const String &key) const
KeyValueDirectoryIterator< T > find(const String &query) const
const KeyValueDirectory< T > * m_directory
Contains KeyValueDirectory.
std::string String
Definition: BaseTypes.h:43
Contains Interface base classes and base types.
boost::match_results< icl_core::String::const_iterator > m_current_results
ICL_CORE_VC_DEPRECATE_STYLE ConfigIterator Find(const icl_core::String &query) ICL_CORE_GCC_DEPRECATE_STYLE
Definition: Config.h:621
bool Get(const icl_core::String &key, typename icl_core::ConvertToRef< T >::ToRef value) ICL_CORE_GCC_DEPRECATE_STYLE
Definition: Config.h:648
#define ICL_CORE_GCC_DEPRECATE_STYLE
Definition: Deprecate.h:54


fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:58