1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2000-2014 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 v1.0
5 // which accompanies this distribution, and is available at
6 // http://www.eclipse.org/legal/epl-v10.html
7 ///////////////////////////////////////////////////////////////////////////////
10 //----------------------------------------------------------------------------
15 #include "../core/Types.h"
16 #include "../mctr2/mctr/UserInterface.h"
17 #include "../mctr2/mctr/MainController.h"
18 #include "../common/memory.h"
19 #include "../mctr2/mctr/config_data.h"
21 //----------------------------------------------------------------------------
25 //----------------------------------------------------------------------------
28 * User interface jnimw implementation.
30 class Jnimw
: public mctr::UserInterface
33 static Jnimw
*userInterface
;
38 static bool has_status_message_pending
;
41 static pthread_mutex_t mutex
;
44 * Configuration data which is filled by calling set_cfg_file()
47 static config_data mycfg
;
51 * Constructor, destructor.
56 virtual int enterLoop(int argc
, char* argv
[]);
58 /* Callback interface */
60 * Status of MC has changed.
62 virtual void status_change();
65 * Error message from MC.
67 virtual void error(int severity
, const char* msg
);
70 * General notification from MC.
72 virtual void notify(const struct timeval
* time
, const char* source
,
73 int severity
, const char* msg
);
78 void write_pipe(const char *buf
);
80 bool is_pipe_readable();
84 static void fatal_error(const char *fmt
, ...)
85 __attribute__ ((__format__ (__printf__
, 1, 2), __noreturn__
));
87 //----------------------------------------------------------------------------
91 //----------------------------------------------------------------------------
92 #endif // JNIMW_JNIMW_H