#include <unistd.h>
#include "config.h"
#include <embedch.h>
#include "include/libmc.h"
#include "macros.h"
#include "agent_datastate.h"
#include "agent_task.h"
#include "libmc.h"
#include "message.h"
#include "data_structures.h"
#include "agent_mailbox.h"
#include "include/mc_platform.h"
#include <ch.h>
#include "include/xml_parser.h"
Go to the source code of this file.
Functions | |
int | agent_AddPersistentVariable (agent_p agent, int task_num, const char *var_name) |
agent_p | agent_Copy (const agent_p agent) |
agent_p | agent_New (void) |
agent_p | agent_NewBinary (struct mc_platform_s *mc_platform) |
agent_p | agent_Initialize (struct mc_platform_s *mc_platform, message_p message, int id) |
int | agent_Destroy (agent_p agent) |
void | agent_RunChScript (agent_p agent, mc_platform_p mc_platform) |
void * | agent_ChScriptInitVar (ChInterp_t *interp) |
void * | agent_RunChScriptThread (void *ChAgent) |
Definition at line 52 of file agent.c.
References agent_s::agent_interp, agent_task_s::agent_variable_list, interpreter_variable_data_s::array_dim, interpreter_variable_data_s::array_extent, CH_DATATYPE_SIZE, CHECK_NULL, interpreter_variable_data_s::data, interpreter_variable_data_s::data_type, agent_s::datastate, MC_ERR, agent_s::name, interpreter_variable_data_s::name, interpreter_variable_data_s::size, size, strdup, agent_datastate_s::task_progress, and agent_datastate_s::tasks.
void* agent_ChScriptInitVar | ( | ChInterp_t * | interp | ) |
Definition at line 491 of file agent.c.
References MC_AclAddReceiver_chdl(), MC_AclAddReplyTo_chdl(), MC_AclDestroy_chdl(), MC_AclGetContent_chdl(), MC_AclGetConversationID_chdl(), MC_AclGetPerformative_chdl(), MC_AclGetProtocol_chdl(), MC_AclGetSender_chdl(), MC_AclNew_chdl(), MC_AclPost_chdl(), MC_AclReply_chdl(), MC_AclRetrieve_chdl(), MC_AclSend_chdl(), MC_AclSetContent_chdl(), MC_AclSetConversationID_chdl(), MC_AclSetPerformative_chdl(), MC_AclSetProtocol_chdl(), MC_AclSetSender_chdl(), MC_AclWaitRetrieve_chdl(), MC_AddAgent_chdl(), MC_AgentAddTask_chdl(), MC_AgentVariableRetrieve_chdl(), MC_AgentVariableSave_chdl(), MC_Barrier_chdl(), MC_BarrierDelete_chdl(), MC_BarrierInit_chdl(), MC_CallAgentFunc_chdl(), MC_ComposeAgent_chdl(), MC_ComposeAgentFromFile_chdl(), MC_ComposeAgentFromFileWithWorkgroup_chdl(), MC_ComposeAgentWithWorkgroup_chdl(), MC_CondBroadcast_chdl(), MC_CondReset_chdl(), MC_CondSignal_chdl(), MC_CondWait_chdl(), MC_DeleteAgent_chdl(), MC_DeleteAgentWG_chdl(), MC_DeregisterService_chdl(), MC_DestroyServiceSearchResult_chdl(), MC_End_chdl(), MC_FindAgentByID_chdl(), MC_FindAgentByName_chdl(), MC_GetAgentID_chdl(), MC_GetAgentName_chdl(), MC_GetAgentStatus_chdl(), MC_GetAgentXMLString_chdl(), MC_GetTimeOfDay_chdl(), MC_HaltAgency_chdl(), MC_MigrateAgent_chdl(), MC_MutexLock_chdl(), MC_MutexUnlock_chdl(), MC_PrintAgentCode_chdl(), MC_RegisterService_chdl(), MC_ResumeAgency_chdl(), MC_RetrieveAgent_chdl(), MC_RetrieveAgentCode_chdl(), MC_SaveData_chdl(), MC_SearchForService_chdl(), MC_SemaphorePost_chdl(), MC_SemaphoreWait_chdl(), MC_SendAgentMigrationMessage_chdl(), MC_SendAgentMigrationMessageFile_chdl(), MC_SendSteerCommand_chdl(), MC_SetAgentStatus_chdl(), MC_SetDefaultAgentStatus_chdl(), MC_SyncDelete_chdl(), MC_SyncInit_chdl(), MC_TerminateAgent_chdl(), and MC_TerminateAgentWG_chdl().
Referenced by AP_QUEUE_STD_DEFN_TEMPLATE(), and mc_platform_Initialize().
Definition at line 134 of file agent.c.
References agent_datastate_Copy(), agent_s::agent_interp, agent_mailbox_New(), agent_s::agent_persistent, agent_s::agent_status, agent_s::agent_type, agent_s::arrival_time, agent_s::datastate, agent_s::home, agent_s::home_port, agent_s::id, agent_s::lock, agent_s::mailbox, MUTEX_INIT, MUTEX_LOCK, MUTEX_T, agent_s::name, agent_s::orphan, agent_s::owner, agent_s::return_data, and agent_s::run_lock.
Referenced by MC_CopyAgent().
Definition at line 413 of file agent.c.
References agent_datastate_Destroy(), agent_s::agent_interp, agent_mailbox_Destroy(), agent_s::agent_status, agent_s::datastate, agent_s::home, mc_platform_s::interpreter_queue, agent_s::lock, agent_s::mailbox, MC_AGENT_NEUTRAL, agent_s::mc_platform, MC_SUCCESS, MUTEX_DESTROY, MUTEX_LOCK, agent_s::name, agent_s::owner, agent_s::run_lock, agent_s::sender, and agent_s::wg_code.
Referenced by agent_Initialize().
agent_p agent_Initialize | ( | struct mc_platform_s * | mc_platform, | |
message_p | message, | |||
int | id | |||
) |
Definition at line 292 of file agent.c.
References agent_s::agent_address, agent_datastate_New(), agent_Destroy(), agent_mailbox_New(), agent_s::agent_pipe_active, agent_s::agent_pipe_ready_to_read, agent_s::agent_ready_to_send, agent_s::agent_script_ready, agent_s::agent_status, agent_s::agent_thread_id, agent_s::agent_type, message_s::agent_xml_flag, agent_xml_parse(), agent_s::arrival_time, agent_s::datastate, mc_platform_s::default_agentstatus, mc_platform_s::err, agent_s::home, mc_platform_s::hostname, agent_s::id, agent_s::lock, agent_s::mailbox, MC_ERR_PARSE, agent_s::mc_platform, MC_REMOTE_AGENT, MC_RETURN_AGENT, MC_WAIT_CH, message_s::message_type, MOBILE_AGENT, MUTEX_DESTROY, MUTEX_INIT, MUTEX_T, agent_s::orphan, mc_platform_s::port, RETURN_MSG, agent_s::run_lock, agent_s::sender, agent_datastate_s::xml_agent_root, message_s::xml_payload, message_s::xml_root, and agent_datastate_s::xml_root.
Referenced by acc_MessageHandlerThread(), MC_SendAgent(), MC_SendAgentFile(), and MC_SendAgentMigrationMessageFile().
agent_p agent_New | ( | void | ) |
Definition at line 197 of file agent.c.
References agent_s::lock, MUTEX_INIT, MUTEX_NEW, and agent_s::run_lock.
Referenced by MC_ComposeAgentWithWorkgroup().
agent_p agent_NewBinary | ( | struct mc_platform_s * | mc_platform | ) |
Definition at line 220 of file agent.c.
References agent_s::agent_address, agent_mailbox_New(), agent_s::agent_pipe_active, agent_s::agent_pipe_ready_to_read, agent_s::agent_ready_to_send, agent_s::agent_script_ready, agent_s::agent_status, agent_s::agent_thread_id, agent_s::arrival_time, agent_s::binary, agent_s::home, mc_platform_s::hostname, agent_s::id, agent_s::lock, agent_s::mailbox, MC_AGENT_ACTIVE, agent_s::mc_platform, MUTEX_INIT, MUTEX_T, agent_s::orphan, mc_platform_s::port, agent_s::run_lock, and agent_s::sender.
Referenced by MC_AddStationaryAgent().
void agent_RunChScript | ( | agent_p | agent, | |
mc_platform_p | mc_platform | |||
) |
Definition at line 453 of file agent.c.
References agent_RunChScriptThread(), agent_s::agent_status, agent_s::agent_thread, MC_AGENT_ACTIVE, agent_s::mc_platform, MC_THREAD_AGENT, mc_platform_s::stack_size, and THREAD_CREATE.
Referenced by ams_ManageAgentList().
void* agent_RunChScriptThread | ( | void * | ChAgent | ) |
Definition at line 971 of file agent.c.
References mc_platform_s::agency, agent_s::agent_interp, agency_s::agentInitCallback, agency_s::agentInitUserData, mc_platform_s::ams, COND_SIGNAL, agent_s::datastate, agent_s::id, mc_platform_s::interp_options, mc_platform_s::interpreter_queue, interpreter_queue_CreateRetrieve(), interpreter_variable_data_Destroy(), interpreter_variable_data_Initialize(), interpreter_variable_data_InitializeFromAgent(), MC_AGENT_NEUTRAL, MC_EXEC_AGENT, agent_s::mc_platform, mc_platform, MC_RETURN_AGENT, mc_platform_s::MC_signal, mc_platform_s::MC_signal_cond, mc_platform_s::MC_signal_lock, MC_WAIT_FINISHED, MC_WAIT_MESSGSEND, MUTEX_LOCK, MUTEX_UNLOCK, agent_s::name, SIGNAL, agent_datastate_s::task_progress, and WARN.
Referenced by agent_RunChScript().