7

Please advise me to how to achieve NSOperation and NSOperationQueue functionality in C++.

user1908860
  • 509
  • 1
  • 9
  • 19

2 Answers2

2

NSOperation is a class for managing non-critical tasks. You create Operations, and place them on the NSOperationQueue and each operation is performed as the app executes.

There is no such "equivalent" in C++. C++ is a language, as NSOperationQueue is part of FoundationKit a part of OSX and iOS, a set of Objective-C objects, that aren't part of the objective-c standard.

What you'll need to research is the Android paradigms for doing task concurrency, and use those. Or you can just manually download the assets from the server, in-lieu of any managed task library.

Alan
  • 45,915
  • 17
  • 113
  • 134
  • I need to do more or similar stuff. we don't manual download as we are developing a professional live game. I know NSOperation and NSOperationQueue is part of obj c foundation but my question if we have to achieve similar thing in C++ then how to achieve that ? – user1908860 Dec 21 '12 at 01:50
  • You're not doing something similar in C++. You're doing something similar in Android. C++ is just a language. Look at how Android does concurrent task management, and it should have examples on how to do this in C++. – Alan Dec 21 '12 at 02:10
1

A rough substitute for NSOperation: std::packaged_task.

John K
  • 859
  • 1
  • 8
  • 16