All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.jrtps.udds.DataReader Maven / Gradle / Ivy

There is a newer version: 1.5.1
Show newest version
package net.sf.jrtps.udds;

import net.sf.jrtps.rtps.RTPSReader;
import net.sf.jrtps.rtps.SampleListener;

/**
 * This class represents a strongly typed DataReader in spirit of DDS
 * specification.
 * 
 * @author mcr70
 * 
 * @param 
 *            Type of the DataReader. Type may be obtained from an external tool
 *            like IDL compiler, or it may be more dynamically constructed
 *            Object that is used with uDDS.
 */
public class DataReader extends Entity {
    private RTPSReader rtps_reader;

    /**
     * Package access. This class is only instantiated by Participant class.
     * 
     * @param topicName
     */
    DataReader(Participant p, Class type, RTPSReader reader) {
        super(p, type, reader.getTopicName());
        this.rtps_reader = reader;
    }

    /**
     * Adds a new listener for this DataReader.
     * 
     * @param listener
     *            a DataListener to add.
     */
    public void addListener(SampleListener listener) {
        rtps_reader.addListener(listener);
    }

    /**
     * Removes a listener.
     * 
     * @param listener
     *            DataListener to remove
     */
    public void removeListener(SampleListener listener) {
        rtps_reader.removeListener(listener);
    }

    RTPSReader getRTPSReader() {
        return rtps_reader;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy