Debian Codegraph @

regression_test/XML/XmlWorkflow/PIPEasp_CNL113334/test/PIPEasp_PT.hh

raw
1 /******************************************************************************
2 * Copyright (c) 2000-2021 Ericsson Telecom AB
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v2.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
7 *
8 * Contributors:
9 * Balasko, Jeno
10 * Lovassy, Arpad
11 * Raduly, Csaba
12 *
13 ******************************************************************************/
14 /*******************************************************************************
15 *
16 * Contributors:
17 * Zoltan Janos Szabo (Ericsson) - initial architecture design and implementation
18 * Roland Gecse (Ericsson) - initial architecture design
19 * Akos Cserveni (Ericsson) - Basic AST in compiler, semantic checking
20 * Gabor Szalai (Ericsson) – RAW and TEXT codecs
21 * Matyas Forstner (Ericsson) - ASN.1 extension of the compiler and BER/CER/DER codecs
22 * Kristof Szabados (Ericsson) - Eclipse Designer, Executor, Titanium UIs
23 * Szabolcs Beres (Ericsson) - Eclipse LogViewer
24 * Ferenc Kovacs (Ericsson) – log interfaces, big number support, subtype checking
25 * Csaba Raduly (Ericsson) – ASN.1 additions, XML encoder/decoder
26 * Adam Delic (Ericsson) – template restrictions, try&catch, support of pre-processor directives in Eclipse
27 * Krisztian Pandi (Ericsson) – import of imports
28 * Peter Dimitrov (Ericsson)- maintenance
29 * Balazs Andor Zalanyi (Ericsson) – code splitting
30 * Gabor Szalai (Ericsson) – RAW encoding/decoding
31 * Jeno Attila Balasko (Ericsson) – tests
32 * Csaba Feher (Ericsson) – epoll support
33 * Tamas Buti (Ericsson)- maintenance
34 * Matyas Ormandi (Ericsson) - maintenance
35 * Botond Baranyi (Ericsson) - JSON encoder
36 * Arpad Lovassy (Ericsson) - Java Executor API
37 * Laszlo Baji (Ericsson) - maintenance
38 * Marton Godar (Ericsson) - xsd2ttcn converter
39 *******************************************************************************/
40 //
41 // File: PIPEasp_PT.hh
42 // Description: Header file of PIPE testport implementation
43 // Rev: <RnXnn>
44 // Prodnr: CNL 113 334
45 // Updated: 2008-06-03
46 // Contact: http://ttcn.ericsson.se
47 //
48
49
50 #ifndef PIPEasp__PT_HH
51 #define PIPEasp__PT_HH
52
53 #include "PIPEasp_PortType.hh"
54
55 namespace PIPEasp__PortType {
56
57 class PIPEasp__PT : public PIPEasp__PT_BASE {
58 public:
59 PIPEasp__PT(const char *par_port_name = NULL);
60 ~PIPEasp__PT();
61
62 void set_parameter(const char *parameter_name,
63 const char *parameter_value);
64
65 void Event_Handler(const fd_set *read_fds,
66 const fd_set *write_fds, const fd_set *error_fds,
67 double time_since_last_call);
68
69 protected:
70 void user_map(const char *system_port);
71 void user_unmap(const char *system_port);
72
73 void user_start();
74 void user_stop();
75
76 void outgoing_send(const PIPEasp__Types::ASP__PExecute& send_par);
77 void outgoing_send(const PIPEasp__Types::ASP__PExecuteBinary& send_par);
78 void outgoing_send(const PIPEasp__Types::ASP__PExecuteBackground& send_par);
79 void outgoing_send(const PIPEasp__Types::ASP__PStdin& send_par);
80 void outgoing_send(const PIPEasp__Types::ASP__PStdinBinary& send_par);
81 void outgoing_send(const PIPEasp__Types::ASP__PKill& send_par);
82 void outgoing_send(const PIPEasp__Types::ASP__PLineMode& send_par);
83 void outgoing_send(const PIPEasp__Types::ASP__PEndOfInput& send_par);
84 private:
85 int execCommand(const char* command);
86 void handle_childDeath();
87 void sendStdout();
88 void sendStderr();
89 void sendExitCode();
90 void sendResult();
91 void sendError(const char* error_msg);
92 void log(const char *fmt, ...);
93
94 private:
95 bool lineMode; // true if lineMode is enabled
96 bool processExecuting; // true if process is executing: disable new processes
97 bool binaryMode; // true if result should be returned in as binary data
98 bool disableSend; // if true sendStdout/err is disabled
99
100 fd_set readfds; // fd set for event handler
101 int processPid; // pid of the process currently executing
102 int processStdin; // fd of stdin of the process
103 int processStdout; // fd of stdout of the process
104 int processStderr; // fd of stderr of the process
105
106 TTCN_Buffer stdout_buffer; // data sent to stdout
107 TTCN_Buffer stderr_buffer; // data sent to stderr
108 int processExitCode; // exit code of the process
109
110 };
111
112 }//namespace
113
114 #endif