source: tmcsimulator/branches/WorkingFEPSimulator/FEPSim.h @ 107

Revision 107, 1.5 KB checked in by jtorres, 9 years ago (diff)

Added branches/WorkingFEPSimulator: hopefully working, that is

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 {
43public:
44    /* members */
45    CLIENT *clnt; // RPC Client
46
47    /* methods */
48    FEPSim(char * ATMSHost); // Constructor
49   
50    void updateATMS(char * xml); // updates ATMS
51
52    ~FEPSim(); // Destructor
53
54private:
55    /* members */
56    char * ATMSHost;
57
58    /* methods */
59    void handleCallResponse(void *response); //
60    bool createClient(char *host);
61    void sendReplys(char * xml);
62
63};
64
65#endif // __FEPSIM_H_INCLUDED__
Note: See TracBrowser for help on using the repository browser.