Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions qa_interfaces/ITestStateControl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:
*
* Copyright 2020 Metrological
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

#include "Module.h"

namespace Thunder {
namespace QualityAssurance {

// @json 1.0.0
struct EXTERNAL ITestStateControl : virtual public Core::IUnknown {

enum { ID = ID_TESTSTATECONTROL };

// @event
struct EXTERNAL INotification : virtual public Core::IUnknown {
enum { ID = ID_TESTSTATECONTROL_NOTIFICATION };

~INotification() override = default;

// @brief Fires whenever the IStateControl state changes
// @param state New state value ("resumed", "suspended", "uninitialized", "exited")
virtual void StateChanged(const string& state) = 0;
Comment thread
smanes0213 marked this conversation as resolved.
};

~ITestStateControl() override = default;

virtual Core::hresult Register(INotification* notification) = 0;
virtual Core::hresult Unregister(INotification* notification) = 0;

// @property
// @brief Current IStateControl lifecycle state of the plugin
// @detail Returns the full lifecycle state, which is a superset of the
// two-value enum in the production StateControl JSON-RPC schema
// (jsonrpc/StateControl.json). The additional values are
// intentional for QA use:
// "uninitialized" – no state command has been issued yet
// "resumed" – plugin is active (matches schema)
// "suspended" – plugin is suspended (matches schema)
// "exited" – plugin is shutting down
virtual Core::hresult State(string& state /* @out */) const = 0;

// @brief Request a state change
// @param command State command: "resume" or "suspend"
// @retval ERROR_UNKNOWN_KEY Unrecognised command string
virtual Core::hresult Request(const string& command) = 0;
};

} // namespace QualityAssurance
} // namespace Thunder
5 changes: 4 additions & 1 deletion qa_interfaces/QAIds.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ namespace QualityAssurance {
ID_BENCHMARK_RESULT_ITERATOR = ID_BENCHMARK + 2,

ID_BENCHMARK_PAYLOAD = RPC::IDS::ID_EXTERNAL_QA_INTERFACE_OFFSET + 0x050,
ID_BENCHMARK_PAYLOADTYPE_ITERATOR = ID_BENCHMARK_PAYLOAD + 1
ID_BENCHMARK_PAYLOADTYPE_ITERATOR = ID_BENCHMARK_PAYLOAD + 1,

ID_TESTSTATECONTROL = RPC::IDS::ID_EXTERNAL_QA_INTERFACE_OFFSET + 0x070,
ID_TESTSTATECONTROL_NOTIFICATION = ID_TESTSTATECONTROL + 1
};
}
}
Loading