CDataSinkFactory

Name

CDataSinkFactory -- Create an appropriate CDataSink object

Synopsis


       CDataSinkFactory {
      
  virtual  CDataSink( makeSink(std::string uri);
};
   

DESCRIPTION

Factory for data sinks. Note that if you define your own type of data sink you can extend this factory by deriving and overriding makeSink. Just be sure to pass any unrecognized uri protocols to the base class makeSink.

METHODS

The factory only has a single public method: makeSink. This method takes a single std::string parameter; a URI that describes the sink to create. On success, this factory method returns a pointer to a dynamically allocated CDataSink. It is the caller's responsibility to delete this object.

To understand how this function works, we need to first look at the structure of a URI (Uniform Resource Identifier). The generic form of a URI is:

protocol://host[:port]/path

The protocol part of the URI identifies the type of sink to create.

file protocols create CFileDataSink objects. For those the host and port are ignored and the path identifies the file system path at which the sink file is created.

ring or tcp protocols will create a ring data source. The path is the ring name. host must either be empty or be localhost or an error is thrown.

The special value of - for the URI will create a CFileDataSink open on the program's standard output. This facilitates opening sinks for programs used in filter pipelines.