1 | #include "CheckNewMediaAdded.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 CheckNewMediaAdded::SendMessageId = "UE_CHECK_NEW_MEDIA_STREAM_IS_ADDED";
|
---|
19 |
|
---|
20 | CheckNewMediaAdded::CheckNewMediaAdded()
|
---|
21 | {
|
---|
22 | m_successor.reset();
|
---|
23 | }
|
---|
24 |
|
---|
25 | CheckNewMediaAdded::CheckNewMediaAdded(shared_ptr<EutIPInterface> eutIface)
|
---|
26 | {
|
---|
27 | CheckNewMediaAdded();
|
---|
28 | m_eutIface = eutIface;
|
---|
29 | }
|
---|
30 |
|
---|
31 | CheckNewMediaAdded::~CheckNewMediaAdded()
|
---|
32 | {
|
---|
33 | Logger::Instance().LogInfo("CheckNewMediaAdded::~CheckNewMediaAdded");
|
---|
34 | m_successor.reset();
|
---|
35 | }
|
---|
36 |
|
---|
37 | int CheckNewMediaAdded::Process(const string &trigger, const vector<string> ¶meterList)
|
---|
38 | {
|
---|
39 | stringstream ss;
|
---|
40 |
|
---|
41 | // Process the command.
|
---|
42 |
|
---|
43 | if (trigger == CheckNewMediaAdded::SendMessageId)
|
---|
44 | {
|
---|
45 | int result = 0;//UEUserGuideClient::Instance().SendCommand(m_eutIface, trigger, parameterList);
|
---|
46 | ss.str("");
|
---|
47 | ss << "CheckNewMediaAdded::Process: result=" << result;
|
---|
48 | Logger::Instance().LogDebug(ss.str());
|
---|
49 | if (result != 0)
|
---|
50 | {
|
---|
51 | // Processing failed.
|
---|
52 | return 1; // Error - See TTCN-3 FncRetCode
|
---|
53 | }
|
---|
54 |
|
---|
55 | return 0/*result*/; // See TTCN-3 FncRetCode
|
---|
56 | }
|
---|
57 | else if (m_successor.get() != NULL)
|
---|
58 | {
|
---|
59 | ss << "CheckNewMediaAdded::Not supported command: " << trigger;
|
---|
60 | Logger::Instance().LogInfo(ss.str());
|
---|
61 | return m_successor.get()->Process(trigger, parameterList);
|
---|
62 | }
|
---|
63 |
|
---|
64 | return 1; // Error - See TTCN-3 FncRetCode
|
---|
65 | }
|
---|
66 |
|
---|
67 | void CheckNewMediaAdded::SetSuccessor(boost::shared_ptr<UpperTestAdapter::Processors::TriggerCommandsImpl> successor)
|
---|
68 | {
|
---|
69 | m_successor = successor;
|
---|
70 | };
|
---|
71 | } } } // namespaces
|
---|
72 |
|
---|