/*
 * trend.h
 *
 *  Created on: 22 Oct 2013
 *      Author: john
 */

#ifndef TREND_H_
#define TREND_H_

#include <object.h>

class cObjectTrend : public cObject
{
public:
   cObjectTrend();
   cObjectTrend(cObjectTrend *obj);
   ~cObjectTrend();

   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();

   float getCalculatedValue() const;
   void setCalculatedValue(float calculatedValue);
   uint32_t getDeviceSerial() const;
   void setDeviceSerial(uint32_t deviceSerial);
   uint32_t getObjectType() const;
   void setObjectType(uint32_t objectType);
   uint32_t getPortId() const;
   void setPortId(uint32_t portId);
   uint32_t getStartSeqNum() const;
   void setStartSeqNum(uint32_t startSeqNum);
   uint32_t getTimeStamp() const;
   void setTimeStamp(uint32_t timeStamp);
   uint32_t getTrendSeqNum() const;
   void setTrendSeqNum(uint32_t trendSeqNum);

private:
   void populate_tags(KTag *);

   uint32_t mTrendSeqNum;
   uint32_t mTimeStamp;
   uint32_t mDeviceSerial;
   uint32_t mPortID;
   uint32_t mObjectType;
   float mCalculatedValue;

   /* For Limited Queries */
   uint32_t mStartSeqNum;


};

#endif /* TREND_H_ */
