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 4647 of file mjsonrpc.cxx.
typedef MethodsTable::iterator MethodsTableIterator |
Definition at line 4648 of file mjsonrpc.cxx.
typedef std::map<std::string,MidasHistoryInterface*> MhiMap |
Definition at line 1694 of file mjsonrpc.cxx.
Definition at line 5111 of file mjsonrpc.cxx.
Definition at line 3428 of file mjsonrpc.cxx.
|
static |
Definition at line 3555 of file mjsonrpc.cxx.
Definition at line 3643 of file mjsonrpc.cxx.
Definition at line 519 of file mjsonrpc.cxx.
|
static |
Definition at line 3654 of file mjsonrpc.cxx.
Definition at line 3862 of file mjsonrpc.cxx.
Definition at line 4518 of file mjsonrpc.cxx.
Definition at line 4599 of file mjsonrpc.cxx.
Definition at line 4545 of file mjsonrpc.cxx.
Definition at line 4572 of file mjsonrpc.cxx.
|
static |
Definition at line 1698 of file mjsonrpc.cxx.
Definition at line 116 of file mjsonrpc.cxx.
Definition at line 4805 of file mjsonrpc.cxx.
Definition at line 3357 of file mjsonrpc.cxx.
Definition at line 1588 of file mjsonrpc.cxx.
Definition at line 1612 of file mjsonrpc.cxx.
Definition at line 1639 of file mjsonrpc.cxx.
Definition at line 3676 of file mjsonrpc.cxx.
Definition at line 432 of file mjsonrpc.cxx.
Definition at line 1509 of file mjsonrpc.cxx.
Definition at line 1484 of file mjsonrpc.cxx.
Definition at line 1541 of file mjsonrpc.cxx.
Definition at line 459 of file mjsonrpc.cxx.
Definition at line 3495 of file mjsonrpc.cxx.
Definition at line 860 of file mjsonrpc.cxx.
Definition at line 1030 of file mjsonrpc.cxx.
Definition at line 1095 of file mjsonrpc.cxx.
Definition at line 640 of file mjsonrpc.cxx.
Definition at line 1234 of file mjsonrpc.cxx.
Definition at line 1352 of file mjsonrpc.cxx.
Definition at line 805 of file mjsonrpc.cxx.
Definition at line 915 of file mjsonrpc.cxx.
Definition at line 1302 of file mjsonrpc.cxx.
Definition at line 1394 of file mjsonrpc.cxx.
Definition at line 1132 of file mjsonrpc.cxx.
Definition at line 1181 of file mjsonrpc.cxx.
Definition at line 1461 of file mjsonrpc.cxx.
Definition at line 1439 of file mjsonrpc.cxx.
Definition at line 3334 of file mjsonrpc.cxx.
Definition at line 3059 of file mjsonrpc.cxx.
Definition at line 2993 of file mjsonrpc.cxx.
Definition at line 4152 of file mjsonrpc.cxx.
Definition at line 4356 of file mjsonrpc.cxx.
Definition at line 4280 of file mjsonrpc.cxx.
Definition at line 4612 of file mjsonrpc.cxx.
Definition at line 1748 of file mjsonrpc.cxx.
Definition at line 1670 of file mjsonrpc.cxx.
Definition at line 1757 of file mjsonrpc.cxx.
Definition at line 1834 of file mjsonrpc.cxx.
Definition at line 1978 of file mjsonrpc.cxx.
Definition at line 1900 of file mjsonrpc.cxx.
Definition at line 2948 of file mjsonrpc.cxx.
Definition at line 2107 of file mjsonrpc.cxx.
Definition at line 2450 of file mjsonrpc.cxx.
Definition at line 2216 of file mjsonrpc.cxx.
Definition at line 2635 of file mjsonrpc.cxx.
Definition at line 1875 of file mjsonrpc.cxx.
Definition at line 4086 of file mjsonrpc.cxx.
Definition at line 4438 of file mjsonrpc.cxx.
Definition at line 3843 of file mjsonrpc.cxx.
|
static |
Definition at line 3630 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 5119 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 4760 of file mjsonrpc.cxx.
|
static |
Definition at line 5059 of file mjsonrpc.cxx.
|
static |
Definition at line 5003 of file mjsonrpc.cxx.
|
static |
Definition at line 4917 of file mjsonrpc.cxx.
|
static |
Definition at line 560 of file mjsonrpc.cxx.
Definition at line 253 of file mjsonrpc.cxx.
Definition at line 4531 of file mjsonrpc.cxx.
Definition at line 4558 of file mjsonrpc.cxx.
Definition at line 4585 of file mjsonrpc.cxx.
Definition at line 486 of file mjsonrpc.cxx.
|
static |
Definition at line 3603 of file mjsonrpc.cxx.
Definition at line 413 of file mjsonrpc.cxx.
|
static |
Definition at line 3601 of file mjsonrpc.cxx.
|
static |
Definition at line 3600 of file mjsonrpc.cxx.
|
static |
Definition at line 1696 of file mjsonrpc.cxx.
|
static |
Definition at line 4650 of file mjsonrpc.cxx.
|
static |
Definition at line 4651 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.