c++ named pipe example

Discussion in 'C++' started by rajnish, Oct 22, 2004.

  1. rajnish

    rajnish Guest

    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,
     
    rajnish, Oct 22, 2004
    #1
    1. Advertising

  2. rajnish

    Lionel B Guest

    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
     
    Lionel B, Oct 22, 2004
    #2
    1. Advertising

  3. "rajnish" <> wrote in message
    news:...
    > 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
     
    John Harrison, Oct 22, 2004
    #3
  4. "Lionel B" <> wrote in message
    news:...
    > 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
     
    John Harrison, Oct 22, 2004
    #4
  5. rajnish

    rajnish Guest

    "John Harrison" <> wrote in message news:<>...
    > "Lionel B" <> wrote in message
    > news:...
    > > 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 !!!
     
    rajnish, Oct 25, 2004
    #5
  6. >
    > 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
     
    John Harrison, Oct 25, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bruintje Beer

    named pipe in java

    Bruintje Beer, Sep 27, 2005, in forum: Java
    Replies:
    2
    Views:
    9,117
    Roedy Green
    Sep 27, 2005
  2. richard

    named pipe problem on linux

    richard, Nov 1, 2004, in forum: C++
    Replies:
    5
    Views:
    1,001
    Sybren Stuvel
    Nov 2, 2004
  3. lee, wonsun
    Replies:
    1
    Views:
    494
    Jack Klein
    Nov 2, 2004
  4. Rajarshi Guha

    named pipe question

    Rajarshi Guha, Jul 13, 2004, in forum: Python
    Replies:
    4
    Views:
    438
    John Lenton
    Jul 15, 2004
  5. Replies:
    1
    Views:
    230
    Ben Morrow
    Jun 2, 2004
Loading...

Share This Page