RenderSequenceInfo.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. 'use strict';
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. /**
  4. * Licensed Materials - Property of IBM
  5. * IBM Business Analytics (C) Copyright IBM Corp. 2019
  6. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. */
  8. /**
  9. * @class VisRenderSequenceInfo
  10. * @hideconstructor
  11. * @classdesc Store the latest render sequence info and render task info
  12. */
  13. define(['underscore', './RenderTaskExecInfo'], function (_, RenderTaskExecInfo) {
  14. var RenderSequenceInfo = function () {
  15. function RenderSequenceInfo(options) {
  16. _classCallCheck(this, RenderSequenceInfo);
  17. this._id = options.id;
  18. this._allTaskInfo = {};
  19. }
  20. RenderSequenceInfo.prototype.getId = function getId() {
  21. return this._id;
  22. };
  23. RenderSequenceInfo.prototype.addTaskInfo = function addTaskInfo(taskInfo) {
  24. var taskExecInfo = new RenderTaskExecInfo({ id: taskInfo.taskId });
  25. this._allTaskInfo[taskInfo.taskId] = taskExecInfo;
  26. return taskExecInfo;
  27. };
  28. RenderSequenceInfo.prototype.getTaskInfo = function getTaskInfo(taskId) {
  29. return this._allTaskInfo[taskId];
  30. };
  31. RenderSequenceInfo.prototype.toJSON = function toJSON() {
  32. return {
  33. 'id': this._id,
  34. 'tasks': _.values(this._allTaskInfo).map(function (value) {
  35. return value.toJSON();
  36. })
  37. };
  38. };
  39. return RenderSequenceInfo;
  40. }();
  41. return RenderSequenceInfo;
  42. });
  43. //# sourceMappingURL=RenderSequenceInfo.js.map