Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   What is the proper way to do this... (http://www.velocityreviews.com/forums/t280195-what-is-the-proper-way-to-do-this.html)

JustSomeGuy 12-22-2003 07:14 PM

What is the proper way to do this...
 
I have a data stream that can come from a buffer of data, a socket or a
file.
What is the correct object oriented way to process this stream such as to
abstract the method from knowing where the data is comming from?



Ron Natalie 12-22-2003 07:19 PM

Re: What is the proper way to do this...
 

"JustSomeGuy" <nope@nottelling.com> wrote in message news:joHFb.781847$pl3.49041@pd7tw3no...
> I have a data stream that can come from a buffer of data, a socket or a
> file.
> What is the correct object oriented way to process this stream such as to
> abstract the method from knowing where the data is comming from?
>

Create a stream buffer that handles the source-specific stuff and then create
an istream that uses it.

JustSomeGuy 12-22-2003 07:33 PM

Re: What is the proper way to do this...
 

"Ron Natalie" <ron@sensor.com> wrote in message
news:3fe6fc6e$0$407$9a6e19ea@news.newshosting.com. ..
>
> "JustSomeGuy" <nope@nottelling.com> wrote in message

news:joHFb.781847$pl3.49041@pd7tw3no...
> > I have a data stream that can come from a buffer of data, a socket or a
> > file.
> > What is the correct object oriented way to process this stream such as

to
> > abstract the method from knowing where the data is comming from?
> >

> Create a stream buffer that handles the source-specific stuff and then

create
> an istream that uses it.


Can you give me a small example of the stream class use? If its not too
much trouble?



Ron Natalie 12-22-2003 08:01 PM

Re: What is the proper way to do this...
 

"JustSomeGuy" <nope@nottelling.com> wrote in message news:UFHFb.783652$6C4.476028@pd7tw1no...

> Can you give me a small example of the stream class use? If its not too
> much trouble?
>

It is more than I care to type in right now. I suggest you get
Nick Josuttis's book: The C++ Standard Library. It covers it.


Derek 12-22-2003 08:51 PM

Re: What is the proper way to do this...
 
"JustSomeGuy"...
> Can you give me a small example of the stream class use? If
> its not too much trouble?


This might help:

http://www.informatik.uni-konstanz.d.../c++/iostream/




All times are GMT. The time now is 03:56 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.