Commit 1537b4b9 by amir

finished writing first version

before testing
parent 0066b077
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifndef SEH_ENUMS_H #ifndef SEH_ENUMS_H
#define SEH_ENUMS_H #define SEH_ENUMS_H
#include <map>
namespace nsEnums namespace nsEnums
{ {
enum eRetStat enum eRetStat
...@@ -18,8 +19,24 @@ namespace nsEnums ...@@ -18,8 +19,24 @@ namespace nsEnums
eActionType_Regular, eActionType_Regular,
eActionType_If, eActionType_If,
eActionType_While, eActionType_While,
eActionType_Switch eActionType_Switch,
eActionType_Max
}; };
static std::map<const char*,eEventActionType> eventActionTypeMap = {
{ "Action", eActionType_Regular},
{ "If",eActionType_If},
{"While",eActionType_While},
{"Switch",eActionType_Switch}
};
static eEventActionType ResolveEventActionType(const char* eventActionType)
{
auto iterator = eventActionTypeMap.find(eventActionType);
if (iterator != eventActionTypeMap.end())
return iterator->second;
return eActionType_Max;
}
} }
#endif //SEH_ENUMS_H #endif //SEH_ENUMS_H
...@@ -204,7 +204,7 @@ struct NextState ...@@ -204,7 +204,7 @@ struct NextState
this->stateName.assign(stateName); this->stateName.assign(stateName);
} }
void setStateName(char* stateName) { void setStateName(const char* stateName) {
this->stateName.assign(stateName); this->stateName.assign(stateName);
} }
...@@ -376,6 +376,7 @@ struct CallFlow ...@@ -376,6 +376,7 @@ struct CallFlow
struct ICallFlowBuilder { struct ICallFlowBuilder {
virtual void Clear() = 0;
virtual RetStat BuildFlowTableFromFile(string& flowFileName, CallFlow *p_callFlow, IBaseSEH *p_baseSEHObject) = 0; virtual RetStat BuildFlowTableFromFile(string& flowFileName, CallFlow *p_callFlow, IBaseSEH *p_baseSEHObject) = 0;
virtual RetStat BuildFlowTableFromString(string& flowFSM, CallFlow* p_callFlow, IBaseSEH *baseSEHObject) = 0; virtual RetStat BuildFlowTableFromString(string& flowFSM, CallFlow* p_callFlow, IBaseSEH *baseSEHObject) = 0;
}; };
......
...@@ -34,6 +34,33 @@ public: ...@@ -34,6 +34,33 @@ public:
RetStat GetState(Document &stateNode, State *p_State); RetStat GetState(Document &stateNode, State *p_State);
RetStat GetEvent(Document &eventNode); RetStat GetEvent(Document &eventNode);
RetStat GetEventActions(Document &eventActionsNode);
RetStat GetAction(Document &actionNode);
RetStat ResolveSimpleAction(EventAction *p_eventAction, Document &actionNode);
RetStat HandleEventIfAction(EventIfAction *p_eventIfAction, Document &actionNode);
RetStat HandleEventSwitchAction(EventSwitchAction *p_eventSwitchAction, Document &actionNode);
RetStat HandleEventWhileAction(EventWhileAction *p_eventWhileAction, Document &actionNode);
const char *getParamString(Document &document, const char *p_str){
Value &value = document[p_str];
if(value.IsString())
return value.GetString();
return nullptr;
}
void GetActionParams(EventAction *p_eventAction, Document &actionParamNode);
RetStat ResolveActionFunc(EventAction *p_eventAction, const char *p_actionFuncName);
RetStat GetEventData(EventData &eventData, Document &eventNode);
virtual void Clear() override;
}; };
......
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
#include "XMLCallFlowBuilder.h" #include "XMLCallFlowBuilder.h"
void XMLCallFlowBuilder::Clear() {
}
RetStat XMLCallFlowBuilder::BuildFlowTableFromFile(string& flowFileName, CallFlow *p_callFlow, IBaseSEH *p_baseSEHObject) { RetStat XMLCallFlowBuilder::BuildFlowTableFromFile(string& flowFileName, CallFlow *p_callFlow, IBaseSEH *p_baseSEHObject) {
return RetStat(); return RetStat();
} }
......
...@@ -14,6 +14,8 @@ public: ...@@ -14,6 +14,8 @@ public:
virtual RetStat BuildFlowTableFromFile(string& flowFileName, CallFlow *p_callFlow, IBaseSEH *p_baseSEHObject) override; virtual RetStat BuildFlowTableFromFile(string& flowFileName, CallFlow *p_callFlow, IBaseSEH *p_baseSEHObject) override;
virtual RetStat BuildFlowTableFromString(string& flowFSM, CallFlow* p_callFlow, IBaseSEH *baseSEHObject) override; virtual RetStat BuildFlowTableFromString(string& flowFSM, CallFlow* p_callFlow, IBaseSEH *baseSEHObject) override;
virtual void Clear() override;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment