MAK Data Logger API Documentation for DIS
lgrRuntimeCommandFactory.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #ifndef lgrRuntimeCommandFactory_H_
11 #define lgrRuntimeCommandFactory_H_
12 
13 #include "lgrCore.h"
14 #include "lgrCommand.h"
15 
16 #include "collectors.h"
17 
18 #include <map>
19 #include <list>
20 
21 class DtString;
22 
23 namespace MAKLogger
24 {
25 
27  typedef std::pair<DtString,DtString> DtNamedTypedParameter;
28 
30  typedef std::list<DtNamedTypedParameter> DtParameterList;
31 
32  //Define a command Unique Id as its type and id
33  typedef std::pair<DtLgrCommandType,DtLgrCommandId> DtLgrCommandUniqueId;
34 
36  typedef std::pair<DtString,DtParameterList> DtCommandAttributes;
37  typedef std::pair<DtLgrCommandUniqueId,DtCommandAttributes> DtCommandDefinitionPair;
38 
42  {
43  public:
45  bool commandLine = true);
46 
47  DtLgrCommandType type() const;
48  DtLgrCommandId id() const;
49 
50  void setUniqueId(DtLgrCommandType,DtLgrCommandId);
51  DtLgrCommandUniqueId uniqueId() const;
52 
53  void setName(const DtString&);
54  DtString name() const;
55 
56  DtParameterList& parameters();
57  const DtParameterList& parameters() const;
58 
59  bool accessViaCommandLine() const;
60 
61  protected:
64  };
65 
69  {
70  public:
74 
76  virtual ~DtRuntimeCommandFactory();
77 
79  virtual void commandNames(DtCollector<DtString> names);
80 
82  virtual void commandParams(DtLgrCommandType,DtLgrCommandId,
83  DtParameterList& outParams);
84 
86  virtual DtString* commandName(DtLgrCommandType,DtLgrCommandId);
87 
89  DtLgrCommandType commandType(const DtString& name);
90 
92  virtual DtLgrCommandId commandId(const DtString&);
93 
103  virtual DtCommand generateCommand(DtLgrCommandType type,
104  DtLgrCommandId id,const DtParameterList& nameValuePairs);
105 
106  DtAnyValue* deserializeParameter(const DtString& type,const DtString& value) const;
107 
108  DtAnyValue* deserializeParameterList(const DtString& type,const std::vector<DtString>& values) const;
109 
111  void registerCommand(const DtCommandDefinition&);
112 
114  void unregisterCommand(const DtCommandDefinition&);
115 
117  static bool isListType(const DtString&);
118 
120  static DtString listItemType(const DtString listType);
121 
125  static DtString baseType(const DtString typeAlias);
126 
127  static DtString stringType();
128  static DtString intType();
129  static DtString int64Type();
130  static DtString floatType();
131  static DtString doubleType();
132  static DtString boolType();
133  static DtString timeType();
134  static DtString stringListType();
135  static DtString voidPtrType();
136  static DtString base64Type();
137 
138  protected:
139 
140  virtual bool isStringType(const DtString& type) const;
141  virtual bool isIntType(const DtString& type) const;
142  virtual bool isInt64Type(const DtString& type) const;
143  virtual bool isFloatType(const DtString& type) const;
144  virtual bool isDoubleType(const DtString& type) const;
145  virtual bool isBoolType(const DtString& type) const;
146  virtual bool isTimeType(const DtString& type) const;
147  virtual bool isStringListType(const DtString& type) const;
148  virtual bool isVoidPtrType(const DtString& type) const;
149  virtual bool isBase64Type(const DtString& type) const;
150 
151  typedef std::map<DtLgrCommandUniqueId,DtParameterList> DtCommandParamMap;
152  typedef std::map<DtLgrCommandUniqueId,DtString> DtCommandIdMap;
153  typedef std::map<DtString,DtLgrCommandUniqueId> DtCommandNameMap;
154 
157 
160 
163 
164  };
165 
166 }
167 
168 #endif

Document ID: Generated on Thu Apr 11 12:13:00 EDT 2013 from SVN revision 126011
Copyright © 2005-2012 VT MÄK. All Rights Reserved (www.mak.com)