/*
 * sitecfg.h
 *
 *  Created on: 17 Oct 2013
 *      Author: john
 */

#ifndef SITECFG_H_
#define SITECFG_H_

#include <object.h>

class cObjectSiteConfig : public cObject
{

public:
   cObjectSiteConfig();
   cObjectSiteConfig(cObjectSiteConfig *obj);
   ~cObjectSiteConfig();

   cTagList * getTags();
   bool parse(KourierObject *, std::vector<KTag*>* ct = NULL);


	//potential problem with conversion as library returns double and we are casting to float.
	bool parse(json_t *dataArray); //JSON
	   //uses the append_new function for return arrays so that the json ref stays at 1
	   //returns an array of all the values
	json_t * getJSONObj(); //for JSON



   bool compIndex(cObject *obj);
   bool operator <(cObject &rhs);
   char * printKey();
   cObject * clone();

   uint32_t getConfigNum() const;
   void setConfigNum(uint32_t configNum);
   uint32_t getCurrentSeq() const;
   void setCurrentSeq(uint32_t currentSeq);
   uint32_t getCurrentTrendSeq() const;
   void setCurrentTrendSeq(uint32_t currentTrendSeq);
   uint32_t getLastSeq() const;
   void setLastSeq(uint32_t lastSeq);
   uint32_t getLastTrendSeq() const;
   void setLastTrendSeq(uint32_t lastTrendSeq);
   const char* getNmsAddress() const;
   void setNmsAddress(const char* nmsAddress);
   const char* getSiteId() const;
   void setSiteId(const char* siteId);
   const char* getSiteLabel() const;
   void setSiteLabel(const char* siteLabel);
   eObjectOpState getSiteOpState() const;
   void setSiteOpState(eObjectOpState siteOpState);
   uint32_t getVersion() const;
   void setVersion(uint32_t version);
   uint32_t getCurrentAdhocSeq() const;
   void setCurrentAdhocSeq(uint32_t);
   uint32_t getLastAdhocSeq() const;
   void setLastAdhocSeq(uint32_t);
   const char* getSVPAddress() const;
   void setSVPAddress(const char*);
   uint32_t getSVPPort() const;
   void setSVPPort(uint32_t);
private:

   void populate_tags(KTag * tag);
   uint32_t mConfigNum;

   /*Local RO data */
   char *mSiteID;
   uint32_t mCurrentSeq;
   uint32_t mCurrentTrendSeq;

   /*Local RW data*/
   char *mSiteLabel;
   eObjectOpState mSiteOpState;
   uint32_t mLastSeq;
   uint32_t mLastTrendSeq;
   char *mNMSAddress;

   uint32_t mVersion;

   uint32_t mCurrentAdhocSeq;
   uint32_t mLastAdhocSeq;

   char * mSVPAddress;
   uint32_t mSVPPort;

};



#endif /* SITECFG_H_ */
