Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
ipgallery.common.cpp
/
seh
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Registry
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1537b4b9
authored
Sep 13, 2016
by
amir
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
finished writing first version
before testing
parent
0066b077
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
2 deletions
src/defs/enums.h
src/defs/seh_types.h
src/seh/JsonCallFlowBuilder.cpp
src/seh/JsonCallFlowBuilder.h
src/seh/XMLCallFlowBuilder.cpp
src/seh/XMLCallFlowBuilder.h
src/defs/enums.h
View file @
1537b4b9
...
@@ -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
src/defs/seh_types.h
View file @
1537b4b9
...
@@ -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
(
c
onst
c
har
*
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
;
};
};
...
...
src/seh/JsonCallFlowBuilder.cpp
View file @
1537b4b9
This diff is collapsed.
Click to expand it.
src/seh/JsonCallFlowBuilder.h
View file @
1537b4b9
...
@@ -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
;
};
};
...
...
src/seh/XMLCallFlowBuilder.cpp
View file @
1537b4b9
...
@@ -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
();
}
}
...
...
src/seh/XMLCallFlowBuilder.h
View file @
1537b4b9
...
@@ -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
;
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment