Home | History | Annotate | Download | only in kms++
      1 #pragma once
      2 
      3 #include <map>
      4 #include <memory>
      5 
      6 #include "drmobject.h"
      7 #include "decls.h"
      8 
      9 namespace kms
     10 {
     11 
     12 class DrmPropObject : public DrmObject
     13 {
     14 	friend class Card;
     15 public:
     16 	void refresh_props();
     17 
     18 	Property* get_prop(const std::string& name) const;
     19 
     20 	uint64_t get_prop_value(uint32_t id) const;
     21 	uint64_t get_prop_value(const std::string& name) const;
     22 	std::unique_ptr<Blob> get_prop_value_as_blob(const std::string& name) const;
     23 
     24 	const std::map<uint32_t, uint64_t>& get_prop_map() const { return m_prop_values; }
     25 
     26 	int set_prop_value(uint32_t id, uint64_t value);
     27 	int set_prop_value(const std::string& name, uint64_t value);
     28 
     29 protected:
     30 	DrmPropObject(Card& card, uint32_t object_type);
     31 	DrmPropObject(Card& card, uint32_t id, uint32_t object_type, uint32_t idx = 0);
     32 
     33 	virtual ~DrmPropObject();
     34 
     35 private:
     36 	std::map<uint32_t, uint64_t> m_prop_values;
     37 };
     38 }
     39