|
PreCache NetInjector Documentation Center : PreCache NetInjector Application Development Common Cases, Subscription C++ |
|
|
|
Retrieving discretionary attributes retrieving discretionary attribute values In accessing the data for a discretionary attribute, we relied on the publisher's definition of the attribute. By filtering on that specific value, our subscriber could retrieve the content of notifications matching her criteria. We can also enhance the subscription so that the proxy retrieves the values assigned to the discretionary attribute. pNotification->GetDiscretionaryAttr("Interest", (void*&)interest,typecode,size); GetDiscretionaryAttr adds the value of the discretionary attribute Interest to the subscription. The value of this attribute has already been set by the publisher as Country Music. ( Common Cases, Publication C++) So as to call GetDiscretionaryAttr, we add the statement above to a new instance of the Subscriber class, Subscriber2. When the proxy creates the new subscription, including the filter for the discretionary attribute Interest, the Subscribe method invokes Subscriber2. p.Subscribe("Sample.Chat","Interest == \"Country Music\"Music\"",new Subscriber2(),strdup("Country music fans")); Our new subscriber definition enables the subscriber to retrieve content more tightly coupled to her interests. |
|