Changeset 82 in tmcsimulator for branches/FEPSimulator/FEPSim.h


Ignore:
Timestamp:
10/06/2017 06:54:21 PM (9 years ago)
Author:
jtorres
Message:

Added socket client to ATMSDriver. Added socket server to FEPSim

File:
1 moved

Legend:

Unmodified
Added
Removed
  • branches/FEPSimulator/FEPSim.h

    r80 r82  
    11/*  
    2  * File: FEPClient.h 
     2 * File: FEPSim.h 
    33 *  
    4  * The FEPClient is an RPC Client which transfers network data to the 
     4 * The FEPSim is an RPC Client which transfers network data to the 
    55 * ATMS Server. 
    66 * 
    7  * An FEPClient is created every 30 seconds, and an fep_reply structure 
     7 * An FEPSim is created every 30 seconds, and an fep_reply structure 
    88 * for every FEP_LINE_LDS is transferred to the ATMS through an RPC Call. 
    9  * After the FEPClient has transferred all fep_replys, it is destroyed. 
     9 * After the FEPSim has transferred all fep_replys, it is destroyed. 
    1010 * 
    11  * An FEPClient is script-like in nature. There are no public methods other than 
    12  * the constructor. To construct an FEPClient, an input file (containing network  
     11 * An FEPSim is script-like in nature. There are no public methods other than 
     12 * the constructor. To construct an FEPSim, an input file (containing network  
    1313 * data in xml form) and a host server_ip (for the ATMS) are necessary. The  
    1414 * format of the xml input file can be fount in "networkReader.cpp" source file. 
     
    1919 
    2020// Include guard 
    21 #ifndef __FEPCLIENT_H_INCLUDED__ 
    22 #define __FEPCLIENT_H_INCLUDED__ 
     21#ifndef __FEPSIM_H_INCLUDED__ 
     22#define __FEPSIM_H_INCLUDED__ 
    2323 
    2424// Forward declared dependencies 
     
    2828#include "fep.h" 
    2929#include <iostream> 
     30#include <stdio.h> 
    3031#include <stdlib.h> 
    3132#include "time.h" 
    3233#include "NetworkReader.h" 
     34#include <netdb.h> 
     35#include <sys/types.h>  
     36#include <sys/socket.h> 
     37#include <netinet/in.h> 
     38#include <unistd.h> 
    3339 
    34 class FEPClient 
     40const int BUFF_SIZE = 1000000; 
     41 
     42class FEPSim 
    3543{ 
    3644        public: 
     
    3947 
    4048        /* methods */ 
    41                 FEPClient(char * host, char * networkFile); // Constructor 
    42                 ~FEPClient(); // Destructor 
     49                FEPSim(char * host, char * networkFile); // Constructor 
     50                ~FEPSim(); // Destructor 
    4351 
    4452        private: 
    4553        /* members */ 
    4654        NetworkReader *networkReader; 
    47  
     55        char * ATMSHost; 
     56         
    4857        /* methods */ 
    49                 void handleCallResponse(void *response); // 
    50                 void createClient(char *host); 
     58        void handleCallResponse(void *response); // 
     59        void createClient(char *host); 
    5160        void updateATMS(); // updates ATMS 
    5261 
    5362}; 
    5463 
    55 #endif // __FEPCLIENT_H_INCLUDED__ 
     64#endif // __FEPSIM_H_INCLUDED__ 
Note: See TracChangeset for help on using the changeset viewer.