/* 
 * File: FEPClient.h
 * 
 * The FEPClient is an RPC Client which transfers network data to the
 * ATMS Server.
 *
 * An FEPClient is created every 30 seconds, and an fep_reply structure
 * for every FEP_LINE_LDS is transferred to the ATMS through an RPC Call.
 * After the FEPClient has transferred all fep_replys, it is destroyed.
 *
 * An FEPClient is script-like in nature. There are no public methods other than
 * the constructor. To construct an FEPClient, an input file (containing network 
 * data in xml form) and a host server_ip (for the ATMS) are necessary. The 
 * format of the xml input file can be fount in "networkReader.cpp" source file.
 *
 * @author John A. Torres
 * @version 9/8/2017
 */

// Include guard
#ifndef __FEPCLIENT_H_INCLUDED__
#define __FEPCLIENT_H_INCLUDED__

// Forward declared dependencies
class NetworkReader;

// Included dependencies
#include "fep.h"
#include <iostream>
#include <stdlib.h>
#include "time.h"
#include "NetworkReader.h"

class FEPClient
{
	public:
        /* members */
		CLIENT *clnt; // RPC Client

        /* methods */
		FEPClient(char * host, char * networkFile); // Constructor
		~FEPClient(); // Destructor

	private:
        /* members */
        NetworkReader *networkReader;

        /* methods */
		void handleCallResponse(void *response); //
		void createClient(char *host);
        void updateATMS(); // updates ATMS

};

#endif // __FEPCLIENT_H_INCLUDED__
