/*
 * capability.h
 *
 *  Created on: 29 Jun 2015
 *      Author: john
 */

#ifndef INCLUDE_CAPABILITY_H_
#define INCLUDE_CAPABILITY_H_

#include <object.h>

class cObjectCapability : public cObject
{
public:
   cObjectCapability();
   cObjectCapability(cObjectCapability *obj);
   ~cObjectCapability();
   virtual cTagList * getTags();
   virtual bool parse(KourierObject *ko,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


   virtual bool compIndex(cObject *);
   virtual bool operator < (cObject &rhs);
   virtual char * printKey();
   virtual cObject *clone();
   uint32_t getCapId() const;
   void setCapId(uint32_t capId);
   uint32_t getDeviceSerial() const;
   void setDeviceSerial(uint32_t deviceSerial);
   const char* getLabel() const;
   void setLabel(const char* label);
   const char* getValue() const;
   void setValue(const char* value);

private:
   void populate_tags(KTag *);

   uint32_t mDeviceSerial;
   uint32_t mCapId;
   char * mLabel;
   char * mValue;
};



#endif /* INCLUDE_CAPABILITY_H_ */
