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

net.sf.jrtps.udds.EntityFactory 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.RTPSWriter;

/**
 * EntityFactory is used to create instances of uDDS entities. 
 * By giving an instance of EntityFactory to Participant, one
 * can provide customized entities to application.
 * 
 * @see Participant#Participant(int, int, EntityFactory, net.sf.jrtps.Configuration)
 * @see Participant#setEntityFactory(EntityFactory)
 * 
 * @author mcr70
 */
public class EntityFactory {

    /**
     * Empty constructor. 
     */
    protected EntityFactory() {
    }
    
    /**
     * Create a new DataWriter.
     * @param p Participant that is parent of created DataWriter
     * @param type a Class representing the type of writer
     * @param rtpsWriter RTPSWriter to be associated with created DataWriter
     * @param hCache HistoryCache of DataWriter
     * @return DataWriter
     */
    protected  DataWriter createDataWriter(Participant p, Class type, RTPSWriter rtpsWriter, 
            HistoryCache hCache) {
        return new DataWriter<>(p, type, rtpsWriter, hCache);
    }
    
    /**
     * Create a new DataReader.
     * @param p Participant that is parent of created DataReader
     * @param type a Class representing the type of reader
     * @param rtpsReader RTPSReader to be associated with created DataReader
     * @return DataReader
     */
    protected  DataReader createDataReader(Participant p, Class type, RTPSReader rtpsReader) {
        return new DataReader<>(p, type, rtpsReader);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy