source: tmcsimulator/branches/FEPSimulator/FEPSim.h @ 82

Revision 82, 1.6 KB checked in by jtorres, 9 years ago (diff)

Added socket client to ATMSDriver. Added socket server to FEPSim

Line 
1/*
2 * File: FEPSim.h
3 *
4 * The FEPSim is an RPC Client which transfers network data to the
5 * ATMS Server.
6 *
7 * An FEPSim is created every 30 seconds, and an fep_reply structure
8 * for every FEP_LINE_LDS is transferred to the ATMS through an RPC Call.
9 * After the FEPSim has transferred all fep_replys, it is destroyed.
10 *
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
13 * data in xml form) and a host server_ip (for the ATMS) are necessary. The
14 * format of the xml input file can be fount in "networkReader.cpp" source file.
15 *
16 * @author John A. Torres
17 * @version 9/8/2017
18 */
19
20// Include guard
21#ifndef __FEPSIM_H_INCLUDED__
22#define __FEPSIM_H_INCLUDED__
23
24// Forward declared dependencies
25class NetworkReader;
26
27// Included dependencies
28#include "fep.h"
29#include <iostream>
30#include <stdio.h>
31#include <stdlib.h>
32#include "time.h"
33#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>
39
40const int BUFF_SIZE = 1000000;
41
42class FEPSim
43{
44        public:
45        /* members */
46                CLIENT *clnt; // RPC Client
47
48        /* methods */
49                FEPSim(char * host, char * networkFile); // Constructor
50                ~FEPSim(); // Destructor
51
52        private:
53        /* members */
54        NetworkReader *networkReader;
55        char * ATMSHost;
56       
57        /* methods */
58        void handleCallResponse(void *response); //
59        void createClient(char *host);
60        void updateATMS(); // updates ATMS
61
62};
63
64#endif // __FEPSIM_H_INCLUDED__
Note: See TracBrowser for help on using the repository browser.