Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Cameo
cameo
Commits
fc458bf3
Commit
fc458bf3
authored
Nov 25, 2019
by
legoc
Browse files
Added Instance.getLastState() and Instance.getActualState() functions. Keeps version 0.2.1.
parent
690cc346
Changes
3
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
fc458bf3
...
...
@@ -2,6 +2,7 @@
-----
* Added access to the output stream of an application.
* Added Instance.getLastState() and Instance.getActualState() functions.
0.2.0
-----
...
...
src/cameo/Application.cpp
View file @
fc458bf3
...
...
@@ -648,9 +648,30 @@ void Instance::cancelWaitFor() {
}
State
Instance
::
now
()
{
// First implementation used getLastState().
return
getActualState
();
}
State
Instance
::
getLastState
()
{
return
waitFor
(
0
,
""
,
nullptr
,
false
);
}
State
Instance
::
getActualState
()
const
{
vector
<
application
::
Info
>
infos
=
m_server
->
getApplicationInfos
();
for
(
vector
<
application
::
Info
>::
const_iterator
i
=
infos
.
begin
();
i
!=
infos
.
end
();
++
i
)
{
application
::
Info
const
&
info
=
*
i
;
if
(
info
.
getId
()
==
m_id
)
{
return
info
.
getState
();
}
}
return
UNKNOWN
;
}
bool
Instance
::
getBinaryResult
(
std
::
string
&
result
)
{
waitFor
();
...
...
src/cameo/Application.h
View file @
fc458bf3
...
...
@@ -209,8 +209,22 @@ public:
void
cancelWaitFor
();
/**
* Deprecated.
* TODO remove in next version.
*/
State
now
();
/**
* Gets the last state.
*/
State
getLastState
();
/**
* Returns the actual state and UNKNOWN if the instance does not exist anymore.
*/
State
getActualState
()
const
;
bool
getBinaryResult
(
std
::
string
&
result
);
bool
getResult
(
std
::
string
&
result
);
bool
getResult
(
std
::
vector
<
int32_t
>&
result
);
...
...
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