@@ -58,6 +58,24 @@ let DurabilityPolicy = {
5858 RMW_QOS_POLICY_DURABILITY_VOLATILE : 2 ,
5959} ;
6060
61+ /**
62+ * Enum for LivelinessPolicy
63+ * @readonly
64+ * @enum {number}
65+ */
66+ let LivelinessPolicy = {
67+ /** @member {number} */
68+ RMW_QOS_POLICY_LIVELINESS_SYSTEM_DEFAULT : 0 ,
69+ /** @member {number} */
70+ RMW_QOS_POLICY_LIVELINESS_AUTOMATIC : 1 ,
71+ /** @member {number} */
72+ RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_TOPIC : 3 ,
73+ /** @member {number} */
74+ RMW_QOS_POLICY_LIVELINESS_UNKNOWN : 4 ,
75+ /** @member {number} */
76+ RMW_QOS_POLICY_LIVELINESS_BEST_AVAILABLE : 5 ,
77+ } ;
78+
6179/** Class representing middleware quality of service */
6280class QoS {
6381 /**
@@ -73,12 +91,14 @@ class QoS {
7391 depth = 0 ,
7492 reliability = ReliabilityPolicy . RMW_QOS_POLICY_RELIABILITY_SYSTEM_DEFAULT ,
7593 durability = DurabilityPolicy . RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT ,
94+ liveliness = LivelinessPolicy . RMW_QOS_POLICY_LIVELINESS_SYSTEM_DEFAULT ,
7695 avoidRosNameSpaceConventions = false
7796 ) {
7897 this . _history = history ;
7998 this . _depth = depth ;
8099 this . _reliability = reliability ;
81100 this . _durability = durability ;
101+ this . _liveliness = liveliness ;
82102 this . _avoidRosNameSpaceConventions = avoidRosNameSpaceConventions ;
83103 }
84104
@@ -112,6 +132,16 @@ class QoS {
112132 return DurabilityPolicy ;
113133 }
114134
135+ /**
136+ * Get LivelinessPolicy enum.
137+ * @name QoS#static get:LivelinessPolicy
138+ * @function
139+ * @return {LivelinessPolicy }
140+ */
141+ static get LivelinessPolicy ( ) {
142+ return LivelinessPolicy ;
143+ }
144+
115145 /**
116146 * Get the history value.
117147 * @name QoS#get:history
@@ -220,6 +250,33 @@ class QoS {
220250 this . _durability = durability ;
221251 }
222252
253+ /**
254+ * Get the liveliness value.
255+ * @name QoS#get:liveliness
256+ * @function
257+ * @return {number }
258+ */
259+ get liveliness ( ) {
260+ return this . _liveliness ;
261+ }
262+
263+ /**
264+ * Set the liveliness value.
265+ * @param {number } liveliness - value to be set.
266+ * @name QoS#set:liveliness
267+ * @function
268+ * @return {undefined }
269+ */
270+ set liveliness ( liveliness ) {
271+ if ( typeof liveliness !== 'number' ) {
272+ throw new TypeValidationError ( 'liveliness' , liveliness , 'number' , {
273+ entityType : 'qos' ,
274+ } ) ;
275+ }
276+
277+ this . _liveliness = liveliness ;
278+ }
279+
223280 /**
224281 * Get the avoidRosNameSpaceConventions value.
225282 * @name QoS#get:avoidRosNameSpaceConventions
0 commit comments