|
RDK Documentation (Open Sourced RDK Components)
|
33 #include "trm/TunerReservation.h"
34 #include "ReservationCustomAttributes.h"
40 TunerReservationBase::TunerReservationBase(
41 const std::string &device,
42 const std::string &serviceLocator,
43 const uint64_t startTime,
44 const uint64_t duration,
46 const std::string &reservationToken,
48 : reservationToken(reservationToken),
50 serviceLocator(serviceLocator),
54 customAttributes(customAttributes)
59 TunerReservationBase::~TunerReservationBase(
void)
73 reservationToken = token;
85 return reservationToken;
96 return serviceLocator;
157 serviceLocator = _serviceLocator;
171 this->startTime = startTime;
185 this->duration = duration;
200 int64_t currentEpochMillis = GetCurrentEpoch();
202 int64_t expirationTime =
static_cast<int64_t
>((((int64_t)startTime) - ((int64_t)currentEpochMillis)) + ((int64_t)duration));
203 if (expirationTime < 0) expirationTime = 0;
205 return expirationTime;
236 return customAttributes;
257 this->customAttributes = customAttributes;
272 std::cout <<
"[OBJ][" << klassName() <<
"] reservationToken = "<< reservationToken << std::endl;
273 std::cout <<
"[OBJ][" << klassName() <<
"] device = " << device << std::endl;
274 std::cout <<
"[OBJ][" << klassName() <<
"] serviceLocator = " << serviceLocator << std::endl;
275 std::cout <<
"[OBJ][" << klassName() <<
"] startTime = " << startTime << std::endl;
276 std::cout <<
"[OBJ][" << klassName() <<
"] duration = " << duration << std::endl;
void setServiceLocator(const std::string &_serviceLocator)
This function is used to set the locator of the service that the tuner will tune to....
uint64_t getStartTime(void) const
This function is used to get the start time of the reservation in milliseconds from the epoch.
virtual void print(void) const
This function is used to print the following attributes of tunerReservation token.
The Activity class represents the request or granted usage of a tuner. The activity field in the clas...
void setStartTime(const uint64_t &_startTime)
This function is used to set the start time of the reservation in milliseconds from the epoch....
void setReservationToken(const std::string &token)
This function is used to set a unique token generated when a reservation is created....
const std::string & getDevice(void) const
This function is used to get the remote device id requesting for tuner reservation.
const ReservationCustomAttributes * getCustomAttributes(void) const
This function is used to return the custom attributes assigned by the application....
void setCustomAttributes(ReservationCustomAttributes *)
This function is used to set the attributes assigned by the application. These attributes are associa...
uint64_t getExpirationTime(void) const
This function is used to return remaining tuner reservation time.
void print(void) const
Print the list of recording(s) details which are being scheduled. The defined fields are,...
const Activity & getActivity(void) const
This function is used to return the granted activity. Granted activity may or may not be the same as ...
const std::string & getServiceLocator(void) const
This function is used to return the locator of the service that the tuner is tuned to.
uint64_t getDuration(void) const
This function is used to get the reservation period measured from the start in milliseconds.
void setDuration(const uint64_t &_duratioin)
This function is used to set the reservation duration measured from the start in milliseconds....
const std::string & getReservationToken(void) const
This function is used to return the unique token generated when a reservation is created.
void addDetail(const std::string &key, const std::string &value)
This API is used to add the details describing the activity in to a list.
void addDetail(const std::string &key, const std::string &value)
This function is used to add the details describing the tuner reservation activity in to the activity...