DataModel.h
Go to the documentation of this file.
1 
20 #ifndef DATAMODEL_H_F1F776F9
21 #define DATAMODEL_H_F1F776F9
22 
23 #include "uscxml/Common.h"
24 #include "uscxml/messages/Event.h"
25 
26 #include <list>
27 #include <string>
28 #include <memory>
29 
30 namespace uscxml {
31 
32 class DataModelImpl;
33 class DataModelExtension;
34 
40 class USCXML_API DataModel {
41 public:
42 
44 
46  virtual std::list<std::string> getNames();
48  virtual bool isValidSyntax(const std::string& expr);
49 
51  virtual void setEvent(const Event& event);
52 
54  virtual Data getAsData(const std::string& content);
56  virtual Data evalAsData(const std::string& content);
58  virtual bool evalAsBool(const std::string& expr);
59 
61  virtual uint32_t getLength(const std::string& expr);
63  virtual void setForeach(const std::string& item,
64  const std::string& array,
65  const std::string& index,
66  uint32_t iteration);
67 
69  virtual void assign(const std::string& location,
70  const Data& data,
71  const std::map<std::string, std::string>& attr = std::map<std::string, std::string>());
73  virtual void init(const std::string& location,
74  const Data& data,
75  const std::map<std::string, std::string>& attr = std::map<std::string, std::string>());
76 
78  virtual bool isDeclared(const std::string& expr);
79 
81  size_t replaceExpressions(std::string& content);
82 
84  virtual void addExtension(DataModelExtension* ext);
85 
86 protected:
87  std::shared_ptr<DataModelImpl> _impl;
88 };
89 
90 
91 }
92 
93 
94 #endif /* end of include guard: DATAMODEL_H_F1F776F9 */
Definition: Breakpoint.cpp:26
#define PIMPL_OPERATORS(type)
The usual operators as required for the PIMPL pattern.
Definition: Common.h:68
Definition: DataModelImpl.h:61
Definition: Event.h:94
The facade for data-models.
Definition: DataModel.h:40
Definition: Data.h:44