Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > c++ named pipe example

Reply
Thread Tools

c++ named pipe example

 
 
rajnish
Guest
Posts: n/a
 
      10-22-2004
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 be thankful if you could provide my any such template or
refernce to start.

Best regards,
 
Reply With Quote
 
 
 
 
Lionel B
Guest
Posts: n/a
 
      10-22-2004
rajnish wrote:
> 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 ...


Named pipes are not part of the C++ language, so this question is
off-topic here. Suggest you try a unix newsgroup.

--
Lionel B

 
Reply With Quote
 
 
 
 
John Harrison
Guest
Posts: n/a
 
      10-22-2004

"rajnish" <> wrote in message
news: om...
> 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_c...f_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


 
Reply With Quote
 
John Harrison
Guest
Posts: n/a
 
      10-22-2004

"Lionel B" <> wrote in message
news: oups.com...
> rajnish wrote:
> > 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 ...

>
> Named pipes are not part of the C++ language, so this question is
> off-topic here. Suggest you try a unix newsgroup.
>


I/O in general terms is certainly on topic here.

Named pipes also exist on Windows.

john


 
Reply With Quote
 
rajnish
Guest
Posts: n/a
 
      10-25-2004
"John Harrison" <> wrote in message news:<>...
> "Lionel B" <> wrote in message
> news: oups.com...
> > rajnish wrote:
> > > 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 ...

> >
> > Named pipes are not part of the C++ language, so this question is
> > off-topic here. Suggest you try a unix newsgroup.
> >

>
> I/O in general terms is certainly on topic here.
>
> Named pipes also exist on Windows.
>
> john


This template should be in c++ i.e. cross-platform (compiled using
gcc) ... was able to write simple c like code but not template ... I
wish if there could be any libaray with such a functionality ... I
think it is matter of time to learn templates ... only sorry thing is
time (which I am lacking at this moment)

Any help .. thanks in advance !!!
 
Reply With Quote
 
John Harrison
Guest
Posts: n/a
 
      10-25-2004
>
> This template should be in c++ i.e. cross-platform (compiled using
> gcc) ... was able to write simple c like code but not template ... I
> wish if there could be any libaray with such a functionality ... I
> think it is matter of time to learn templates ... only sorry thing is
> time (which I am lacking at this moment)
>


It's not just templates that you have to learn, its the C++ I/O system. In
fact I wouldn't bother with a template at first. Just write your own stream
class, this means deriving classes from streambuf like I described earlier.
You can add in the template later, I think this will be the easier part of
the project.

john


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
named pipe in java Bruintje Beer Java 2 09-27-2005 09:37 PM
named pipe problem on linux richard C++ 5 11-02-2004 07:44 PM
[named pipe] i wanna know about validate of pipe handle of client lee, wonsun C++ 1 11-02-2004 04:29 AM
named pipe question Rajarshi Guha Python 4 07-15-2004 11:52 AM
Why does IO::Pipe::END generate an EXCEPT pipe message? lvirden@gmail.com Perl Misc 1 06-02-2004 02:17 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57