parameter.hh
Go to the documentation of this file.
1 /* -*- mia-c++ -*-
2  *
3  * This file is part of MIA - a toolbox for medical image analysis
4  * Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
5  *
6  * MIA is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Pub
8 lic License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with MIA; if not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef mia_core_parameters_hh
23 #define mia_core_parameters_hh
24 
25 #include <string>
26 #include <map>
27 #include <ostream>
28 #include <istream>
29 #include <sstream>
30 #include <memory>
31 #include <mia/core/flags.hh>
32 #include <mia/core/dictmap.hh>
33 #include <mia/core/msgstream.hh>
34 #include <mia/core/handlerbase.hh>
37 
39 
49 public:
56  CParameter(const char type[], bool required, const char *descr);
57 
61  virtual ~CParameter();
62 
66  const char *type() const;
70  void descr(std::ostream& os) const;
71 
72 
77  std::string get_value_as_string() const;
78 
83  void value(std::ostream& os) const;
84 
88  bool required_set() const;
89 
93  bool set(const std::string& str_value);
94 
96  const char *get_descr() const;
97 
101  void reset();
102 
108  void add_dependend_handler(HandlerHelpMap& handler_map) const;
109 
111  std::string get_default_value() const;
112 
117  void get_help_xml(CXMLElement& root) const;
118 
119 
125  virtual void post_set();
126 
127 protected:
128 
133  virtual void do_descr(std::ostream& os) const = 0;
134 
136  const std::string errmsg(const std::string& err_value) const;
137 
138  CXMLElement& add_xmlhelp_childnode(CXMLElement& parent, const std::string& tag) const;
139  void add_xmlhelp_attribute(CXMLElement& node, const std::string& tag, const std::string& value)const;
140  void add_xmlhelp_text(CXMLElement& node, const std::string& value)const;
141 
142 private:
146  virtual void do_add_dependend_handler(HandlerHelpMap& handler_map) const;
147  virtual bool do_set(const std::string& str_value) = 0;
148  virtual void do_reset() = 0;
149  virtual std::string do_get_default_value() const = 0;
150  virtual std::string do_get_value_as_string() const = 0;
151  virtual void do_get_help_xml(CXMLElement& self) const;
152 
153  bool m_required;
154  bool m_is_required;
155  const std::string m_type;
156  const char *m_descr;
157 };
158 
159 
168 template <typename T>
170 
171 public:
177  CTParameter(T& value, bool required, const char *descr);
178 
179 protected:
183  virtual void do_descr(std::ostream& os) const;
184 private:
185  virtual bool do_set(const std::string& str_value);
186  virtual void do_reset();
187  virtual void adjust(T& value);
188  virtual std::string do_get_default_value() const;
189  virtual std::string do_get_value_as_string() const;
190  T& m_value;
191  const T m_default_value;
192 };
193 
214 enum class EParameterBounds : int {
215  bf_none = 0,
216  bf_min = 1,
217  bf_min_open = 3,
218  bf_min_closed = 5,
219  bf_min_flags = 7,
220  bf_max = 0x10,
221  bf_max_open = 0x30,
222  bf_max_closed = 0x50,
223  bf_max_flags = 0x70,
224  bf_closed_interval = 0x55,
225  bf_open_interval = 0x33
226  };
227 
229 
230 
231 EXPORT_CORE std::ostream& operator << (std::ostream& os, EParameterBounds flags);
232 
233 template <typename T>
235 
236 public:
237  template <typename S>
238  struct boundary {
239  typedef S value_type;
240  };
241 
242  template <typename S>
243  struct boundary<std::vector<S>> {
244  typedef S value_type;
245  };
246 
248 
249 
260  TBoundedParameter(T& value, EParameterBounds flags, const std::vector<boundary_type>& boundaries,
261  bool required, const char *descr);
262 protected:
266  void do_descr(std::ostream& os) const;
267 private:
268 
269  virtual void adjust(T& value);
270  virtual void do_get_help_xml(CXMLElement& self) const;
271  boundary_type m_min;
272  boundary_type m_max;
273  EParameterBounds m_flags;
274 };
275 
276 template <typename T>
277 CParameter *make_param(T& value, bool required, const char *descr)
278 {
279  return new CTParameter<T>(value, required, descr);
280 }
281 
282 
283 template <typename T, typename S>
284 CParameter *make_lo_param(T& value, S lower_bound, bool required, const char *descr)
285 {
287  {static_cast<T>(lower_bound)}, required, descr);
288 }
289 
290 template <typename T>
291 CParameter *make_positive_param(T& value, bool required, const char *descr)
292 {
293  return new TBoundedParameter<T>(value, EParameterBounds::bf_min_open, {T()}, required, descr);
294 }
295 
296 template <typename T, typename S>
297 CParameter *make_lc_param(T& value, S lower_bound, bool required, const char *descr)
298 {
300  {static_cast<T>(lower_bound)}, required, descr);
301 }
302 
303 
304 template <typename T>
305 CParameter *make_nonnegative_param(T& value, bool required, const char *descr)
306 {
307  return new TBoundedParameter<T>(value, EParameterBounds::bf_min_closed, {T()}, required, descr);
308 }
309 
310 
311 template <typename T, typename S>
312 CParameter *make_uo_param(T& value, S upper_bound, bool required, const char *descr)
313 {
315  {static_cast<T>(upper_bound)}, required, descr);
316 }
317 
318 template <typename T, typename S>
319 CParameter *make_uc_param(T& value, S upper_bound, bool required, const char *descr)
320 {
322  {static_cast<T>(upper_bound)}, required, descr);
323 }
324 
325 template <typename T, typename S1, typename S2>
326 CParameter *make_ci_param(T& value, S1 lower_bound, S2 upper_bound, bool required, const char *descr)
327 {
329  {static_cast<T>(lower_bound), static_cast<T>(upper_bound)}, required, descr);
330 }
331 
332 template <typename T, typename S1, typename S2>
333 CParameter *make_oi_param(T& value, S1 lower_bound, S2 upper_bound, bool required, const char *descr)
334 {
336  {static_cast<T>(lower_bound), static_cast<T>(upper_bound)}, required, descr);
337 }
338 
339 template <typename T, typename S1, typename S2>
340 CParameter *make_coi_param(T& value, S1 lower_bound, S2 upper_bound,bool required, const char *descr)
341 {
343  {static_cast<T>(lower_bound), static_cast<T>(upper_bound)}, required, descr);
344 }
345 
346 template <typename T, typename S1, typename S2>
347 CParameter *make_oci_param(T& value, S1 lower_bound, S2 upper_bound,bool required, const char *descr)
348 {
350  {static_cast<T>(lower_bound), static_cast<T>(upper_bound)}, required, descr);
351 }
352 
353 
354 
363 template <typename T>
364 class CDictParameter : public CParameter{
365 
366 public:
373  CDictParameter(T& value, const TDictMap<T>& dict, const char *descr, bool required = false);
374 protected:
378  virtual void do_descr(std::ostream& os) const;
379 private:
380  virtual bool do_set(const std::string& str_value);
381  virtual void do_reset();
382  virtual std::string do_get_default_value() const;
383  virtual std::string do_get_value_as_string() const;
384  virtual void do_get_help_xml(CXMLElement& self) const;
385  T& m_value;
386  T m_default_value;
387  const TDictMap<T> m_dict;
388 
389 };
390 
391 
400 template <typename F>
402 
403 public:
415  TFactoryParameter(typename F::ProductPtr& value, const std::string& init, bool required, const char *descr);
416 
428  TFactoryParameter(typename F::UniqueProduct& value, const std::string& init, bool required, const char *descr);
429 private:
430  virtual void do_descr(std::ostream& os) const;
431  virtual void do_add_dependend_handler(HandlerHelpMap& handler_map)const;
432  virtual bool do_set(const std::string& str_value);
433  virtual void do_reset();
434  virtual std::string do_get_default_value() const;
435  virtual std::string do_get_value_as_string() const;
436  virtual void do_get_help_xml(CXMLElement& self) const;
437 
438  typename F::ProductPtr dummy_shared_value;
439  typename F::UniqueProduct dummy_unique_value;
440 
441  typename F::ProductPtr& m_shared_value;
442  typename F::UniqueProduct& m_unique_value;
443 
444  virtual void post_set();
445 
446  std::string m_string_value;
447  std::string m_default_value;
448  bool m_unique;
449 
450 
451 };
452 
453 
454 
465 template <typename T>
466 class CSetParameter : public CParameter{
467 
468 public:
475  CSetParameter(T& value, const std::set<T>& valid_set, const char *descr, bool required = false);
476 protected:
480  virtual void do_descr(std::ostream& os) const;
481 private:
482  virtual bool do_set(const std::string& str_value);
483  virtual void do_reset();
484  virtual std::string do_get_default_value() const;
485  virtual std::string do_get_value_as_string() const;
486  void do_get_help_xml(CXMLElement& self) const;
487  T& m_value;
488  T m_default_value;
489  const std::set<T> m_valid_set;
490 
491 };
492 
502 template <typename T>
503 class TParameter : public CParameter{
504 
505 public:
511  TParameter(T& value, bool required, const char *descr);
512 protected:
516  virtual void do_descr(std::ostream& os) const;
517 private:
518  virtual void do_reset();
519  virtual bool do_set(const std::string& str_value);
520  virtual std::string do_get_default_value() const;
521  virtual std::string do_get_value_as_string() const;
522 
523  T& m_value;
524  T m_default_value;
525 };
526 
527 
530 public:
531  CStringParameter(std::string& value, CCmdOptionFlags flags, const char *descr,
532  const CPluginHandlerBase *plugin_hint = nullptr);
533 
534 private:
535  virtual void do_reset();
536  virtual bool do_set(const std::string& str_value);
537  virtual std::string do_get_default_value() const;
538  virtual std::string do_get_value_as_string() const;
539 
540  virtual void do_descr(std::ostream& os) const;
541  virtual void do_get_help_xml(CXMLElement& self) const;
542  virtual void do_add_dependend_handler(HandlerHelpMap& handler_map)const;
543 
544 
545  std::string& m_value;
546  std::string m_default_value;
547  CCmdOptionFlags m_flags;
548  const CPluginHandlerBase *m_plugin_hint;
549 };
550 
551 
554 
555 
562 
569 
574 
581 
588 
593 
594 
610 template <typename T>
611 CParameter *make_param(std::shared_ptr<T>& value, const std::string& init, bool required, const char *descr)
612 {
613  typedef typename FactoryTrait<T>::type F;
614  return new TFactoryParameter<F>(value, init, required, descr);
615 
616 }
617 
632 template <typename T>
633 CParameter *make_param(std::unique_ptr<T>& value, const std::string& init, bool required, const char *descr)
634 {
635  typedef typename FactoryTrait<T>::type F;
636  return new TFactoryParameter<F>(value, init, required, descr);
637 
638 }
639 
640 
641 
642 
644 
648 template <typename T>
649 struct __dispatch_param_translate {
650  static std::string apply(T x) {
651  std::ostringstream s;
652  s << x;
653  return s.str();
654  }
655 };
656 
657 template <>
658 struct __dispatch_param_translate<std::string> {
659  static std::string apply(const std::string& x) {
660  return x;
661  }
662 };
663 
664 template <>
665 struct __dispatch_param_translate<const char *> {
666  static std::string apply(const char * x) {
667  return std::string(x);
668  }
669 };
670 
672 
673 template <typename T>
674 CDictParameter<T>::CDictParameter(T& value, const TDictMap<T>& dict, const char *descr, bool required):
675  CParameter("dict", required, descr),
676  m_value(value),
677  m_default_value(value),
678  m_dict(dict)
679 {
680 }
681 
682 template <typename T>
683 void CDictParameter<T>::do_descr(std::ostream& os) const
684 {
685  for (auto i = m_dict.get_help_begin(); i != m_dict.get_help_end(); ++i) {
686  os << "\n " << i->second.first << ": " << i->second.second;
687  }
688 }
689 
690 template <typename T>
692 {
694  auto& dict = this->add_xmlhelp_childnode(self, "dict");
695  for (auto i = m_dict.get_help_begin(); i != m_dict.get_help_end(); ++i) {
696 
697  auto& v = this->add_xmlhelp_childnode(dict, "value");
698  this->add_xmlhelp_attribute(v, "name", i->second.first);
699  this->add_xmlhelp_text(v, i->second.second);
700  }
701 }
702 
703 template <typename T>
704 bool CDictParameter<T>::do_set(const std::string& str_value)
705 {
706  m_value = m_dict.get_value(str_value.c_str());
707  return true;
708 }
709 
710 template <typename T>
712 {
713  m_value = m_default_value;
714 }
715 
716 template <typename T>
717 std::string CDictParameter<T>::do_get_default_value() const
718 {
719  return m_dict.get_name(m_default_value);
720 }
721 
722 template <typename T>
724 {
725  return m_dict.get_name(m_value);
726 }
727 
728 template <typename F>
730  const std::string& init, bool required, const char *descr):
731  CParameter("factory", required, descr),
732  m_shared_value(value),
733  m_unique_value(dummy_unique_value),
734  m_string_value(init),
735  m_default_value(init),
736  m_unique(false)
737 {
738 }
739 
740 template <typename F>
741 TFactoryParameter<F>::TFactoryParameter(typename F::UniqueProduct& value, const std::string& init, bool required, const char *descr):
742  CParameter("factory", required, descr),
743  m_shared_value(dummy_shared_value),
744  m_unique_value(value),
745  m_string_value(init),
746  m_default_value(init),
747  m_unique(true)
748 {
749 }
750 
751 
752 
753 template <typename T>
754 void TFactoryParameter<T>::do_descr(std::ostream& os) const
755 {
756  os << "For a list of available plug-ins see run 'mia-plugin-help "
757  << T::instance().get_descriptor() << "'";
758 }
759 
760 template <typename T>
762 {
763  auto& node = this->add_xmlhelp_childnode(self, "factory");
764  this->add_xmlhelp_attribute(node, "name", T::instance().get_descriptor());
765 }
766 
767 template <typename T>
768 bool TFactoryParameter<T>::do_set(const std::string& str_value)
769 {
770  m_string_value = str_value;
771  return true;
772 }
773 
774 template <typename T>
776 {
777  if (!m_string_value.empty()) {
778  if (m_unique)
779  m_unique_value = T::instance().produce_unique(m_string_value);
780  else
781  m_shared_value = T::instance().produce(m_string_value);
782  }
783 }
784 
785 template <typename T>
787 {
788  m_string_value = m_default_value;
789 }
790 
791 template <typename T>
793 {
794  // add recursively all dependent handlers
795  if (handler_map.find(T::instance().get_descriptor()) == handler_map.end()){
796  handler_map[T::instance().get_descriptor()] = &T::instance();
797  for (auto i = T::instance().begin(); i != T::instance().end(); ++i)
798  i->second->add_dependend_handlers(handler_map);
799  }
800 }
801 
802 template <typename T>
804 {
805  return m_default_value;
806 }
807 
808 template <typename T>
810 {
811  if (m_unique && m_unique_value)
812  return m_unique_value->get_init_string();
813  if (!m_unique && m_shared_value)
814  return m_shared_value->get_init_string();
815  return m_string_value;
816 }
817 
818 template <typename T>
819 CSetParameter<T>::CSetParameter(T& value, const std::set<T>& valid_set, const char *descr, bool required):
820  CParameter("set", required, descr),
821  m_value(value),
822  m_default_value(value),
823  m_valid_set(valid_set)
824 {
825  if (m_valid_set.empty())
826  throw std::invalid_argument("CSetParameter initialized with empty set");
827 }
828 
829 
830 template <typename T>
831 std::string CSetParameter<T>::do_get_default_value() const
832 {
833  return __dispatch_param_translate<T>::apply(m_default_value);
834 }
835 
836 template <typename T>
838 {
839  return __dispatch_param_translate<T>::apply(m_value);
840 }
841 
842 template <typename T>
843 void CSetParameter<T>::do_descr(std::ostream& os) const
844 {
845  auto i = m_valid_set.begin();
846  auto e = m_valid_set.end();
847 
848  assert ( i != e );
849 
850  os << " Supported values are (" << *i;
851  ++i;
852 
853  while (i != e)
854  os << '|' << *i++;
855  os << ')';
856 }
857 
858 template <typename T>
860 {
861  auto& node = this->add_xmlhelp_childnode(self, "set");
862  for (auto i = m_valid_set.begin(); i != m_valid_set.end(); ++i) {
863  auto& v = this->add_xmlhelp_childnode(node, "value");
864  this->add_xmlhelp_attribute(v, "name", __dispatch_param_translate<T>::apply(*i));
865  }
866 }
867 
868 template <typename T>
870 {
871  m_value = m_default_value;
872 }
873 
874 template <typename T>
875 bool CSetParameter<T>::do_set(const std::string& str_value)
876 {
877  std::stringstream s(str_value);
878  T val;
879  s >> val;
880  if (s.fail() || m_valid_set.find(val) == m_valid_set.end()) {
881  throw std::invalid_argument(errmsg(str_value));
882  }
883  m_value = val;
884  return true;
885 }
886 
887 
888 
889 template <typename T>
891  CParameter("streamable", required, descr),
892  m_value(value),
893  m_default_value(value)
894 {
895 }
896 
897 
898 
899 template <typename T>
900 void TParameter<T>::do_descr(std::ostream& os) const
901 {
902  os << m_value;
903 }
904 
905 template <typename T>
906 bool TParameter<T>::do_set(const std::string& str_value)
907 {
908  std::stringstream s(str_value);
909  s >> m_value;
910  if (s.fail())
911  throw std::invalid_argument(errmsg(str_value));
912  return true;
913 }
914 
915 template <typename T>
917 {
918  m_value = m_default_value;
919 }
920 
921 template <typename T>
922 std::string TParameter<T>::do_get_default_value() const
923 {
924  std::ostringstream s;
925  s << m_default_value;
926  auto str = s.str();
927  if (str.find(',') != std::string::npos) {
928  std::ostringstream s2;
929  s2 << '[' << str << ']';
930  str = s2.str();
931  }
932  return str;
933 }
934 
935 template <typename T>
936 std::string TParameter<T>::do_get_value_as_string() const
937 {
938  return __dispatch_param_translate<T>::apply(m_value);
939 }
940 
942 extern template class EXPORT_CORE TBoundedParameter<uint16_t>;
943 extern template class EXPORT_CORE TBoundedParameter<uint32_t>;
944 extern template class EXPORT_CORE TBoundedParameter<uint64_t>;
945 extern template class EXPORT_CORE TBoundedParameter<int16_t>;
946 extern template class EXPORT_CORE TBoundedParameter<int32_t>;
947 extern template class EXPORT_CORE TBoundedParameter<int64_t>;
948 extern template class EXPORT_CORE TBoundedParameter<float>;
949 extern template class EXPORT_CORE TBoundedParameter<double>;
950 
957 extern template class EXPORT_CORE TBoundedParameter<std::vector<float> >;
958 extern template class EXPORT_CORE TBoundedParameter<std::vector<double> >;
959 
960 extern template class EXPORT_CORE CTParameter<std::vector<std::string> >;
961 
962 extern template class EXPORT_CORE CTParameter<std::string>;
963 extern template class EXPORT_CORE CTParameter<bool>;
964 
967 
968 #endif
void descr(std::ostream &os) const
CSetParameter(T &value, const std::set< T > &valid_set, const char *descr, bool required=false)
Definition: parameter.hh:819
CParameter * make_oci_param(T &value, S1 lower_bound, S2 upper_bound, bool required, const char *descr)
Definition: parameter.hh:347
CParameter * make_positive_param(T &value, bool required, const char *descr)
Definition: parameter.hh:291
CParameter * make_param(T &value, bool required, const char *descr)
Definition: parameter.hh:277
void add_xmlhelp_text(CXMLElement &node, const std::string &value) const
TBoundedParameter< double > CDBoundedParameter
an float parameter, double accuracy (with possible boundaries)
Definition: parameter.hh:573
TBoundedParameter< std::vector< float > > CVFBoundedParameter
an float parameter, single accuracy (with possible boundaries)
Definition: parameter.hh:590
TBoundedParameter< uint16_t > CUSBoundedParameter
an unsigned short parameter (with possible boundaries)
Definition: parameter.hh:557
virtual void do_descr(std::ostream &os) const
Definition: parameter.hh:900
A parameter that get&#39;s initialized by a factory to a shared or unique pointer.
Definition: parameter.hh:401
const std::string errmsg(const std::string &err_value) const
create an error message by using the given value that raises the error
CParameter * make_oi_param(T &value, S1 lower_bound, S2 upper_bound, bool required, const char *descr)
Definition: parameter.hh:333
CParameter * make_lc_param(T &value, S lower_bound, bool required, const char *descr)
Definition: parameter.hh:297
void value(std::ostream &os) const
A parameter that can only assume values out of a limited set.
Definition: parameter.hh:466
TBoundedParameter< int64_t > CSLBoundedParameter
an signed long parameter (with possible boundaries)
Definition: parameter.hh:568
CTParameter< bool > CBoolParameter
boolean parameter
Definition: parameter.hh:553
TBoundedParameter< std::vector< int16_t > > CVSSBoundedParameter
an signed short parameter (with possible boundaries)
Definition: parameter.hh:583
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
TFactoryParameter(typename F::ProductPtr &value, const std::string &init, bool required, const char *descr)
Definition: parameter.hh:729
The base class for parameters used in complex options.
Definition: parameter.hh:48
std::map< std::string, const CPluginHandlerBase * > HandlerHelpMap
A map that is used to collect the plug-in handlers used in a program.
Definition: handlerbase.hh:35
The base class for all plugin handlers.
Definition: handlerbase.hh:56
TBoundedParameter< uint32_t > CUIBoundedParameter
an unsigned int parameter (with possible boundaries)
Definition: parameter.hh:559
Generic type of a complex paramter.
Definition: parameter.hh:169
CParameter * make_uo_param(T &value, S upper_bound, bool required, const char *descr)
Definition: parameter.hh:312
EParameterBounds
Scalar parameter with an expected value range.
Definition: parameter.hh:214
virtual void do_descr(std::ostream &os) const =0
TBoundedParameter< int32_t > CSIBoundedParameter
an signed int parameter (with possible boundaries)
Definition: parameter.hh:566
A parameter that can assume any value of the given value type.
Definition: parameter.hh:503
TBoundedParameter< float > CFBoundedParameter
an float parameter, single accuracy (with possible boundaries)
Definition: parameter.hh:571
TBoundedParameter< std::vector< uint16_t > > CVUSBoundedParameter
an unsigned short parameter (with possible boundaries)
Definition: parameter.hh:576
virtual void do_descr(std::ostream &os) const
Definition: parameter.hh:683
#define TRACE_FUNCTION
Definition: msgstream.hh:202
CCmdOptionFlags
boundary< T >::value_type boundary_type
Definition: parameter.hh:247
CParameter * make_uc_param(T &value, S upper_bound, bool required, const char *descr)
Definition: parameter.hh:319
This class implements a facade for the xml Element.
Definition: xmlinterface.hh:49
CParameter * make_coi_param(T &value, S1 lower_bound, S2 upper_bound, bool required, const char *descr)
Definition: parameter.hh:340
CParameter * make_nonnegative_param(T &value, bool required, const char *descr)
Definition: parameter.hh:305
TBoundedParameter< uint64_t > CULBoundedParameter
an unsigned long parameter (with possible boundaries)
Definition: parameter.hh:561
void add_xmlhelp_attribute(CXMLElement &node, const std::string &tag, const std::string &value) const
TBoundedParameter< int16_t > CSSBoundedParameter
an signed short parameter (with possible boundaries)
Definition: parameter.hh:564
CXMLElement & add_xmlhelp_childnode(CXMLElement &parent, const std::string &tag) const
CParameter * make_ci_param(T &value, S1 lower_bound, S2 upper_bound, bool required, const char *descr)
Definition: parameter.hh:326
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
Definition: defines.hh:101
TBoundedParameter< std::vector< uint64_t > > CVULBoundedParameter
an unsigned long parameter (with possible boundaries)
Definition: parameter.hh:580
TBoundedParameter< std::vector< int32_t > > CVSIBoundedParameter
an signed int parameter (with possible boundaries)
Definition: parameter.hh:585
an string parameter
Definition: parameter.hh:529
CParameter * make_lo_param(T &value, S lower_bound, bool required, const char *descr)
Definition: parameter.hh:284
IMPLEMENT_FLAG_OPERATIONS(EParameterBounds)
virtual void do_descr(std::ostream &os) const
Definition: parameter.hh:843
Dictionary parameter.
Definition: parameter.hh:364
TBoundedParameter< std::vector< int64_t > > CVSLBoundedParameter
an signed long parameter (with possible boundaries)
Definition: parameter.hh:587
EXPORT_CORE std::ostream & operator<<(std::ostream &os, EParameterBounds flags)
TParameter(T &value, bool required, const char *descr)
Definition: parameter.hh:890
TBoundedParameter< std::vector< double > > CVDBoundedParameter
an float parameter, double accuracy (with possible boundaries)
Definition: parameter.hh:592
CDictParameter(T &value, const TDictMap< T > &dict, const char *descr, bool required=false)
Definition: parameter.hh:674
A mapper from emums to string values. - usefull for names flags.
Definition: dictmap.hh:45
TBoundedParameter< std::vector< uint32_t > > CVUIBoundedParameter
an unsigned int parameter (with possible boundaries)
Definition: parameter.hh:578
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36