MIDAS
|
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <map>
#include "mjson.h"
#include "midas.h"
#include "msystem.h"
#include "mstrlcpy.h"
#include "mjsonrpc.h"
#include <mutex>
#include "history.h"
Go to the source code of this file.
Classes | |
class | JsonHistoryBuffer |
class | BinaryHistoryBuffer |
struct | EventStashEntry |
struct | MethodsTableEntry |
struct | NestedLine |
class | NestedOutput |
Typedefs | |
typedef std::map< std::string, MidasHistoryInterface * > | MhiMap |
typedef std::map< std::string, MethodsTableEntry > | MethodsTable |
typedef MethodsTable::iterator | MethodsTableIterator |
Functions | |
static double | GetTimeSec () |
MJsonNode * | mjsonrpc_make_error (int code, const char *message, const char *data) |
MJsonNode * | mjsonrpc_make_result (MJsonNode *node) |
MJsonNode * | mjsonrpc_make_result (const char *name, MJsonNode *value, const char *name2, MJsonNode *value2, const char *name3, MJsonNode *value3) |
MJsonNode * | mjsonrpc_make_result (const char *name, MJsonNode *value, const char *name2, MJsonNode *value2, const char *name3, MJsonNode *value3, const char *name4, MJsonNode *value4) |
const MJsonNode * | mjsonrpc_get_param (const MJsonNode *params, const char *name, MJsonNode **error) |
const MJsonNodeVector * | mjsonrpc_get_param_array (const MJsonNode *params, const char *name, MJsonNode **error) |
static std::string | remove (const std::string s, char c) |
static MJsonNode * | xnull (const MJsonNode *params) |
static MJsonNode * | js_cm_exist (const MJsonNode *params) |
static MJsonNode * | js_cm_shutdown (const MJsonNode *params) |
static MJsonNode * | start_program (const MJsonNode *params) |
static MJsonNode * | exec_script (const MJsonNode *params) |
static int | parse_array_index_list (const char *method, const char *path, std::vector< unsigned > *list) |
static MJsonNode * | js_db_get_values (const MJsonNode *params) |
static MJsonNode * | js_db_ls (const MJsonNode *params) |
static MJsonNode * | js_db_copy (const MJsonNode *params) |
static MJsonNode * | js_db_paste (const MJsonNode *params) |
static MJsonNode * | js_db_create (const MJsonNode *params) |
static MJsonNode * | js_db_delete (const MJsonNode *params) |
static MJsonNode * | js_db_resize (const MJsonNode *params) |
static MJsonNode * | js_db_resize_string (const MJsonNode *params) |
static MJsonNode * | js_db_key (const MJsonNode *params) |
static MJsonNode * | js_db_rename (const MJsonNode *params) |
static MJsonNode * | js_db_link (const MJsonNode *params) |
static MJsonNode * | js_db_reorder (const MJsonNode *params) |
static MJsonNode * | js_db_sor (const MJsonNode *params) |
static MJsonNode * | js_db_scl (const MJsonNode *params) |
static MJsonNode * | js_cm_msg_facilities (const MJsonNode *params) |
static MJsonNode * | js_cm_msg1 (const MJsonNode *params) |
static MJsonNode * | js_cm_msg_retrieve (const MJsonNode *params) |
static MJsonNode * | js_al_reset_alarm (const MJsonNode *params) |
static MJsonNode * | js_al_trigger_alarm (const MJsonNode *params) |
static MJsonNode * | js_al_trigger_class (const MJsonNode *params) |
static MJsonNode * | js_hs_get_active_events (const MJsonNode *params) |
static MidasHistoryInterface * | GetHistory (const char *name) |
static void | js_hs_exit () |
static MJsonNode * | js_hs_get_channels (const MJsonNode *params) |
static MJsonNode * | js_hs_get_events (const MJsonNode *params) |
static MJsonNode * | js_hs_reopen (const MJsonNode *params) |
static MJsonNode * | js_hs_get_tags (const MJsonNode *params) |
static MJsonNode * | js_hs_get_last_written (const MJsonNode *params) |
static MJsonNode * | js_hs_read (const MJsonNode *params) |
static MJsonNode * | js_hs_read_binned (const MJsonNode *params) |
static MJsonNode * | js_hs_read_arraybuffer (const MJsonNode *params) |
static MJsonNode * | js_hs_read_binned_arraybuffer (const MJsonNode *params) |
static MJsonNode * | js_hs_image_retrieve (const MJsonNode *params) |
static MJsonNode * | js_el_retrieve (const MJsonNode *params) |
static MJsonNode * | js_el_query (const MJsonNode *params) |
static MJsonNode * | js_el_delete (const MJsonNode *params) |
static MJsonNode * | jrpc (const MJsonNode *params) |
static MJsonNode * | brpc (const MJsonNode *params) |
static MJsonNode * | js_cm_transition (const MJsonNode *params) |
static const EVENT_HEADER * | CopyEvent (const EVENT_HEADER *pevent) |
static void | StashEvent (const std::string buffer_name, int event_id, int trigger_mask, const EVENT_HEADER *pevent) |
static void | MatchEvent (const std::string buffer_name, const EVENT_HEADER *pevent) |
static void | DeleteEventStash () |
static const EVENT_HEADER * | FindEvent (const std::string buffer_name, int event_id, int trigger_mask, int last_event_id, int last_trigger_mask, DWORD last_serial_number, DWORD last_time_stamp) |
static MJsonNode * | js_bm_receive_event (const MJsonNode *params) |
static MJsonNode * | js_ss_millitime (const MJsonNode *params) |
static MJsonNode * | get_alarms (const MJsonNode *params) |
static MJsonNode * | js_make_subdir (const MJsonNode *params) |
static MJsonNode * | js_ext_list_files (const MJsonNode *params) |
static MJsonNode * | js_ext_save_file (const MJsonNode *params) |
static MJsonNode * | js_ext_read_file (const MJsonNode *params) |
static MJsonNode * | js_read_binary_file (const MJsonNode *params) |
static MJsonNode * | get_debug (const MJsonNode *params) |
static MJsonNode * | set_debug (const MJsonNode *params) |
static MJsonNode * | get_sleep (const MJsonNode *params) |
static MJsonNode * | set_sleep (const MJsonNode *params) |
static MJsonNode * | get_time (const MJsonNode *params) |
static MJsonNode * | set_time (const MJsonNode *params) |
static MJsonNode * | get_schema (const MJsonNode *params) |
static MJsonNode * | js_get_timezone (const MJsonNode *params) |
void | mjsonrpc_add_handler (const char *method, mjsonrpc_handler_t *handler, bool needs_locking) |
void | mjsonrpc_set_std_mutex (void *mutex) |
void | mjsonrpc_init () |
void | mjsonrpc_exit () |
static MJsonNode * | mjsonrpc_make_schema (MethodsTable *h) |
MJsonNode * | mjsonrpc_get_schema () |
static std::string | indent (int x, const char *p=" ") |
static std::string | mjsonrpc_schema_to_html_anything (const MJsonNode *schema, int nest_level, NestedOutput *o) |
static std::string | mjsonrpc_schema_to_html_object (const MJsonNode *schema, int nest_level, NestedOutput *o) |
static std::string | mjsonrpc_schema_to_html_array (const MJsonNode *schema, int nest_level, NestedOutput *o) |
std::string | mjsonrpc_schema_to_text (const MJsonNode *schema) |
static void | add (std::string *s, const char *text) |
static MJsonNode * | mjsonrpc_handle_request (const MJsonNode *request) |
MJsonNode * | mjsonrpc_decode_post_data (const char *post_data) |
Variables | |
int | mjsonrpc_debug = 0 |
static int | mjsonrpc_sleep = 0 |
static int | mjsonrpc_time = 0 |
static MJsonNode * | gNullNode = NULL |
static MhiMap | gHistoryChannels |
static std::mutex | gEventStashMutex |
static std::vector< EventStashEntry * > | gEventStash |
static MethodsTable | gMethodsTable |
static std::mutex * | gMutex = NULL |
typedef std::map<std::string, MethodsTableEntry> MethodsTable |
Definition at line 4634 of file mjsonrpc.cxx.
typedef MethodsTable::iterator MethodsTableIterator |
Definition at line 4635 of file mjsonrpc.cxx.
typedef std::map<std::string,MidasHistoryInterface*> MhiMap |
Definition at line 1693 of file mjsonrpc.cxx.
Definition at line 5098 of file mjsonrpc.cxx.
Definition at line 3421 of file mjsonrpc.cxx.
|
static |
Definition at line 3542 of file mjsonrpc.cxx.
Definition at line 3630 of file mjsonrpc.cxx.
Definition at line 519 of file mjsonrpc.cxx.
|
static |
Definition at line 3641 of file mjsonrpc.cxx.
Definition at line 3849 of file mjsonrpc.cxx.
Definition at line 4505 of file mjsonrpc.cxx.
Definition at line 4586 of file mjsonrpc.cxx.
Definition at line 4532 of file mjsonrpc.cxx.
Definition at line 4559 of file mjsonrpc.cxx.
|
static |
Definition at line 1697 of file mjsonrpc.cxx.
Definition at line 116 of file mjsonrpc.cxx.
Definition at line 4792 of file mjsonrpc.cxx.
Definition at line 3356 of file mjsonrpc.cxx.
Definition at line 1587 of file mjsonrpc.cxx.
Definition at line 1611 of file mjsonrpc.cxx.
Definition at line 1638 of file mjsonrpc.cxx.
Definition at line 3663 of file mjsonrpc.cxx.
Definition at line 432 of file mjsonrpc.cxx.
Definition at line 1508 of file mjsonrpc.cxx.
Definition at line 1483 of file mjsonrpc.cxx.
Definition at line 1540 of file mjsonrpc.cxx.
Definition at line 459 of file mjsonrpc.cxx.
Definition at line 3482 of file mjsonrpc.cxx.
Definition at line 860 of file mjsonrpc.cxx.
Definition at line 1030 of file mjsonrpc.cxx.
Definition at line 1094 of file mjsonrpc.cxx.
Definition at line 640 of file mjsonrpc.cxx.
Definition at line 1233 of file mjsonrpc.cxx.
Definition at line 1351 of file mjsonrpc.cxx.
Definition at line 805 of file mjsonrpc.cxx.
Definition at line 915 of file mjsonrpc.cxx.
Definition at line 1301 of file mjsonrpc.cxx.
Definition at line 1393 of file mjsonrpc.cxx.
Definition at line 1131 of file mjsonrpc.cxx.
Definition at line 1180 of file mjsonrpc.cxx.
Definition at line 1460 of file mjsonrpc.cxx.
Definition at line 1438 of file mjsonrpc.cxx.
Definition at line 3333 of file mjsonrpc.cxx.
Definition at line 3058 of file mjsonrpc.cxx.
Definition at line 2992 of file mjsonrpc.cxx.
Definition at line 4139 of file mjsonrpc.cxx.
Definition at line 4343 of file mjsonrpc.cxx.
Definition at line 4267 of file mjsonrpc.cxx.
Definition at line 4599 of file mjsonrpc.cxx.
Definition at line 1747 of file mjsonrpc.cxx.
Definition at line 1669 of file mjsonrpc.cxx.
Definition at line 1756 of file mjsonrpc.cxx.
Definition at line 1833 of file mjsonrpc.cxx.
Definition at line 1977 of file mjsonrpc.cxx.
Definition at line 1899 of file mjsonrpc.cxx.
Definition at line 2947 of file mjsonrpc.cxx.
Definition at line 2106 of file mjsonrpc.cxx.
Definition at line 2449 of file mjsonrpc.cxx.
Definition at line 2215 of file mjsonrpc.cxx.
Definition at line 2634 of file mjsonrpc.cxx.
Definition at line 1874 of file mjsonrpc.cxx.
Definition at line 4073 of file mjsonrpc.cxx.
Definition at line 4425 of file mjsonrpc.cxx.
Definition at line 3830 of file mjsonrpc.cxx.
|
static |
Definition at line 3617 of file mjsonrpc.cxx.
const MJsonNodeVector * mjsonrpc_get_param_array | ( | const MJsonNode * | params, |
const char * | name, | ||
MJsonNode ** | error | ||
) |
Definition at line 201 of file mjsonrpc.cxx.
Definition at line 5106 of file mjsonrpc.cxx.
MJsonNode * mjsonrpc_make_result | ( | const char * | name, |
MJsonNode * | value, | ||
const char * | name2, | ||
MJsonNode * | value2, | ||
const char * | name3, | ||
MJsonNode * | value3, | ||
const char * | name4, | ||
MJsonNode * | value4 | ||
) |
Definition at line 158 of file mjsonrpc.cxx.
|
static |
Definition at line 4747 of file mjsonrpc.cxx.
|
static |
Definition at line 5046 of file mjsonrpc.cxx.
|
static |
Definition at line 4990 of file mjsonrpc.cxx.
|
static |
Definition at line 4904 of file mjsonrpc.cxx.
|
static |
Definition at line 560 of file mjsonrpc.cxx.
Definition at line 253 of file mjsonrpc.cxx.
Definition at line 4518 of file mjsonrpc.cxx.
Definition at line 4545 of file mjsonrpc.cxx.
Definition at line 4572 of file mjsonrpc.cxx.
Definition at line 486 of file mjsonrpc.cxx.
|
static |
Definition at line 3590 of file mjsonrpc.cxx.
Definition at line 413 of file mjsonrpc.cxx.
|
static |
Definition at line 3588 of file mjsonrpc.cxx.
|
static |
Definition at line 3587 of file mjsonrpc.cxx.
|
static |
Definition at line 1695 of file mjsonrpc.cxx.
|
static |
Definition at line 4637 of file mjsonrpc.cxx.
|
static |
Definition at line 4638 of file mjsonrpc.cxx.
|
static |
Definition at line 176 of file mjsonrpc.cxx.
|
static |
Definition at line 113 of file mjsonrpc.cxx.
|
static |
Definition at line 114 of file mjsonrpc.cxx.