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, const Data& data);
71  virtual void init(const std::string& location, const Data& data);
72 
74  virtual bool isDeclared(const std::string& expr);
75 
77  size_t replaceExpressions(std::string& content);
79  std::string andExpressions(std::list<std::string> expressions);
80 
82  virtual void addExtension(DataModelExtension* ext);
83 
84 protected:
85  std::shared_ptr<DataModelImpl> _impl;
86 };
87 
88 
89 }
90 
91 
92 #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:59
Definition: Event.h:84
The facade for data-models.
Definition: DataModel.h:40
Definition: Data.h:43