dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
accessmode.h
Go to the documentation of this file.
1 
13 /*
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * for more details.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, see <http://www.gnu.org/licenses/>
26 */
27 #ifndef ACCESSMODE_H
28 #define ACCESSMODE_H
29 
30 #include "debugheader.h"
31 #include <QObject>
32 #include <QMetaObject>
33 #include <QMetaEnum>
34 #include <QStringList>
35 #include "corecommon.h"
36 
37 namespace core {
38  class TLMAPWIDGET_EXPORT AccessMode:public QObject
39  {
40  Q_OBJECT
41  Q_ENUMS(Types)
42  public:
43  enum Types
44  {
48  ServerOnly,
49 
53  ServerAndCache,
54 
58  CacheOnly
59  };
60  static QString StrByType(Types const& value)
61  {
62  QMetaObject metaObject = AccessMode().staticMetaObject;
63  QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
64  QString s=metaEnum.valueToKey(value);
65  return s;
66  }
67  static Types TypeByStr(QString const& value)
68  {
69  QMetaObject metaObject = AccessMode().staticMetaObject;
70  QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
71  Types s=(Types)metaEnum.keyToValue(value.toLatin1());
72  return s;
73  }
74  static QStringList TypesList()
75  {
76  QStringList ret;
77  QMetaObject metaObject = AccessMode().staticMetaObject;
78  QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
79  for(int x=0;x<metaEnum.keyCount();++x)
80  {
81  ret.append(metaEnum.key(x));
82  }
83  return ret;
84  }
85 
86  };
87 }
88 #endif // ACCESSMODE_H
x
Definition: OPPlots.m:100