// 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"

/* 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.
 *
 * To construct an FEPClient, an input file (containing network data) and
 * a host server_ip (for the ATMS) need to be specified.
 *
 * Author: John A. Torres
 * Version: 9/8/2017
 */
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__
