rad  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StateHistory.h
Go to the documentation of this file.
1 /*
2  * scampl4cpp/engine
3  *
4  * Copyright by European Southern Observatory, 2012
5  * All rights reserved
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20  * 02111-1307 USA.
21  */
22 
23 /*
24  * $Id: StateHistory.h 1061 2015-07-13 15:03:59Z landolfa $
25  */
26 
27 #ifndef SCXML4CPP_STATEHISTORY_H
28 #define SCXML4CPP_STATEHISTORY_H
29 
30 #ifndef __cplusplus
31 #error This is a C++ include file and cannot be used from plain C
32 #endif
33 
34 #ifndef SCXML4CPP_STATE_H
35 #include "scxml4cpp/State.h"
36 #endif
37 
38 #include <string>
39 
40 namespace scxml4cpp
41 {
42 
43 class StateHistory : public State {
44 
45  public:
46  enum HistoryType {
47  Shallow = 0,
49  };
50 
51  StateHistory(const std::string& id, const HistoryType type);
52  virtual ~StateHistory();
53 
55  std::list<State*>& getHistoryValues();
56 
57  void clearHistoryValues();
59  void pushHistoryValue(State* s);
60 
61  void setHistoryType(HistoryType type);
62  void setHistoryValues(std::list<State*>& historyValues);
63 
64  private:
65  HistoryType mType;
66  std::list<State*> mHistoryValues;
67 
68  StateHistory(const StateHistory&);
69  StateHistory& operator= (const StateHistory&);
70 };
71 
72 } // namespace scxml4cpp
73 
74 #endif // SCXML4CPP_STATEHISTORY_H
StateHistory(const std::string &id, const HistoryType type)
Definition: StateHistory.cpp:37
virtual ~StateHistory()
Definition: StateHistory.cpp:44
Definition: State.h:47
void clearHistoryValues()
Definition: StateHistory.cpp:61
Definition: StateHistory.h:48
void setHistoryValues(std::list< State * > &historyValues)
Definition: StateHistory.cpp:102
Definition: StateHistory.h:47
HistoryType
Definition: StateHistory.h:46
HistoryType getHistoryType()
Definition: StateHistory.cpp:49
State * popHistoryValue()
Definition: StateHistory.cpp:68
void setHistoryType(HistoryType type)
Definition: StateHistory.cpp:96
std::list< State * > & getHistoryValues()
Definition: StateHistory.cpp:55
Definition: StateHistory.h:43
void pushHistoryValue(State *s)
Definition: StateHistory.cpp:81