What is the proper way to do this...

J

JustSomeGuy

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?
 
R

Ron Natalie

JustSomeGuy said:
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.
 
J

JustSomeGuy

Ron Natalie said:
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?
 
R

Ron Natalie

JustSomeGuy said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top