rajnish said:
Hi Gurus,
I am a newbee in C++ field. And I have been assigned to complete a
task of create a template class, so that names pipes can be created
using this template. I don't have a clue from where to start ...
I would suggest that you ask the person who made the assignment. This is not
an easy or obvious task and it is unfair to ask you to do it if you don't
have any clue.
I would be thankful if you could provide my any such template or
refernce to start.
The named pipe part is off topic in this group. C++ does not have named
pipes so if you need to know how to create named pipes you should ask on a
group that discusses programming on whatever operating system you are using.
But in general terms what you need to do is derive a new class from
basic_streambuf. Here is a link that discusses this
http://ou800doc.caldera.com/en/SDK_clib/_Deriving_New_streambuf_Classes.html.
However this discusses deriving from streambuf not basic_streambuf. The
differrence is that streambuf works on char only, but basic_streambuf is a
template where the type of character is the first template parameter. Since
you've been asked to write a template I guess that you need to derive from
basic_streambuf. But the principles are pretty similar in either case.
I have no idea of the quailty of the link above, it was just the first hit I
got with google.
john