Open GoogleCodeExporter opened 9 years ago
[deleted comment]
This is more of a C++ question than an lsl question. However, I think what you
want is to declare my_inlet as a pointer in your object and then use the new
keyword to grab the memory for it:
lsl::stream_inlet *my_inlet; // member declaration
my_inlet = new lsl::stream_inlet(<constructor args>); // in the constructor code
Two things about this. First, you will have to manually destroy the inlet.
Second, since it is now a pointer rather than an actual inlet, you will need to
use the "->" rather than the "." to reference its members.
Original comment by david.er...@gmail.com
on 16 Mar 2015 at 10:22
I thought it might be the 'new' keyword. Thanks. Though this question was
specifically for what I'm doing, I do think it would be generally useful to
have a C++ example that uses classes.
Original comment by chadwick...@gmail.com
on 16 Mar 2015 at 11:21
By the way, thank you very much for the tip, and I think you can probably close
this issue. Now that I know the answer it seems rather trivial, and should be
something I knew and surely anyone that uses C++ regularly will know.
Original comment by chadwick...@gmail.com
on 17 Mar 2015 at 2:17
No problem, Chad. I had many similar difficulties when I first got started with
C++.
Original comment by david.er...@gmail.com
on 17 Mar 2015 at 6:45
Original issue reported on code.google.com by
chadwick...@gmail.com
on 11 Mar 2015 at 2:26