Changeset 233 in tmcsimulator for branches/FEPSimulator/FEPSim.cpp


Ignore:
Timestamp:
11/13/2017 06:07:07 PM (8 years ago)
Author:
jtorres
Message:

FEPSim: finalized comments, added to both header and source files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/FEPSimulator/FEPSim.cpp

    r224 r233  
    11#include "FEPSim.h" 
    2 #include <time.h> 
    3  
     2 
     3/** 
     4 * Constructor. Sets data values for RPC Client and socket server. 
     5 *  
     6 * @param ATMSHost The IP of ATMS Server 
     7 * @param FEP RPC program number 
     8 * @param FEP RPC program revision number 
     9 * @param Socket Server listen port 
     10 */ 
    411FEPSim::FEPSim(char * ATMShost, int FEP_PROG, int FEP_REV, int SOCK_PORT) { 
    512    this->ATMSHost = ATMShost; 
     
    1320} 
    1421 
     22/** 
     23 * Destructor: closes the log file if open 
     24 */ 
    1525FEPSim::~FEPSim() { 
    1626    FEPLogFile.close(); 
    1727} 
    1828 
     29/** 
     30 * Handler for the ATMS RPC Response (to the client RPC Call) 
     31 * @param response pointer to fep_reply struct 
     32 */ 
    1933void FEPSim::handleCallResponse(void *response) { 
    2034    // Failed RPC Call  
     
    2842} 
    2943 
     44/** 
     45 * Sends an fep_reply for each station on the FEPLine.  
     46 * Gets highway status from recieved socket msg. 
     47 *  
     48 * @param buffer The recieved highway status msg. 
     49 */ 
    3050void FEPSim::sendReplys(char * buffer) { 
    3151    HighwaysParser highwaysParser = HighwaysParser(buffer); 
     
    106126} 
    107127 
     128/** 
     129 * Creates an RPC Client, and on successful creation, sends fep_replys to ATMS. 
     130 * @param The recieved highway status msg. 
     131 */ 
    108132void FEPSim::manageClientConnection(char * buffer)  
    109133{ 
     
    120144} 
    121145 
    122  
     146/** 
     147  * Creates an RPC Client to the ATMS Server. If unsuccessful, returns false 
     148  * @return bool success 
     149  */ 
    123150bool FEPSim::createClient() { 
    124151    /* Create RPC Client to communicate with ATMS */ 
     
    137164} 
    138165 
     166/** 
     167 * Creates a socket server and awaits the highway status message from the 
     168 * ATMS Driver. Upon receipt of the highway status message, creates an RPC 
     169 * client and sends the fep_replys to the ATMS. 
     170 */ 
    139171void FEPSim::runSockServer() { 
    140172    int sockfd, newsockfd, portno, clilen; 
Note: See TracChangeset for help on using the changeset viewer.