Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[CML] FileInStream in Constructor
#1
FileInStream is not a copyable class nor does it have a constructor which allows you to use another FileInStream to populate a member variable. So how do you pass a FileInStream into a constructor and copy it to a member variable so that it stays alive for the entire class?

I'm looking to do something like:

Code:
Constructor([In] FileInStream CSVFile)
    Begin
        m_CSVFile := CSVFile;
    EndConstructor;
David
Z-Wave World Magazine|Baltimore Hackerspace
"Why think outside the box when you could let the box think for you." - My take on Home Automation
Reply
#2
There's no way to do that. You'd pass in the information required to construct the file stream. That kind of thing is purposefully disallowed, i.e. the reason there are uncopyable classes, because then you could have two different objects referencing the same stream, and it could be a mess and hard to debug. So only those classes that only contain members (directly and indirectly) that are copyable are themselves copyable.
Dean Roddey
Explorans limites defectum
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  FileInStream zra 1 92 11-01-2019, 11:27 AM
Last Post: zra
  Using a CML constructor (How) bph 7 1,681 09-21-2009, 01:42 PM
Last Post: Dean Roddey
  Can't set Constructor Parameters in Class Members wuench 6 1,847 02-10-2009, 05:40 PM
Last Post: wuench

Forum Jump:


Users browsing this thread: 1 Guest(s)