[22] | 1 | #include "CheckCallIsInitialized.h"
|
---|
| 2 | #include <sstream>
|
---|
| 3 | #include <iostream>
|
---|
| 4 |
|
---|
| 5 | #include "Logger/Logger.h"
|
---|
| 6 |
|
---|
| 7 | #include "UEUserGuideClient.h"
|
---|
| 8 |
|
---|
| 9 | using namespace std;
|
---|
| 10 | using namespace boost;
|
---|
| 11 |
|
---|
| 12 | namespace UpperTestAdapter {
|
---|
| 13 |
|
---|
| 14 | namespace Processors {
|
---|
| 15 |
|
---|
| 16 | namespace TriggerCommandsGUI {
|
---|
| 17 |
|
---|
| 18 | string CheckCallIsInitialized::CheckCallIsInitializedId = "UE_CHECK_CALL_IS_INITIALIZED";
|
---|
| 19 |
|
---|
| 20 | CheckCallIsInitialized::CheckCallIsInitialized()
|
---|
| 21 | {
|
---|
| 22 | m_successor.reset();
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 | CheckCallIsInitialized::CheckCallIsInitialized(boost::shared_ptr<EutIPInterface> eutIface)
|
---|
| 26 | {
|
---|
| 27 | CheckCallIsInitialized();
|
---|
| 28 | m_eutIface = eutIface;
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | CheckCallIsInitialized::~CheckCallIsInitialized()
|
---|
| 32 | {
|
---|
| 33 | Logger::Instance().LogInfo("CheckCallIsInitialized::~CheckCallIsInitialized");
|
---|
| 34 | m_successor.reset();
|
---|
| 35 | }
|
---|
| 36 |
|
---|
| 37 | int CheckCallIsInitialized::Process(const string &trigger, const vector<string> ¶meterList)
|
---|
| 38 | {
|
---|
| 39 | stringstream ss;
|
---|
| 40 |
|
---|
| 41 | // Process the command.
|
---|
| 42 | if (trigger == CheckCallIsInitialized::CheckCallIsInitializedId)
|
---|
| 43 | {
|
---|
| 44 | int result = UEUserGuideClient::Instance().SendCommand(m_eutIface, trigger, parameterList);
|
---|
| 45 | ss.str("");
|
---|
| 46 | ss << "CheckCallIsInitialized::Process: result=" << result;
|
---|
| 47 | Logger::Instance().LogDebug(ss.str());
|
---|
| 48 | if (result != 0)
|
---|
| 49 | {
|
---|
| 50 | // Processing failed.
|
---|
| 51 | return 1; // Error - See TTCN-3 FncRetCode
|
---|
| 52 | }
|
---|
| 53 |
|
---|
| 54 | return 0/*result*/; // See TTCN-3 FncRetCode
|
---|
| 55 | }
|
---|
| 56 | else if (m_successor.get() != NULL)
|
---|
| 57 | {
|
---|
| 58 | ss << "CheckCallIsInitialized::Not supported command: " << trigger;
|
---|
| 59 | Logger::Instance().LogInfo(ss.str());
|
---|
| 60 | return m_successor.get()->Process(trigger, parameterList);
|
---|
| 61 | }
|
---|
| 62 |
|
---|
| 63 | return 1; // Error - See TTCN-3 FncRetCode
|
---|
| 64 | }
|
---|
| 65 |
|
---|
| 66 | void CheckCallIsInitialized::SetSuccessor(boost::shared_ptr<UpperTestAdapter::Processors::TriggerCommandsImpl> successor)
|
---|
| 67 | {
|
---|
| 68 | m_successor = successor;
|
---|
| 69 | };
|
---|
| 70 | } } } // namespaces
|
---|
| 71 |
|
---|