The main concept behind DDS is to decouple Publishers from Subscribers as much as possible, so most of the time you don't need to know and you don't want to know how many subscribers are subscribed to your data. (Using this knowledge inherently re-intoduces this coupling into your system). A smart networking implementation (one that uses discovery like OpenSplice DDS and probably some others as well) will make sure no samples are transmitted over the network when there is no-one else who is interested in that data: that is normally something that the middleware should solve for you, you don't want to do that kind of optimization in your application code.
But if you really want to know: you can probably look it up using the builtin topics. Each Writer in your Domain is represented by a separate instance of the DCPSPublication topic, and each Reader by an instance of the DCPSSubscription topic. By comparing the DCPSPublication instances with the DCPSSubscription instances you can find out which Readers and Writers are able to communicate: that is the case when they operate on the same topic and have compatible Qos settings. (Be aware: for QosPolicies that are labeled as RxO the rule applies that when the Qos on the Writer is of lesser quality than the Qos on the Reader no communication is established.)
Every DomainParticipant you create contains a builtin subscriber, that gives you access to these builtin topics. Simply use the get_builtin_subscriber operation on the DomainParticipant to access its builtin subscriber.
The builtin subscriber contains separate datareaders for each individual builtin topic, which you can access by invoking its lookup_datareader operation, passing the name of the builtin topic you want to read from as its parameter.
The builtin topic reader works like an ordinary DDS datareader, you can either read all builtin topics from it, or use a query to find a particular builtin topic sample.
In the example above, if you are interested in which readers are subscribing to your writer (let's say a writer for topic "Foo"), you would need to look up the reader for the "DCPSSubscription" builtin topic. You can create a query to receive only the readers that subscribe to topic "Foo" by specifyinf an SQL expression like:
topic_name = "Foo"
in this expression, "topic_name" is the field of the DCPSSubscription topic that specifies to which topic a DataReader is subscribed.