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
The factory only has a single public method:
This method takes a single std::string parameter; a URI
that describes the sink to create. On success, this factory method
a pointer to a dynamically allocated
It is the caller's responsibility to
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:
The protocol part of the URI identifies the type of sink to create.
file protocols create
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
CFileDataSink open on the program's
standard output. This facilitates opening sinks for programs used
in filter pipelines.