Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

control_data.h

Go to the documentation of this file.
00001 // Control data implementation -*- C++ -*-
00002 
00003 // Copyright (C) 2001-2003 Hermann Schichl
00004 //
00005 // This file is part of the COCONUT API.  This library
00006 // is free software; you can redistribute it and/or modify it under the
00007 // terms of the Library GNU General Public License as published by the
00008 // Free Software Foundation; either version 2, or (at your option)
00009 // any later version.
00010 
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 // Library GNU General Public License for more details.
00015 
00016 // As a special exception, you may use this file as part of a free software
00017 // library without restriction.  Specifically, if other files instantiate
00018 // templates or use macros or inline functions from this file, or you compile
00019 // this file and link it with other files to produce an executable, this
00020 // file does not by itself cause the resulting executable to be covered by
00021 // the Library GNU General Public License.  This exception does not however
00022 // invalidate any other reasons why the executable file might be covered by
00023 // the Library GNU General Public License.
00024 
00027 #ifndef _CONTROL_DATA_H
00028 #define _CONTROL_DATA_H
00029 
00030 #include <coconut_config.h>
00031 #include <coconut_types.h>
00032 #include <info_contents.h>
00033 
00034 class control_data : protected datamap
00035 {
00036 private:
00037   typedef datamap _Base;
00038   std::string _service;
00039 
00040 public:
00041   control_data() : _Base(), _service() {}
00042   control_data(const std::string& __n, const additional_info_u& __v)
00043     : _Base(__n, __v), _service() {}
00044   control_data(const char* __n, const additional_info_u& __v)
00045     : _Base(__n, __v), _service() {}
00046   control_data(const control_data& __c) : _Base(__c), _service(__c._service) {}
00047   control_data(const std::string& serv, const info_contents& inf)
00048     : _Base(inf), _service(serv) {}
00049   virtual ~control_data() {}
00050 
00051   control_data& operator=(const control_data& __c)
00052   {
00053     ((_Base*)this)->operator=(__c);
00054     _service = __c._service;
00055     return *this;
00056   }
00057 
00058   control_data& operator=(const info_contents& __i)
00059   {
00060     ((_Base*)this)->operator=(*(_Base*)&__i);
00061     return *this;
00062   }
00063 
00064   void service(const std::string& __s);
00065   void service(const char* __s);
00066   const std::string& service() const;
00067 
00068   bool check_service(const std::string& __n) const;
00069   bool check_service(const char* __n) const;
00070 
00071   void set(const info_contents& __i) { operator=(__i); }
00072   void set(const std::string& __s, const additional_info_u& __h)
00073         { sinsert(__s, __h, false); }
00074   void set(const char* __cp, const additional_info_u& __h)
00075         { sinsert(__cp, __h, false); }
00076   void set(const std::string& __s, int i, const additional_info_u& __h)
00077         { sinsert(__s, i, __h, false); }
00078   void set(const char* __cp, int i, const additional_info_u& __h)
00079         { sinsert(__cp, i, __h, false); }
00080 
00081   const additional_info_u& get(const std::string& __s) const
00082         { return sfind(__s); }
00083   const additional_info_u& get(const char* __cp) const
00084         { return sfind(__cp); }
00085   const additional_info_u& get(const std::string& __s, int i) const
00086         { return sfind(__s, i); }
00087   const additional_info_u& get(const char* __cp, int i) const
00088         { return sfind(__cp, i); }
00089 
00090   void unset(const std::string& __s) { remove(__s); }
00091   void unset(const char* __cp) { remove(__cp); }
00092   void unset(const std::string& __s, int i) { remove(__s, i); }
00093   void unset(const char* __cp, int i) { remove(__cp, i); }
00094 
00095   bool is_set(const std::string& __s) const { return defd(__s); }
00096   bool is_set(const char* __cp) const { return defd(__cp); }
00097   bool is_set(const std::string& __s, int i) const { return defd(__s, i); }
00098   bool is_set(const char* __cp, int i) const { return defd(__cp, i); }
00099 
00100   bool which_set(const std::string& __s, std::vector<int>& __idx) const
00101         { return which(__s, __idx); }
00102   bool which_set(const char* __cp, std::vector<int>& __idx) const
00103         { return which(__cp, __idx); }
00104 
00105   template <class _S>
00106   void assign(const std::string& __s, const std::vector<_S>*& __b) const;
00107 
00108   template <class _S>
00109   void assign(const std::string& __s, const matrix<_S>*& __b) const;
00110 
00111   template <class _S>
00112   void assign(const std::string& __s, _S& __b) const;
00113 
00114   void assign(const std::string& __s, std::string& __b, const char* __def)
00115     const;
00116 
00117   template <class _S>
00118   void assign(const std::string& __s, const std::vector<_S>*& __b,
00119               const std::vector<_S>* __def) const;
00120 
00121   template <class _S>
00122   void assign(const std::string& __s, const matrix<_S>*& __b,
00123               const matrix<_S>* __def) const;
00124 
00125   template <class _S>
00126   void assign(const std::string& __s, _S& __b, _S __def) const;
00127 
00128   void assign(const char* __s, std::string& __b, const char* __def) const;
00129 
00130   template <class _S>
00131   void assign(const char* __s, const std::vector<_S>*& __b) const;
00132 
00133   template <class _S>
00134   void assign(const char* __s, const matrix<_S>*& __b) const;
00135 
00136   template <class _S>
00137   void assign(const char* __s, _S& __b) const;
00138 
00139   template <class _S>
00140   void assign(const char* __s, const std::vector<_S>*& __b,
00141               const std::vector<_S>* __def) const;
00142 
00143   template <class _S>
00144   void assign(const char* __s, const matrix<_S>*& __b,
00145               const matrix<_S>* __def) const;
00146 
00147   template <class _S>
00148   void assign(const char* __s, _S& __b, _S __def) const;
00149 
00150   template <class _S>
00151   void assign_i(const std::string& __s, int i,
00152                 const std::vector<_S>*& __b) const;
00153 
00154   template <class _S>
00155   void assign_i(const std::string& __s, int i, const matrix<_S>*& __b) const;
00156 
00157   template <class _S>
00158   void assign_i(const std::string& __s, int i, _S& __b) const;
00159 
00160   void assign_i(const std::string& __s, int i, std::string& __b,
00161                 const char* __def) const;
00162 
00163   template <class _S>
00164   void assign_i(const std::string& __s, int i, const std::vector<_S>*& __b,
00165                 const std::vector<_S>* __def) const;
00166 
00167   template <class _S>
00168   void assign_i(const std::string& __s, int i, const matrix<_S>*& __b,
00169                 const matrix<_S>* __def) const;
00170 
00171   template <class _S>
00172   void assign_i(const std::string& __s, int i, _S& __b, _S __def) const;
00173 
00174   template <class _S>
00175   void assign_i(const char* __s, int i, const std::vector<_S>*& __b) const;
00176 
00177   template <class _S>
00178   void assign_i(const char* __s, int i, const matrix<_S>*& __b) const;
00179 
00180   template <class _S>
00181   void assign_i(const char* __s, int i, _S& __b) const;
00182 
00183   void assign_i(const char* __s, int i, std::string& __b,
00184                 const char* __def) const;
00185 
00186   template <class _S>
00187   void assign_i(const char* __s, int i, const std::vector<_S>*& __b,
00188                 const std::vector<_S>* __def) const;
00189 
00190   template <class _S>
00191   void assign_i(const char* __s, int i, const matrix<_S>*& __b,
00192                 const matrix<_S>* __def) const;
00193 
00194   template <class _S>
00195   void assign_i(const char* __s, int i, _S& __b, _S __def) const;
00196 };
00197 
00198 #include <cdat-inline.h>
00199 
00200 #endif /* _CONTROL_DATA_H */

Generated on Tue Nov 4 01:57:57 2003 for COCONUT API by doxygen1.2.18